OpenJPEG  2.2.0
Typedefs | Functions
byte_manager.h File Reference
#include <stddef.h>
#include "openjpeg.h"
#include "opj_stdint.h"

Go to the source code of this file.

Typedefs

typedef uint8_t Byte_t
 
typedef uint16_t Byte2_t
 
typedef uint32_t Byte4_t
 
typedef uint64_t Byte8_t
 

Functions

Byte_tfetch_bytes (int fd, OPJ_OFF_T offset, OPJ_SIZE_T size)
 fetch bytes of data in file stream More...
 
Byte_t fetch_1byte (int fd, OPJ_OFF_T offset)
 fetch a 1-byte Byte codes in file stream More...
 
Byte2_t fetch_2bytebigendian (int fd, OPJ_OFF_T offset)
 fetch a 2-byte big endian Byte codes in file stream More...
 
Byte4_t fetch_4bytebigendian (int fd, OPJ_OFF_T offset)
 fetch a 4-byte big endian Byte codes in file stream More...
 
Byte8_t fetch_8bytebigendian (int fd, OPJ_OFF_T offset)
 fetch a 8-byte big endian Byte codes in file stream More...
 
Byte2_t big2 (Byte_t *buf)
 convert 2-byte big endian Byte codes to number More...
 
Byte4_t big4 (Byte_t *buf)
 convert 4-byte big endian Byte codes to number More...
 
Byte8_t big8 (Byte_t *buf)
 convert 8-byte big endian Byte codes to number More...
 
void modify_4Bytecode (Byte4_t code, Byte_t *stream)
 modify 4Byte code in a codestream More...
 
OPJ_OFF_T get_filesize (int fd)
 Get file size. More...
 

Typedef Documentation

typedef uint16_t Byte2_t
typedef uint32_t Byte4_t
typedef uint64_t Byte8_t
typedef uint8_t Byte_t

Function Documentation

Byte2_t big2 ( Byte_t buf)

convert 2-byte big endian Byte codes to number

Parameters
[in]bufByte codes
Returns
resolved number

Referenced by fetch_2bytebigendian(), gene_ihdrbox(), get_CODmkrdata_from_j2kstream(), get_mainheader_from_j2kstream(), get_SIZmkrdata_from_j2kstream(), and modify_COCmkrstream().

Byte4_t big4 ( Byte_t buf)

convert 4-byte big endian Byte codes to number

Parameters
[in]bufByte codes
Returns
resolved number

Referenced by add_emptyboxstream(), big8(), fetch_4bytebigendian(), gene_boxbyOffinStream(), gene_boxbyOffset(), gene_boxbyType(), gene_boxbyTypeinStream(), gene_ihdrbox(), get_SIZmkrdata_from_j2kstream(), and parse_phld().

Byte8_t big8 ( Byte_t buf)

convert 8-byte big endian Byte codes to number

Parameters
[in]bufByte codes
Returns
resolved number

References big4().

Referenced by add_emptyboxstream(), fetch_8bytebigendian(), gene_boxbyOffinStream(), gene_boxbyOffset(), gene_boxbyType(), gene_boxbyTypeinStream(), and parse_phld().

Byte_t fetch_1byte ( int  fd,
OPJ_OFF_T  offset 
)

fetch a 1-byte Byte codes in file stream

Parameters
[in]fdfile discriptor
[in]offsetstart Byte position
Returns
fetched codes

References FCGI_stderr, and FCGI_stdout.

Referenced by fetch_codestream1byte(), and fetch_DBox1byte().

Byte2_t fetch_2bytebigendian ( int  fd,
OPJ_OFF_T  offset 
)

fetch a 2-byte big endian Byte codes in file stream

Parameters
[in]fdfile discriptor
[in]offsetstart Byte position
Returns
fetched codes

References big2(), FCGI_stderr, and fetch_bytes().

Referenced by fetch_codestream2bytebigendian(), and fetch_DBox2bytebigendian().

Byte4_t fetch_4bytebigendian ( int  fd,
OPJ_OFF_T  offset 
)

fetch a 4-byte big endian Byte codes in file stream

Parameters
[in]fdfile discriptor
[in]offsetstart Byte position
Returns
fetched codes

References big4(), FCGI_stderr, and fetch_bytes().

Referenced by fetch_codestream4bytebigendian(), fetch_DBox4bytebigendian(), and gene_boxheader().

Byte8_t fetch_8bytebigendian ( int  fd,
OPJ_OFF_T  offset 
)

fetch a 8-byte big endian Byte codes in file stream

Parameters
[in]fdfile discriptor
[in]offsetstart Byte position
Returns
fetched codes

References big8(), FCGI_stderr, and fetch_bytes().

Referenced by fetch_DBox8bytebigendian(), and gene_boxheader().

Byte_t* fetch_bytes ( int  fd,
OPJ_OFF_T  offset,
OPJ_SIZE_T  size 
)

fetch bytes of data in file stream

Parameters
[in]fdfile discriptor
[in]offsetstart Byte position
[in]sizeByte length
Returns
pointer to the fetched data

References FCGI_stderr, and FCGI_stdout.

Referenced by add_body_stream(), fetch_2bytebigendian(), fetch_4bytebigendian(), fetch_8bytebigendian(), fetch_codestreambytes(), fetch_DBoxbytes(), fetch_headbytes(), gene_boxbyOffset(), gene_boxbyType(), and gene_boxheader().

OPJ_OFF_T get_filesize ( int  fd)

Get file size.

Parameters
[in]fdfile discriptor
Returns
file size

References FCGI_stderr, and FCGI_stdout.

Referenced by const_metadatalist(), fread_jpip(), gene_boxbyType(), and parse_jp2file().

void modify_4Bytecode ( Byte4_t  code,
Byte_t stream 
)

modify 4Byte code in a codestream

Parameters
[in]codecode value
[out]streammodifying codestream

Referenced by modify_SIZmkrstream(), and modify_tileheader().