openjpeg.c File Reference

#include "opj_includes.h"

Functions

OPJ_BOOL OPJ_CALLCONV opj_set_info_handler (opj_codec_t *p_codec, opj_msg_callback p_callback, void *p_user_data)
 Set the info handler use by openjpeg.
OPJ_BOOL OPJ_CALLCONV opj_set_warning_handler (opj_codec_t *p_codec, opj_msg_callback p_callback, void *p_user_data)
 Set the warning handler use by openjpeg.
OPJ_BOOL OPJ_CALLCONV opj_set_error_handler (opj_codec_t *p_codec, opj_msg_callback p_callback, void *p_user_data)
 Set the error handler use by openjpeg.
static OPJ_SIZE_T opj_read_from_file (void *p_buffer, OPJ_SIZE_T p_nb_bytes, FILE *p_file)
static OPJ_UINT64 opj_get_data_length_from_file (FILE *p_file)
static OPJ_SIZE_T opj_write_from_file (void *p_buffer, OPJ_SIZE_T p_nb_bytes, FILE *p_file)
static OPJ_OFF_T opj_skip_from_file (OPJ_OFF_T p_nb_bytes, FILE *p_user_data)
static OPJ_BOOL opj_seek_from_file (OPJ_OFF_T p_nb_bytes, FILE *p_user_data)
const char *OPJ_CALLCONV opj_version (void)
opj_codec_t *OPJ_CALLCONV opj_create_decompress (OPJ_CODEC_FORMAT p_format)
 Creates a J2K/JP2 decompression structure.
void OPJ_CALLCONV opj_set_default_decoder_parameters (opj_dparameters_t *parameters)
 Set decoding parameters to default values.
OPJ_BOOL OPJ_CALLCONV opj_setup_decoder (opj_codec_t *p_codec, opj_dparameters_t *parameters)
 Setup the decoder with decompression parameters provided by the user and with the message handler provided by the user.
OPJ_BOOL OPJ_CALLCONV opj_read_header (opj_stream_t *p_stream, opj_codec_t *p_codec, opj_image_t **p_image)
 Decodes an image header.
OPJ_BOOL OPJ_CALLCONV opj_decode (opj_codec_t *p_codec, opj_stream_t *p_stream, opj_image_t *p_image)
 Decode an image from a JPEG-2000 codestream.
OPJ_BOOL OPJ_CALLCONV opj_set_decode_area (opj_codec_t *p_codec, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y)
 Sets the given area to be decoded.
OPJ_BOOL OPJ_CALLCONV opj_read_tile_header (opj_codec_t *p_codec, opj_stream_t *p_stream, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_should_go_on)
 Reads a tile header.
OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data (opj_codec_t *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_t *p_stream)
 Reads a tile data.
OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile (opj_codec_t *p_codec, opj_stream_t *p_stream, opj_image_t *p_image, OPJ_UINT32 tile_index)
 Get the decoded tile from the codec.
OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor (opj_codec_t *p_codec, OPJ_UINT32 res_factor)
 Set the resolution factor of the decoded image.
opj_codec_t *OPJ_CALLCONV opj_create_compress (OPJ_CODEC_FORMAT p_format)
 Creates a J2K/JP2 compression structure.
void OPJ_CALLCONV opj_set_default_encoder_parameters (opj_cparameters_t *parameters)
 Set encoding parameters to default values, that means :.
OPJ_BOOL OPJ_CALLCONV opj_setup_encoder (opj_codec_t *p_codec, opj_cparameters_t *parameters, opj_image_t *p_image)
 Setup the encoder parameters using the current image and using user parameters.
OPJ_BOOL OPJ_CALLCONV opj_start_compress (opj_codec_t *p_codec, opj_image_t *p_image, opj_stream_t *p_stream)
 Start to compress the current image.
OPJ_BOOL OPJ_CALLCONV opj_encode (opj_codec_t *p_info, opj_stream_t *p_stream)
 Encode an image into a JPEG-2000 codestream.
OPJ_BOOL OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec, opj_stream_t *p_stream)
 End to compress the current image.
OPJ_BOOL OPJ_CALLCONV opj_end_decompress (opj_codec_t *p_codec, opj_stream_t *p_stream)
 Read after the codestream if necessary.
OPJ_BOOL OPJ_CALLCONV opj_set_MCT (opj_cparameters_t *parameters, OPJ_FLOAT32 *pEncodingMatrix, OPJ_INT32 *p_dc_shift, OPJ_UINT32 pNbComp)
 Sets the MCT matrix to use.
