92 #define JPC_BITSTREAM_READ 0x01
94 #define JPC_BITSTREAM_WRITE 0x02
101 #define JPC_BITSTREAM_NOCLOSE 0x01
103 #define JPC_BITSTREAM_EOF 0x02
105 #define JPC_BITSTREAM_ERR 0x04
125 jas_stream_t *stream_;
137 jpc_bitstream_t *jpc_bitstream_sopen(jas_stream_t *stream,
const char *mode);
140 int jpc_bitstream_close(jpc_bitstream_t *bitstream);
148 #define jpc_bitstream_getbit(bitstream) \
149 jpc_bitstream_getbit_func(bitstream)
151 #define jpc_bitstream_getbit(bitstream) \
152 jpc_bitstream_getbit_macro(bitstream)
157 #define jpc_bitstream_putbit(bitstream, v) \
158 jpc_bitstream_putbit_func(bitstream, v)
160 #define jpc_bitstream_putbit(bitstream, v) \
161 jpc_bitstream_putbit_macro(bitstream, v)
165 long jpc_bitstream_getbits(jpc_bitstream_t *bitstream,
int n);
168 int jpc_bitstream_putbits(jpc_bitstream_t *bitstream,
int n,
long v);
176 int jpc_bitstream_align(jpc_bitstream_t *bitstream);
181 int jpc_bitstream_inalign(jpc_bitstream_t *bitstream,
int fillmask,
186 int jpc_bitstream_outalign(jpc_bitstream_t *bitstream,
int filldata);
190 int jpc_bitstream_needalign(
const jpc_bitstream_t *bitstream);
194 int jpc_bitstream_pending(
const jpc_bitstream_t *bitstream);
201 #define jpc_bitstream_eof(bitstream) \
202 ((bitstream)->flags_ & JPC_BITSTREAM_EOF)
211 int jpc_bitstream_getbit_func(jpc_bitstream_t *bitstream);
213 int jpc_bitstream_putbit_func(jpc_bitstream_t *bitstream,
int v);
215 int jpc_bitstream_fillbuf(jpc_bitstream_t *bitstream);
217 #define jpc_bitstream_getbit_macro(bitstream) \
218 (assert((bitstream)->openmode_ & JPC_BITSTREAM_READ), \
219 (--(bitstream)->cnt_ >= 0) ? \
220 ((int)(((bitstream)->buf_ >> (bitstream)->cnt_) & 1)) : \
221 jpc_bitstream_fillbuf(bitstream))
223 #define jpc_bitstream_putbit_macro(bitstream, bit) \
224 (assert((bitstream)->openmode_ & JPC_BITSTREAM_WRITE), \
225 (--(bitstream)->cnt_ < 0) ? \
226 ((bitstream)->buf_ = ((bitstream)->buf_ << 8) & 0xffff, \
227 (bitstream)->cnt_ = ((bitstream)->buf_ == 0xff00) ? 6 : 7, \
228 (bitstream)->buf_ |= ((bit) & 1) << (bitstream)->cnt_, \
229 (jas_stream_putc((bitstream)->stream_, (bitstream)->buf_ >> 8) == EOF) \
230 ? (EOF) : ((bit) & 1)) : \
231 ((bitstream)->buf_ |= ((bit) & 1) << (bitstream)->cnt_, \
#define jas_stream_putc(stream, c)
jas_stream_putc Write a character to a stream.
Definition: jas_stream.h:558
#define jas_image_cmptprec(image, cmptno)
Get the precision of the sample data for a component.
Definition: jas_image.h:427
#define jas_image_cmprof(image)
Get the color management profile of an image.
Definition: jas_image.h:657
unsigned jas_stream_read(jas_stream_t *stream, void *buf, unsigned cnt)
Read characters from a stream into a buffer.
Definition: jas_stream.c:670
#define jas_image_numcmpts(image)
Get the number of image components.
Definition: jas_image.h:386
int jas_stream_close(jas_stream_t *stream)
Close a stream.
Definition: jas_stream.c:610
long jas_stream_tell(jas_stream_t *stream)
Get the current position within the stream.
Definition: jas_stream.c:926
#define jas_image_width(image)
Get the width of the image in units of the image reference grid.
Definition: jas_image.h:346
int jas_stream_rewind(jas_stream_t *stream)
Seek to the beginning of a stream.
Definition: jas_stream.c:885
jas_stream_t * jas_stream_memopen(char *buf, int bufsize)
Open a memory buffer as a stream.
Definition: jas_stream.c:276
#define jas_stream_getc(stream)
jas_stream_getc Read a character from a stream.
Definition: jas_stream.h:547
JasPer Debugging-Related Functionality.
#define jas_image_cmptsgnd(image, cmptno)
Get the signedness of the sample data for a component.
Definition: jas_image.h:421
#define jas_stream_getrwcount(stream)
Get the read/write count for a stream.
Definition: jas_stream.h:520
int jas_stream_copy(jas_stream_t *out, jas_stream_t *in, int n)
Copy data from one stream to another.
Definition: jas_stream.c:1129
#define jas_image_clrspc(image)
Get the color model used by the image.
Definition: jas_image.h:392
Image class.
Definition: jas_image.h:202
#define jas_image_height(image)
Get the height of the image in units of the image reference grid.
Definition: jas_image.h:352