32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/ofstd/oflist.h"
35 #define INCLUDE_CSTRING
36 #include "dcmtk/ofstd/ofstdinc.h"
38 #define DcmRLEEncoder_BLOCKSIZE 16384
52 virtual void write(
const unsigned char *buf,
size_t bufsize) =0;
104 inline void add(
unsigned char ch)
181 inline void add(
const unsigned char *buf,
size_t bufcount)
185 while (bufcount--)
add(*buf++);
259 if (
pad_ && (result & 1)) result++;
268 if (
fail_)
return OFTrue;
else return OFFalse;
275 inline void write(
void *target)
const
277 if ((!
fail_) && target)
279 unsigned char *current = NULL;
280 unsigned char *target8 = OFstatic_cast(
unsigned char *, target);
282 OFListConstIterator(
unsigned char *) last =
blockList_.
end();
283 while (first != last)
286 memcpy(target8, current, DcmRLEEncoder_BLOCKSIZE);
287 target8 += DcmRLEEncoder_BLOCKSIZE;
313 OFListConstIterator(
unsigned char *) last =
blockList_.
end();
314 while (first != last)
316 os.
write(*first, DcmRLEEncoder_BLOCKSIZE);
346 inline void move(
size_t numberOfBytes)
349 while (i < numberOfBytes)
351 if (
offset_ == DcmRLEEncoder_BLOCKSIZE)