OPJ_BOOL OPJ_CALLCONV opj_write_tile (opj_codec_t *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_t *p_stream)
 Writes a tile with the given data.
void OPJ_CALLCONV opj_destroy_codec (opj_codec_t *p_codec)
 Destroy a decompressor handle.
void OPJ_CALLCONV opj_dump_codec (opj_codec_t *p_codec, OPJ_INT32 info_flag, FILE *output_stream)
 Dump the codec information into the output stream.
opj_codestream_info_v2_t
*OPJ_CALLCONV 
opj_get_cstr_info (opj_codec_t *p_codec)
 Get the codestream information from the codec.
void OPJ_CALLCONV opj_destroy_cstr_info (opj_codestream_info_v2_t **cstr_info)
 Destroy Codestream information after compression or decompression.
opj_codestream_index_t
*OPJ_CALLCONV 
opj_get_cstr_index (opj_codec_t *p_codec)
 Get the codestream index from the codec.
void OPJ_CALLCONV opj_destroy_cstr_index (opj_codestream_index_t **p_cstr_index)
opj_stream_t *OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream)
 Create a stream from a file identified with its filename with default parameters (helper function).
opj_stream_t *OPJ_CALLCONV opj_stream_create_file_stream (const char *fname, OPJ_SIZE_T p_size, OPJ_BOOL p_is_read_stream)
 Create a stream from a file identified with its filename with a specific buffer size.

Function Documentation

opj_codec_t* OPJ_CALLCONV opj_create_compress ( OPJ_CODEC_FORMAT  format  ) 

opj_codec_t* OPJ_CALLCONV opj_create_decompress ( OPJ_CODEC_FORMAT  format  ) 

OPJ_BOOL OPJ_CALLCONV opj_decode ( opj_codec_t p_decompressor,
opj_stream_t p_stream,
opj_image_t p_image 
)

Decode an image from a JPEG-2000 codestream.

Parameters:
p_decompressor decompressor handle
p_stream Input buffer stream
p_image the decoded image
Returns:
true if success, otherwise false

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data ( opj_codec_t p_codec,
OPJ_UINT32  p_tile_index,
OPJ_BYTE p_data,
OPJ_UINT32  p_data_size,
opj_stream_t p_stream 
)

Reads a tile data.

This function is compulsory and allows one to decode tile data. opj_read_tile_header should be called before. The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.

Parameters:
p_codec the jpeg2000 codec.
p_tile_index the index of the tile being decoded, this should be the value set by opj_read_tile_header.
p_data pointer to a memory block that will hold the decoded data.
p_data_size size of p_data. p_data_size should be bigger or equal to the value set by opj_read_tile_header.
p_stream the stream to decode.
Returns:
true if the data could be decoded.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

void OPJ_CALLCONV opj_destroy_codec ( opj_codec_t p_codec  ) 

Destroy a decompressor handle.

Parameters:
p_codec decompressor handle to destroy

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_decompression, and opj_free.

Referenced by j2k_to_pnm().

void OPJ_CALLCONV opj_destroy_cstr_index ( opj_codestream_index_t **  p_cstr_index  ) 

void OPJ_CALLCONV opj_destroy_cstr_info ( opj_codestream_info_v2_t **  cstr_info  ) 

Destroy Codestream information after compression or decompression.

Parameters:
cstr_info Codestream information structure

References opj_free.

Referenced by j2k_get_cstr_info().

void OPJ_CALLCONV opj_dump_codec ( opj_codec_t p_codec,
OPJ_INT32  info_flag,
FILE *  output_stream 
)

Dump the codec information into the output stream.

Parameters:
p_codec the jpeg2000 codec.
info_flag type of information dump.
output_stream output stream where dump the informations get from the codec.

References opj_codec_private::m_codec, and opj_codec_private::opj_dump_codec.

OPJ_BOOL OPJ_CALLCONV opj_encode ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

Encode an image into a JPEG-2000 codestream.

Parameters:
p_codec compressor handle
p_stream Output buffer stream
Returns:
Returns true if successful, returns false otherwise

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_BOOL OPJ_CALLCONV opj_end_compress ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

End to compress the current image.

Parameters:
p_codec Compressor handle
p_stream Input stgream

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

OPJ_BOOL OPJ_CALLCONV opj_end_decompress ( opj_codec_t p_codec,
opj_stream_t p_stream 
)

Read after the codestream if necessary.

Parameters:
p_codec the JPEG2000 codec to read.
p_stream the JPEG2000 stream.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

