OpenJPEG 2.5.2

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
opj_stream_t *OPJ_CALLCONV | opj_stream_create (OPJ_SIZE_T p_buffer_size, OPJ_BOOL l_is_input)
| Creates an abstract stream.
opj_stream_t *OPJ_CALLCONV | opj_stream_default_create (OPJ_BOOL l_is_input)
| Creates an abstract stream.
void OPJ_CALLCONV | opj_stream_destroy (opj_stream_t *p_stream)
| Destroys a stream created by opj_create_stream.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
OPJ_OFF_T | opj_stream_tell (const opj_stream_private_t *p_stream)
| Tells the byte offset on the stream (similar to ftell).
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).
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.
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.
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.
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.
OPJ_BOOL | opj_stream_has_seek (const opj_stream_private_t *p_stream)
| Tells if the given stream is seekable.
OPJ_SIZE_T | opj_stream_default_read (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
| FIXME DOC.
OPJ_SIZE_T | opj_stream_default_write (void *p_buffer, OPJ_SIZE_T p_nb_bytes, void *p_user_data)
| FIXME DOC.
OPJ_OFF_T | opj_stream_default_skip (OPJ_OFF_T p_nb_bytes, void *p_user_data)
| FIXME DOC.
OPJ_BOOL | opj_stream_default_seek (OPJ_OFF_T p_nb_bytes, void *p_user_data)
| FIXME DOC.

## Function Documentation

## ◆ opj_read_bytes_BE()

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.

Parameters

  p_buffer | pointer the data buffer to read data from.
  p_value | pointer to the value that will store the data.
  p_nb_bytes | the nb bytes to read.

Returns
  the number of bytes read or -1 if an error occurred.

## ◆ opj_read_bytes_LE()

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.

Parameters

  p_buffer | pointer the data buffer to read data from.
  p_value | pointer to the value that will store the data.
  p_nb_bytes | the nb bytes to read.

Returns
  the number of bytes read or -1 if an error occurred.

## ◆ opj_read_double_BE()

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.

Parameters

  p_buffer | pointer the data buffer to read data from.
  p_value | pointer to the value that will store the data.

## ◆ opj_read_double_LE()

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.

Parameters

  p_buffer | pointer the data buffer to read data from.
  p_value | pointer to the value that will store the data.

## ◆ opj_read_float_BE()

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.

Parameters

  p_buffer | pointer the data buffer to read data from.
  p_value | pointer to the value that will store the data.

## ◆ opj_read_float_LE()

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.

Parameters

  p_buffer | pointer the data buffer to read data from.
  p_value | pointer to the value that will store the data.

## ◆ opj_stream_create()

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

Creates an abstract stream.

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

Parameters

  p_buffer_size | FIXME DOC
  p_is_input | if set to true then the stream will be an input stream, an output stream else.

Returns
  a stream object.

References opj_stream_private::m_buffer_size, opj_stream_private::m_current_data, opj_stream_private::m_opj_seek, opj_stream_private::m_opj_skip, opj_stream_private::m_read_fn, opj_stream_private::m_seek_fn, opj_stream_private::m_skip_fn, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_write_fn, opj_calloc(), opj_free(), opj_malloc(), opj_stream_default_read(), opj_stream_default_seek(), opj_stream_default_skip(), opj_stream_default_write(), opj_stream_read_seek(), opj_stream_read_skip(), OPJ_STREAM_STATUS_INPUT, OPJ_STREAM_STATUS_OUTPUT, opj_stream_write_seek(), and opj_stream_write_skip().

Referenced by opj_stream_create_file_stream(), and opj_stream_default_create().

## ◆ opj_stream_default_create()

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_input | if 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().

## ◆ opj_stream_default_read()

OPJ_SIZE_T opj_stream_default_read | ( | void * | p_buffer,
|  | OPJ_SIZE_T | p_nb_bytes,
|  | void * | p_user_data )

FIXME DOC.

References OPJ_ARG_NOT_USED.

Referenced by opj_stream_create().

## ◆ opj_stream_default_seek()

OPJ_BOOL opj_stream_default_seek | ( | OPJ_OFF_T | p_nb_bytes,
|  | void * | p_user_data )

FIXME DOC.

References OPJ_ARG_NOT_USED, and OPJ_FALSE.

Referenced by opj_stream_create(), and opj_stream_has_seek().

## ◆ opj_stream_default_skip()

OPJ_OFF_T opj_stream_default_skip | ( | OPJ_OFF_T | p_nb_bytes,
|  | void * | p_user_data )

FIXME DOC.

References OPJ_ARG_NOT_USED.

Referenced by opj_stream_create().

## ◆ opj_stream_default_write()

OPJ_SIZE_T opj_stream_default_write | ( | void * | p_buffer,
|  | OPJ_SIZE_T | p_nb_bytes,
|  | void * | p_user_data )

FIXME DOC.

References OPJ_ARG_NOT_USED.

Referenced by opj_stream_create().

## ◆ opj_stream_destroy()

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_stream | the 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().

## ◆ opj_stream_flush()

OPJ_BOOL opj_stream_flush | ( | opj_stream_private_t * | p_stream,
|  | struct opj_event_mgr * | p_event_mgr )

Writes the content of the stream buffer to the stream.

Parameters

  p_stream | the stream to write data to.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  true if the data could be flushed, false else.

References EVT_INFO, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_current_data, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, opj_stream_private::m_write_fn, opj_event_msg(), OPJ_FALSE, OPJ_STREAM_STATUS_ERROR, and OPJ_TRUE.

Referenced by opj_j2k_write_eoc(), opj_stream_write_data(), opj_stream_write_seek(), and opj_stream_write_skip().

## ◆ opj_stream_get_number_byte_left()

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).

