OpenJPEG  1.5.1
raw.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
3  * Copyright (c) 2002-2007, Professor Benoit Macq
4  * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
5  * Copyright (c) 2005, Herve Drolon, FreeImage Team
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __RAW_H
31 #define __RAW_H
32 
42 
46 typedef struct opj_raw {
48  unsigned char c;
50  unsigned int ct;
52  unsigned int lenmax;
54  unsigned int len;
56  unsigned char *bp;
58  unsigned char *start;
60  unsigned char *end;
62 
65 /* ----------------------------------------------------------------------- */
70 opj_raw_t* raw_create(void);
75 void raw_destroy(opj_raw_t *raw);
81 int raw_numbytes(opj_raw_t *raw);
88 void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len);
94 int raw_decode(opj_raw_t *raw);
95 /* ----------------------------------------------------------------------- */
99 
100 #endif /* __RAW_H */
raw_init_dec
void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len)
Initialize the decoder.
Definition: raw.c:60
opj_tile_info::packet
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
opj_raw::len
unsigned int len
length decoded
Definition: raw.h:54
opj_codestream_info::numcomps
int numcomps
component numbers
Definition: openjpeg.h:698
opj_codestream_info::tw
int tw
number of tiles in X
Definition: openjpeg.h:694
opj_free
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_malloc
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
opj_raw
RAW encoding operations.
Definition: raw.h:46
opj_tile_info::ph
int ph[33]
precinct number for each resolution level (height)
Definition: openjpeg.h:646
opj_jp2_box::type
int type
Definition: jp2.h:152
opj_packet_info::end_pos
int end_pos
packet end position
Definition: openjpeg.h:593
opj_codestream_info::numlayers
int numlayers
number of layer
Definition: openjpeg.h:700
opj_raw::bp
unsigned char * bp
pointer to the current position in the buffer
Definition: raw.h:56
PCRL
@ PCRL
precinct-component-resolution-layer order
Definition: openjpeg.h:123
opj_packet_info::start_pos
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
opj_calloc
#define opj_calloc(num, size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.h:63
opj_raw::end
unsigned char * end
pointer to the end of the buffer
Definition: raw.h:60
raw_decode
int raw_decode(opj_raw_t *raw)
Decode a symbol using raw-decoder.
Definition: raw.c:68
opj_packet_info::end_ph_pos
int end_ph_pos
end of packet header position (including EPH marker if it exists)
Definition: openjpeg.h:591
raw_destroy
void raw_destroy(opj_raw_t *raw)
Destroy a previously created RAW handle.
Definition: raw.c:50
raw_decode
int raw_decode(opj_raw_t *raw)
Decode a symbol using raw-decoder.
Definition: raw.c:68
raw_numbytes
int raw_numbytes(opj_raw_t *raw)
Return the number of bytes written/read since initialisation.
Definition: raw.c:56
LRCP
@ LRCP
layer-resolution-component-precinct order
Definition: openjpeg.h:120
cio_write
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n)
Write some bytes.
Definition: cio.c:167
opj_includes.h
opj_cio
Byte input-output stream (CIO)
Definition: openjpeg.h:475
opj_jp2_box
JP2 Box.
Definition: jp2.h:150
raw_destroy
void raw_destroy(opj_raw_t *raw)
Destroy a previously created RAW handle.
Definition: raw.c:50
write_ppixfaix
int write_ppixfaix(int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
Definition: ppix_manager.c:89
cio_tell
int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
opj_raw::c
unsigned char c
temporary buffer where bits are coded or decoded
Definition: raw.h:48
raw_numbytes
int raw_numbytes(opj_raw_t *raw)
Return the number of bytes written/read since initialisation.
Definition: raw.c:56
cio_skip
void cio_skip(opj_cio_t *cio, int n)
Skip some bytes.
Definition: cio.c:198
opj_raw::ct
unsigned int ct
number of bits already read or free to write
Definition: raw.h:50
JPIP_PPIX
#define JPIP_PPIX
Definition: indexbox_manager.h:50
opj_packet_info
Index structure : Information concerning a packet inside tile.
Definition: openjpeg.h:587
CPRL
@ CPRL
component-precinct-resolution-layer order
Definition: openjpeg.h:124
write_ppix
int write_ppix(int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
Definition: ppix_manager.c:54
write_manf
void write_manf(int second, int v, opj_jp2_box_t *box, opj_cio_t *cio)
Definition: cidx_manager.c:143
opj_bool
int opj_bool
Definition: openjpeg.h:63
opj_raw::start
unsigned char * start
pointer to the start of the buffer
Definition: raw.h:58
cio_seek
void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos)
Set position in byte stream.
Definition: cio.c:109
opj_codestream_info::prog
OPJ_PROG_ORDER prog
progression order
Definition: openjpeg.h:684
opj_codestream_info::tile
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
opj_codestream_info
Index structure of the codestream.
Definition: openjpeg.h:672
opj_raw_t
struct opj_raw opj_raw_t
RAW encoding operations.
opj_raw::lenmax
unsigned int lenmax
maximum length to decode
Definition: raw.h:52
raw_create
opj_raw_t * raw_create(void)
Create a new RAW handle.
Definition: raw.c:45
RPCL
@ RPCL
resolution-precinct-component-layer order
Definition: openjpeg.h:122
opj_tile_info
Index structure : information regarding tiles.
Definition: openjpeg.h:632
opj_jp2_box::length
int length
Definition: jp2.h:151
raw_create
opj_raw_t * raw_create(void)
Create a new RAW handle.
Definition: raw.c:45
raw_init_dec
void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len)
Initialize the decoder.
Definition: raw.c:60
JPIP_FAIX
#define JPIP_FAIX
Definition: indexbox_manager.h:46
opj_codestream_info::numdecompos
int * numdecompos
number of decomposition for each component
Definition: openjpeg.h:702
opj_codestream_info::th
int th
number of tiles in Y
Definition: openjpeg.h:696
RLCP
@ RLCP
resolution-layer-component-precinct order
Definition: openjpeg.h:121
opj_tile_info::pw
int pw[33]
precinct number for each resolution level (width)
Definition: openjpeg.h:644