Referenced by j2k_to_pnm().

opj_codestream_index_t* OPJ_CALLCONV opj_get_cstr_index ( opj_codec_t p_codec  ) 

Get the codestream index from the codec.

Parameters:
p_codec the jpeg2000 codec.
Returns:
a pointer to a codestream index structure.

References opj_codec_private::m_codec, and opj_codec_private::opj_get_codec_index.

opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info ( opj_codec_t p_codec  ) 

Get the codestream information from the codec.

Parameters:
p_codec the jpeg2000 codec.
Returns:
a pointer to a codestream information structure.

References opj_codec_private::m_codec, and opj_codec_private::opj_get_codec_info.

static OPJ_UINT64 opj_get_data_length_from_file ( FILE *  p_file  )  [static]

References OPJ_FSEEK, and OPJ_FTELL.

Referenced by opj_stream_create_file_stream().

OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile ( opj_codec_t p_codec,
opj_stream_t p_stream,
opj_image_t p_image,
OPJ_UINT32  tile_index 
)

Get the decoded tile from the codec.

Parameters:
p_codec the jpeg2000 codec.
p_stream input streamm
p_image output image
tile_index index of the tile which will be decode
Returns:
true if success, otherwise false

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

static OPJ_SIZE_T opj_read_from_file ( void *  p_buffer,
OPJ_SIZE_T  p_nb_bytes,
FILE *  p_file 
) [static]

OPJ_BOOL OPJ_CALLCONV opj_read_header ( opj_stream_t p_stream,
opj_codec_t p_codec,
opj_image_t **  p_image 
)

Decodes an image header.

Parameters:
p_stream the jpeg2000 stream.
p_codec the jpeg2000 codec to read.
p_image the image structure initialized with the characteristics of encoded image.
Returns:
true if the main header of the codestream and the JP2 header is correctly read.

References EVT_ERROR, opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, opj_event_msg(), and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_read_tile_header ( opj_codec_t p_codec,
opj_stream_t p_stream,
OPJ_UINT32 p_tile_index,
OPJ_UINT32 p_data_size,
OPJ_INT32 p_tile_x0,
OPJ_INT32 p_tile_y0,
OPJ_INT32 p_tile_x1,
OPJ_INT32 p_tile_y1,
OPJ_UINT32 p_nb_comps,
OPJ_BOOL p_should_go_on 
)

Reads a tile header.

This function is compulsory and allows one to know the size of the tile thta will be decoded. The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.

Parameters:
p_codec the jpeg2000 codec.
p_tile_index pointer to a value that will hold the index of the tile being decoded, in case of success.
p_data_size pointer to a value that will hold the maximum size of the decoded data, in case of success. In case of truncated codestreams, the actual number of bytes decoded may be lower. The computation of the size is the same as depicted in opj_write_tile.
p_tile_x0 pointer to a value that will hold the x0 pos of the tile (in the image).
p_tile_y0 pointer to a value that will hold the y0 pos of the tile (in the image).
p_tile_x1 pointer to a value that will hold the x1 pos of the tile (in the image).
p_tile_y1 pointer to a value that will hold the y1 pos of the tile (in the image).
p_nb_comps pointer to a value that will hold the number of components in the tile.
p_should_go_on pointer to a boolean that will hold the fact that the decoding should go on. In case the codestream is over at the time of the call, the value will be set to false. The user should then stop the decoding.
p_stream the stream to decode.
Returns:
true if the tile header could be decoded. In case the decoding should end, the returned value is still true. returning false may be the result of a shortage of memory or an internal error.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

static OPJ_BOOL opj_seek_from_file ( OPJ_OFF_T  p_nb_bytes,
FILE *  p_user_data 
) [static]

References OPJ_FALSE, OPJ_FSEEK, and OPJ_TRUE.

Referenced by opj_stream_create_file_stream().

OPJ_BOOL OPJ_CALLCONV opj_set_decode_area ( opj_codec_t p_codec,
opj_image_t p_image,
OPJ_INT32  p_start_x,
OPJ_INT32  p_start_y,
OPJ_INT32  p_end_x,
OPJ_INT32  p_end_y 
)

Sets the given area to be decoded.

This function should be called right after opj_read_header and before any tile header reading.