Parameters

  p_stream | the stream to get the information from.

Returns
  Number of bytes left before the end of the stream.

References opj_stream_private::m_byte_offset, and opj_stream_private::m_user_data_length.

Referenced by opj_j2k_decode_tile(), opj_j2k_decode_tiles(), opj_j2k_read_sod(), opj_j2k_read_tile_header(), opj_jp2_read_boxhdr(), and opj_jp2_read_header_procedure().

## ◆ opj_stream_has_seek()

OPJ_BOOL opj_stream_has_seek | ( | const opj_stream_private_t * | p_stream | ) |

Tells if the given stream is seekable.

References opj_stream_private::m_seek_fn, and opj_stream_default_seek().

Referenced by opj_j2k_need_nb_tile_parts_correction(), opj_jp2_default_validation(), and opj_jp2_write_jp2c().

## ◆ opj_stream_read_data()

OPJ_SIZE_T opj_stream_read_data | ( | opj_stream_private_t * | p_stream,
|  | OPJ_BYTE * | p_buffer,
|  | OPJ_SIZE_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Reads some bytes from the stream.

Parameters

  p_stream | the stream to read data from.
  p_buffer | pointer to the data buffer that will receive the data.
  p_size | number of bytes to read.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  the number of bytes read, or -1 if an error occurred or if the stream is at the end.

References EVT_INFO, opj_stream_private::m_buffer_size, opj_stream_private::m_byte_offset, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_current_data, opj_stream_private::m_read_fn, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, opj_event_msg(), and OPJ_STREAM_STATUS_END.

Referenced by opj_check_EPHuse(), opj_j2k_decode_tile(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_read_header_procedure(), opj_j2k_read_soc(), opj_j2k_read_sod(), opj_j2k_read_tile_header(), opj_j2k_read_unk(), opj_jp2_read_boxhdr(), and opj_jp2_read_header_procedure().

## ◆ opj_stream_read_seek()

OPJ_BOOL opj_stream_read_seek | ( | opj_stream_private_t * | p_stream,
|  | OPJ_OFF_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Skips a number of bytes from the stream.

Parameters

  p_stream | the stream to skip data from.
  p_size | the number of bytes to skip.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  OPJ_TRUE if success, or OPJ_FALSE if an error occurred.

References opj_stream_private::m_byte_offset, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_current_data, opj_stream_private::m_seek_fn, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, OPJ_ARG_NOT_USED, OPJ_FALSE, OPJ_STREAM_STATUS_END, and OPJ_TRUE.

Referenced by opj_j2k_decode_one_tile(), opj_stream_create(), and opj_stream_read_skip().

## ◆ opj_stream_read_skip()

OPJ_OFF_T opj_stream_read_skip | ( | opj_stream_private_t * | p_stream,
|  | OPJ_OFF_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Skips a number of bytes from the stream.

Parameters

  p_stream | the stream to skip data from.
  p_size | the number of bytes to skip.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  the number of bytes skipped, or -1 if an error occurred.

References EVT_INFO, opj_stream_private::m_byte_offset, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_current_data, opj_stream_private::m_skip_fn, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, opj_stream_private::m_user_data_length, opj_event_msg(), opj_stream_read_seek(), and OPJ_STREAM_STATUS_END.

Referenced by opj_stream_create().

## ◆ opj_stream_seek()

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.

Parameters

  p_stream | the stream to skip data from.
  p_size | the number of bytes to skip.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  true if the stream is seekable.

References opj_stream_private::m_opj_seek.

Referenced by opj_check_EPHuse(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_write_updated_tlm(), opj_jp2_write_jp2c(), opj_write_cidx(), opj_write_cptr(), opj_write_mainmhix(), opj_write_manf(), opj_write_phix(), opj_write_phixfaix(), opj_write_ppix(), opj_write_ppixfaix(), opj_write_thix(), opj_write_tilemhix(), opj_write_tpix(), and opj_write_tpixfaix().

## ◆ opj_stream_set_read_function()

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_stream | the stream to modify
  p_function | the 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().

## ◆ opj_stream_set_seek_function()

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_stream | the stream to modify
  p_function | the function to use a skip function.

References opj_stream_private::m_seek_fn.

Referenced by opj_stream_create_file_stream().

## ◆ opj_stream_set_skip_function()

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_stream | the stream to modify
  p_function | the function to use a skip function.

References opj_stream_private::m_skip_fn.

Referenced by opj_stream_create_file_stream().

## ◆ opj_stream_set_user_data()

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_stream | the stream to modify
  p_data | the data to set.
  p_function | the 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().

## ◆ opj_stream_set_user_data_length()

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_stream | the stream to modify
  data_length | length of the user_data.

References opj_stream_private::m_user_data_length.

Referenced by opj_stream_create_file_stream().

## ◆ opj_stream_set_write_function()

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_stream | the stream to modify
  p_function | the 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().

## ◆ opj_stream_skip()

OPJ_OFF_T opj_stream_skip | ( | opj_stream_private_t * | p_stream,
|  | OPJ_OFF_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Skips a number of bytes from the stream.

Parameters

  p_stream | the stream to skip data from.
  p_size | the number of bytes to skip.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  the number of bytes skipped, or -1 if an error occurred.

References opj_stream_private::m_opj_skip.

Referenced by opj_j2k_need_nb_tile_parts_correction(), opj_j2k_read_tile_header(), opj_jp2_read_header_procedure(), opj_jp2_skip_jp2c(), opj_jpip_skip_iptr(), opj_write_cidx(), opj_write_cptr(), opj_write_mainmhix(), opj_write_manf(), opj_write_phix(), opj_write_phixfaix(), opj_write_ppix(), opj_write_ppixfaix(), opj_write_thix(), opj_write_tilemhix(), opj_write_tpix(), and opj_write_tpixfaix().

## ◆ opj_stream_tell()

OPJ_OFF_T opj_stream_tell | ( | const opj_stream_private_t * | p_stream | ) |

Tells the byte offset on the stream (similar to ftell).

Parameters

  p_stream | the stream to get the information from.

Returns
  the current position o fthe stream.

References opj_stream_private::m_byte_offset.

Referenced by opj_check_EPHuse(), opj_j2k_get_end_header(), opj_j2k_need_nb_tile_parts_correction(), opj_j2k_read_header_procedure(), opj_j2k_read_soc(), opj_j2k_read_sod(), opj_j2k_read_tile_header(), opj_j2k_read_unk(), opj_j2k_update_rates(), opj_j2k_write_epc(), opj_j2k_write_tlm(), opj_j2k_write_updated_tlm(), opj_jp2_skip_jp2c(), opj_jp2_write_jp2c(), opj_jpip_skip_iptr(), opj_write_cidx(), opj_write_cptr(), opj_write_mainmhix(), opj_write_manf(), opj_write_phix(), opj_write_phixfaix(), opj_write_ppix(), opj_write_ppixfaix(), opj_write_thix(), opj_write_tilemhix(), opj_write_tpix(), and opj_write_tpixfaix().

## ◆ opj_stream_write_data()

OPJ_SIZE_T opj_stream_write_data | ( | opj_stream_private_t * | p_stream,
|  | const OPJ_BYTE * | p_buffer,
|  | OPJ_SIZE_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Writes some bytes to the stream.

Parameters

  p_stream | the stream to write data to.
  p_buffer | pointer to the data buffer holds the data to be writtent.
  p_size | number of bytes to write.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  the number of bytes writtent, or -1 if an error occurred.

References opj_stream_private::m_buffer_size, opj_stream_private::m_byte_offset, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_current_data, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_flush(), and OPJ_STREAM_STATUS_ERROR.

Referenced by opj_j2k_post_write_tile(), opj_j2k_write_cbd(), opj_j2k_write_coc(), opj_j2k_write_cod(), opj_j2k_write_com(), opj_j2k_write_eoc(), opj_j2k_write_mcc_record(), opj_j2k_write_mco(), opj_j2k_write_mct_record(), opj_j2k_write_poc(), opj_j2k_write_qcc(), opj_j2k_write_qcd(), opj_j2k_write_rgn(), opj_j2k_write_siz(), opj_j2k_write_soc(), opj_j2k_write_tlm(), opj_j2k_write_updated_tlm(), opj_jp2_write_ftyp(), opj_jp2_write_jp(), opj_jp2_write_jp2c(), opj_jp2_write_jp2h(), opj_write_cidx(), opj_write_cptr(), opj_write_mainmhix(), opj_write_manf(), opj_write_phix(), opj_write_phixfaix(), opj_write_ppix(), opj_write_ppixfaix(), opj_write_thix(), opj_write_tilemhix(), opj_write_tpix(), and opj_write_tpixfaix().

## ◆ opj_stream_write_seek()

OPJ_BOOL opj_stream_write_seek | ( | opj_stream_private_t * | p_stream,
|  | OPJ_OFF_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Skips a number of bytes from the stream.

Parameters

  p_stream | the stream to skip data from.
  p_size | the number of bytes to skip.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  the number of bytes skipped, or -1 if an error occurred.

References opj_stream_private::m_byte_offset, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_current_data, opj_stream_private::m_seek_fn, opj_stream_private::m_status, opj_stream_private::m_stored_data, opj_stream_private::m_user_data, OPJ_FALSE, opj_stream_flush(), OPJ_STREAM_STATUS_ERROR, and OPJ_TRUE.

Referenced by opj_stream_create().

## ◆ opj_stream_write_skip()

OPJ_OFF_T opj_stream_write_skip | ( | opj_stream_private_t * | p_stream,
|  | OPJ_OFF_T | p_size,
|  | struct opj_event_mgr * | p_event_mgr )

Skips a number of bytes from the stream.

Parameters

  p_stream | the stream to skip data from.
  p_size | the number of bytes to skip.
  p_event_mgr | the user event manager to be notified of special events.

Returns
  the number of bytes skipped, or -1 if an error occurred.

References EVT_INFO, opj_stream_private::m_byte_offset, opj_stream_private::m_bytes_in_buffer, opj_stream_private::m_skip_fn, opj_stream_private::m_status, opj_stream_private::m_user_data, opj_event_msg(), opj_stream_flush(), and OPJ_STREAM_STATUS_ERROR.

Referenced by opj_stream_create().

## ◆ opj_write_bytes_BE()

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.

Parameters

  p_buffer | pointer the data buffer to write data to.
  p_value | the value to write
  p_nb_bytes | the number of bytes to write

## ◆ opj_write_bytes_LE()

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.

Parameters

  p_buffer | pointer the data buffer to write data to.
  p_value | the value to write
  p_nb_bytes | the number of bytes to write

Returns
  the number of bytes written or -1 if an error occurred

## ◆ opj_write_double_BE()

void opj_write_double_BE | ( | OPJ_BYTE * | p_buffer,
|  | OPJ_FLOAT64 | p_value )

## ◆ opj_write_double_LE()

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.

Parameters

  p_buffer | pointer the data buffer to write data to.
  p_value | the value to write

## ◆ opj_write_float_BE()

void opj_write_float_BE | ( | OPJ_BYTE * | p_buffer,
|  | OPJ_FLOAT32 | p_value )

## ◆ opj_write_float_LE()

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.

Parameters

  p_buffer | pointer the data buffer to write data to.
  p_value | the value to write