OpenJPEG  2.4.0
Functions
cio.c File Reference
#include "opj_includes.h"

Functions

void opj_write_bytes_BE (OPJ_BYTE *p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)
 Write some bytes to the given data buffer, this function is used in Big Endian cpus. More...
 
void opj_write_bytes_LE (OPJ_BYTE *p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)
 Write some bytes to the given data buffer, this function is used in Little Endian cpus. More...
 
void opj_read_bytes_BE (const OPJ_BYTE *p_buffer, OPJ_UINT32 *p_value, OPJ_UINT32 p_nb_bytes)
 Reads some bytes from the given data buffer, this function is used in Big Endian cpus. More...
 
void opj_read_bytes_LE (const OPJ_BYTE *p_buffer, OPJ_UINT32 *p_value, OPJ_UINT32 p_nb_bytes)
 Reads some bytes from the given data buffer, this function is used in Little Endian cpus. More...
 
void opj_write_double_BE (OPJ_BYTE *p_buffer, OPJ_FLOAT64 p_value)
 
void opj_write_double_LE (OPJ_BYTE *p_buffer, OPJ_FLOAT64 p_value)
 Write some bytes to the given data buffer, this function is used in Little Endian cpus. More...
 
void opj_read_double_BE (const OPJ_BYTE *p_buffer, OPJ_FLOAT64 *p_value)
 Reads some bytes from the given data buffer, this function is used in Big Endian cpus. More...
 
void opj_read_double_LE (const OPJ_BYTE *p_buffer, OPJ_FLOAT64 *p_value)
 Reads some bytes from the given data buffer, this function is used in Little Endian cpus. More...
 
void opj_write_float_BE (OPJ_BYTE *p_buffer, OPJ_FLOAT32 p_value)
 
void opj_write_float_LE (OPJ_BYTE *p_buffer, OPJ_FLOAT32 p_value)
 Write some bytes to the given data buffer, this function is used in Little Endian cpus. More...
 
void opj_read_float_BE (const OPJ_BYTE *p_buffer, OPJ_FLOAT32 *p_value)
 Reads some bytes from the given data buffer, this function is used in Big Endian cpus. More...
 
void opj_read_float_LE (const OPJ_BYTE *p_buffer, OPJ_FLOAT32 *p_value)
 Reads some bytes from the given data buffer, this function is used in Little Endian cpus. More...
 
opj_stream_t *OPJ_CALLCONV opj_stream_create (OPJ_SIZE_T p_buffer_size, OPJ_BOOL l_is_input)
 Creates an abstract stream. More...
 
opj_stream_t *OPJ_CALLCONV opj_stream_default_create (OPJ_BOOL l_is_input)
 Creates an abstract stream. More...
 
void OPJ_CALLCONV opj_stream_destroy (opj_stream_t *p_stream)
 Destroys a stream created by opj_create_stream. More...
 
void OPJ_CALLCONV opj_stream_set_read_function (opj_stream_t *p_stream, opj_stream_read_fn p_function)
 Sets the given function to be used as a read function. More...
 
void OPJ_CALLCONV opj_stream_set_seek_function (opj_stream_t *p_stream, opj_stream_seek_fn p_function)
 Sets the given function to be used as a seek function, the stream is then seekable, using SEEK_SET behavior. More...
 
void OPJ_CALLCONV opj_stream_set_write_function (opj_stream_t *p_stream, opj_stream_write_fn p_function)
 Sets the given function to be used as a write function. More...
 
void OPJ_CALLCONV opj_stream_set_skip_function (opj_stream_t *p_stream, opj_stream_skip_fn p_function)
 Sets the given function to be used as a skip function. More...
 
void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t *p_stream, void *p_data, opj_stream_free_user_data_fn p_function)
 Sets the given data to be used as a user data for the stream. More...
 
void OPJ_CALLCONV opj_stream_set_user_data_length (opj_stream_t *p_stream, OPJ_UINT64 data_length)
 Sets the length of the user data for the stream. More...
 
OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t *p_stream, OPJ_BYTE *p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t *p_event_mgr)
 Reads some bytes from the stream. More...
 
OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t *p_stream, const OPJ_BYTE *p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t *p_event_mgr)
 Writes some bytes to the stream. More...
 
OPJ_BOOL opj_stream_flush (opj_stream_private_t *p_stream, opj_event_mgr_t *p_event_mgr)
 Writes the content of the stream buffer to the stream. More...
 
OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
 Skips a number of bytes from the stream. More...
 
OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
 Skips a number of bytes from the stream. More...
 
OPJ_OFF_T opj_stream_tell (const opj_stream_private_t *p_stream)
 Tells the byte offset on the stream (similar to ftell). More...
 
OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t *p_stream)
 Get the number of bytes left before the end of the stream (similar to cio_numbytesleft). More...
 
OPJ_OFF_T opj_stream_skip (opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
 Skips a number of bytes from the stream. More...
 
OPJ_BOOL opj_stream_read_seek (opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
 Skips a number of bytes from the stream. More...
 
OPJ_BOOL opj_stream_write_seek (opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
 Skips a number of bytes from the stream. More...
 
OPJ_BOOL opj_stream_seek (opj_stream_private_t *p_stream, OPJ_OFF_T p_size, struct opj_event_mgr *p_event_mgr)
 Seeks a number of bytes from the stream. More...
 
OPJ_BOOL opj_stream_has_seek (const opj_stream_private_t *p_stream)
 Tells if the given stream is seekable. More...
 
OPJ_SIZE_T opj_stream_default_read (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
 FIXME DOC. More...
 
OPJ_SIZE_T opj_stream_default_write (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
 FIXME DOC. More...
 
OPJ_OFF_T opj_stream_default_skip (OPJ_OFF_T p_nb_bytes, void *p_user_data)
 FIXME DOC. More...
 
OPJ_BOOL opj_stream_default_seek (OPJ_OFF_T p_nb_bytes, void *p_user_data)
 FIXME DOC. More...
 

Function Documentation

opj_stream_t* OPJ_CALLCONV opj_stream_create ( OPJ_SIZE_T  p_buffer_size,
OPJ_BOOL  p_is_input 
)
opj_stream_t* OPJ_CALLCONV opj_stream_default_create ( OPJ_BOOL  p_is_input)

Creates an abstract stream.

This function does nothing except allocating memory and initializing the abstract stream.

Parameters
p_is_inputif set to true then the stream will be an input stream, an output stream else.
Returns
a stream object.

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create().

void OPJ_CALLCONV opj_stream_destroy ( opj_stream_t p_stream)

Destroys a stream created by opj_create_stream.

This function does NOT close the abstract stream. If needed the user must close its own implementation of the stream.

Parameters
p_streamthe stream to destroy.

References opj_stream_private::m_free_user_data_fn, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, and opj_free().

Referenced by j2k_to_pnm().

void OPJ_CALLCONV opj_stream_set_read_function ( opj_stream_t p_stream,
opj_stream_read_fn  p_function 
)

Sets the given function to be used as a read function.

Parameters
p_streamthe stream to modify
p_functionthe function to use a read function.

References opj_stream_private::m_read_fn, opj_stream_private::m_status, and OPJ_STREAM_STATUS_INPUT.

Referenced by opj_stream_create_file_stream().

void OPJ_CALLCONV opj_stream_set_seek_function ( opj_stream_t p_stream,
opj_stream_seek_fn  p_function 
)

Sets the given function to be used as a seek function, the stream is then seekable, using SEEK_SET behavior.

Parameters
p_streamthe stream to modify
p_functionthe function to use a skip function.

References opj_stream_private::m_seek_fn.

Referenced by opj_stream_create_file_stream().

void OPJ_CALLCONV opj_stream_set_skip_function ( opj_stream_t p_stream,
opj_stream_skip_fn  p_function 
)

Sets the given function to be used as a skip function.

Parameters
p_streamthe stream to modify
p_functionthe function to use a skip function.

References opj_stream_private::m_skip_fn.

Referenced by opj_stream_create_file_stream().

void OPJ_CALLCONV opj_stream_set_user_data ( opj_stream_t p_stream,
void *  p_data,
opj_stream_free_user_data_fn  p_function 
)

Sets the given data to be used as a user data for the stream.

Parameters
p_streamthe stream to modify
p_datathe data to set.
p_functionthe function to free p_data when opj_stream_destroy() is called.

References opj_stream_private::m_free_user_data_fn, and opj_stream_private::m_user_data.

Referenced by opj_stream_create_file_stream().

void OPJ_CALLCONV opj_stream_set_user_data_length ( opj_stream_t p_stream,
OPJ_UINT64  data_length 
)

Sets the length of the user data for the stream.

Parameters
p_streamthe stream to modify
data_lengthlength of the user_data.

References opj_stream_private::m_user_data_length.

Referenced by opj_stream_create_file_stream().

void OPJ_CALLCONV opj_stream_set_write_function ( opj_stream_t p_stream,
opj_stream_write_fn  p_function 
)

Sets the given function to be used as a write function.

Parameters
p_streamthe stream to modify
p_functionthe function to use a write function.

References opj_stream_private::m_status, opj_stream_private::m_write_fn, and OPJ_STREAM_STATUS_OUTPUT.

Referenced by opj_stream_create_file_stream().