Parameters:
p_codec the jpeg2000 codec.
p_image the decoded image previously setted by opj_read_header
p_start_x the left position of the rectangle to decode (in image coordinates).
p_end_x the right position of the rectangle to decode (in image coordinates).
p_start_y the up position of the rectangle to decode (in image coordinates).
p_end_y the bottom position of the rectangle to decode (in image coordinates).
Returns:
true if the area could be set.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor ( opj_codec_t p_codec,
OPJ_UINT32  res_factor 
)

Set the resolution factor of the decoded image.

Parameters:
p_codec the jpeg2000 codec.
res_factor resolution factor to set
Returns:
true if success, otherwise false

References opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, OPJ_FALSE, and OPJ_TRUE.

void OPJ_CALLCONV opj_set_default_decoder_parameters ( opj_dparameters_t parameters  ) 

void OPJ_CALLCONV opj_set_default_encoder_parameters ( opj_cparameters_t parameters  ) 

Set encoding parameters to default values, that means :.

  • Lossless
  • 1 tile
  • Size of precinct : 2^15 x 2^15 (means 1 precinct)
  • Size of code-block : 64 x 64
  • Number of resolutions: 6
  • No SOP marker in the codestream
  • No EPH marker in the codestream
  • No sub-sampling in x or y direction
  • No mode switch activated
  • Progression order: LRCP
  • No index file
  • No ROI upshifted
  • No offset of the origin of the image
  • No offset of the origin of the tiles
  • Reversible DWT 5-3
Parameters:
parameters Compression parameters

References opj_cparameters::cblockh_init, opj_cparameters::cblockw_init, opj_cparameters::cod_format, opj_cparameters::cp_cinema, opj_cparameters::cp_disto_alloc, opj_cparameters::cp_fixed_alloc, opj_cparameters::cp_fixed_quality, opj_cparameters::cp_rsiz, opj_cparameters::decod_format, opj_cparameters::jpip_on, opj_cparameters::jpwl_epc_on, opj_cparameters::jpwl_hprot_MH, opj_cparameters::jpwl_hprot_TPH, opj_cparameters::jpwl_hprot_TPH_tileno, JPWL_MAX_NO_PACKSPECS, JPWL_MAX_NO_TILESPECS, opj_cparameters::jpwl_pprot, opj_cparameters::jpwl_pprot_packno, opj_cparameters::jpwl_pprot_tileno, opj_cparameters::jpwl_sens_addr, opj_cparameters::jpwl_sens_MH, opj_cparameters::jpwl_sens_range, opj_cparameters::jpwl_sens_size, opj_cparameters::jpwl_sens_TPH, opj_cparameters::jpwl_sens_TPH_tileno, opj_cparameters::max_comp_size, opj_cparameters::numresolution, OPJ_FALSE, OPJ_LRCP, OPJ_OFF, OPJ_PROFILE_NONE, OPJ_STD_RSIZ, opj_cparameters::prog_order, opj_cparameters::roi_compno, opj_cparameters::rsiz, opj_cparameters::subsampling_dx, opj_cparameters::subsampling_dy, opj_cparameters::tcp_numlayers, opj_cparameters::tcp_rates, and opj_cparameters::tp_on.

OPJ_BOOL OPJ_CALLCONV opj_set_error_handler ( opj_codec_t p_codec,
opj_msg_callback  p_callback,
void *  p_user_data 
)

Set the error handler use by openjpeg.

Parameters:
p_codec the codec previously initialise
p_callback the callback function which will be used
p_user_data client object where will be returned the message

References opj_event_mgr::error_handler, opj_event_mgr::m_error_data, opj_codec_private::m_event_mgr, OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_set_info_handler ( opj_codec_t p_codec,
opj_msg_callback  p_callback,
void *  p_user_data 
)

Set the info handler use by openjpeg.

Parameters:
p_codec the codec previously initialise
p_callback the callback function which will be used
p_user_data client object where will be returned the message

References opj_event_mgr::info_handler, opj_codec_private::m_event_mgr, opj_event_mgr::m_info_data, OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_set_MCT ( opj_cparameters_t parameters,
OPJ_FLOAT32 pEncodingMatrix,
OPJ_INT32 p_dc_shift,
OPJ_UINT32  pNbComp 
)

Sets the MCT matrix to use.

Parameters:
parameters the parameters to change.
pEncodingMatrix the encoding matrix.
p_dc_shift the dc shift coefficients to use.
pNbComp the number of components of the image.
Returns:
true if the parameters could be set.

References opj_cparameters::irreversible, opj_cparameters::mct_data, OPJ_EXTENSION_MCT, OPJ_FALSE, OPJ_IS_PART2, opj_malloc, OPJ_PROFILE_PART2, OPJ_TRUE, opj_cparameters::rsiz, and opj_cparameters::tcp_mct.

