cio.c File Reference

#include "opj_includes.h"
#include <assert.h>

Functions

opj_cio_t *OPJ_CALLCONV opj_cio_open (opj_common_ptr cinfo, unsigned char *buffer, int length)
 Open and allocate a memory stream for read / write.
void OPJ_CALLCONV opj_cio_close (opj_cio_t *cio)
 Close and free a CIO handle.
int OPJ_CALLCONV cio_tell (opj_cio_t *cio)
 Get position in byte stream.
void OPJ_CALLCONV cio_seek (opj_cio_t *cio, int pos)
 Set position in byte stream.
int cio_numbytesleft (opj_cio_t *cio)
 Number of bytes left before the end of the stream.
unsigned char * cio_getbp (opj_cio_t *cio)
 Get pointer to the current position in the stream.
opj_bool cio_byteout (opj_cio_t *cio, unsigned char v)
unsigned char cio_bytein (opj_cio_t *cio)
unsigned int cio_write (opj_cio_t *cio, unsigned int64 v, int n)
 Write some bytes.
unsigned int cio_read (opj_cio_t *cio, int n)
 Read some bytes.
void cio_skip (opj_cio_t *cio, int n)
 Skip some bytes.

Function Documentation

unsigned char cio_bytein ( opj_cio_t cio  ) 

opj_bool cio_byteout ( opj_cio_t cio,
unsigned char  v 
)

void OPJ_CALLCONV cio_seek ( opj_cio_t cio,
int  pos 
)

int OPJ_CALLCONV cio_tell ( opj_cio_t cio  ) 

void OPJ_CALLCONV opj_cio_close ( opj_cio_t cio  ) 

Close and free a CIO handle.

Parameters:
cio CIO handle to free

References opj_cio::buffer, opj_cio::openmode, opj_free, and OPJ_STREAM_WRITE.

opj_cio_t* OPJ_CALLCONV opj_cio_open ( opj_common_ptr  cinfo,
unsigned char *  buffer,
int  length 
)

Open and allocate a memory stream for read / write.

On reading, the user must provide a buffer containing encoded data. The buffer will be wrapped by the returned CIO handle. On writing, buffer parameters must be set to 0: a buffer will be allocated by the library to contain encoded data.

Parameters:
cinfo Codec context info
buffer Reading: buffer address. Writing: NULL
length Reading: buffer length. Writing: 0
Returns:
Returns a CIO handle if successful, returns NULL otherwise

References opj_cio::bp, opj_cio::buffer, opj_cio::cinfo, CODEC_J2K, CODEC_JP2, opj_cio::end, EVT_ERROR, opj_cp::img_size, opj_cio::length, opj_cio::openmode, opj_event_msg(), opj_free, opj_malloc, OPJ_STREAM_READ, OPJ_STREAM_WRITE, and opj_cio::start.


Generated on Mon Dec 19 12:34:13 2016 for OpenJPEG by  doxygen 1.5.6