OPJ_BOOL OPJ_CALLCONV opj_set_warning_handler ( opj_codec_t p_codec,
opj_msg_callback  p_callback,
void *  p_user_data 
)

Set the warning handler use by openjpeg.

Parameters:
p_codec the codec previously initialise
p_callback the callback function which will be used
p_user_data client object where will be returned the message

References opj_codec_private::m_event_mgr, opj_event_mgr::m_warning_data, OPJ_FALSE, OPJ_TRUE, and opj_event_mgr::warning_handler.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_setup_decoder ( opj_codec_t p_codec,
opj_dparameters_t parameters 
)

Setup the decoder with decompression parameters provided by the user and with the message handler provided by the user.

Parameters:
p_codec decompressor handler
parameters decompression parameters
Returns:
true if the decoder is correctly set

References EVT_ERROR, opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_decompression, opj_codec_private::m_event_mgr, opj_event_msg(), OPJ_FALSE, and OPJ_TRUE.

Referenced by j2k_to_pnm().

OPJ_BOOL OPJ_CALLCONV opj_setup_encoder ( opj_codec_t p_codec,
opj_cparameters_t parameters,
opj_image_t image 
)

Setup the encoder parameters using the current image and using user parameters.

Parameters:
p_codec Compressor handle
parameters Compression parameters
image Input filled image

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, OPJ_FALSE, and OPJ_TRUE.

static OPJ_OFF_T opj_skip_from_file ( OPJ_OFF_T  p_nb_bytes,
FILE *  p_user_data 
) [static]

References OPJ_FSEEK.

Referenced by opj_stream_create_file_stream().

OPJ_BOOL OPJ_CALLCONV opj_start_compress ( opj_codec_t p_codec,
opj_image_t p_image,
opj_stream_t p_stream 
)

Start to compress the current image.

Parameters:
p_codec Compressor handle
image Input filled image
p_stream Input stgream

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.

opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream ( const char *  fname,
OPJ_BOOL  p_is_read_stream 
)

Create a stream from a file identified with its filename with default parameters (helper function).

Parameters:
fname the filename of the file to stream
p_is_read_stream whether the stream is a read stream (true) or not (false)

References OPJ_J2K_STREAM_CHUNK_SIZE, and opj_stream_create_file_stream().

Referenced by j2k_to_pnm().

opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream ( const char *  fname,
OPJ_SIZE_T  p_buffer_size,
OPJ_BOOL  p_is_read_stream 
)

Create a stream from a file identified with its filename with a specific buffer size.

Parameters:
fname the filename of the file to stream
p_buffer_size size of the chunk used to stream
p_is_read_stream whether the stream is a read stream (true) or not (false)

References opj_get_data_length_from_file(), opj_read_from_file(), opj_seek_from_file(), opj_skip_from_file(), opj_stream_create(), opj_stream_set_read_function(), opj_stream_set_seek_function(), opj_stream_set_skip_function(), opj_stream_set_user_data(), opj_stream_set_user_data_length(), opj_stream_set_write_function(), and opj_write_from_file().

Referenced by opj_stream_create_default_file_stream().

const char* OPJ_CALLCONV opj_version ( void   ) 

static OPJ_SIZE_T opj_write_from_file ( void *  p_buffer,
OPJ_SIZE_T  p_nb_bytes,
FILE *  p_file 
) [static]

OPJ_BOOL OPJ_CALLCONV opj_write_tile ( opj_codec_t p_codec,
OPJ_UINT32  p_tile_index,
OPJ_BYTE p_data,
OPJ_UINT32  p_data_size,
opj_stream_t p_stream 
)

Writes a tile with the given data.

Parameters:
p_codec the jpeg2000 codec.
p_tile_index the index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence.
p_data pointer to the data to write. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO INTERLEAVING should be set.
p_data_size this value os used to make sure the data being written is correct. The size must be equal to the sum for each component of tile_width * tile_height * component_size. component_size can be 1,2 or 4 bytes, depending on the precision of the given component.
p_stream the stream to write data to.
Returns:
true if the data could be written.

References opj_codec_private::is_decompressor, opj_codec_private::m_codec, opj_codec_private::m_codec_data, opj_codec_private::m_compression, opj_codec_private::m_event_mgr, and OPJ_FALSE.


Generated on Thu Jan 7 22:01:22 2016 for OpenJPEG by  doxygen 1.5.6