OpenJPEG  1.5.1
Functions
openjpeg.c File Reference
#include "opj_config.h"
#include "opj_includes.h"

Functions

const char *OPJ_CALLCONV opj_version (void)
 
opj_dinfo_t *OPJ_CALLCONV opj_create_decompress (OPJ_CODEC_FORMAT format)
 Creates a J2K/JPT/JP2 decompression structure. More...
 
void OPJ_CALLCONV opj_destroy_decompress (opj_dinfo_t *dinfo)
 Destroy a decompressor handle. More...
 
void OPJ_CALLCONV opj_set_default_decoder_parameters (opj_dparameters_t *parameters)
 Set decoding parameters to default values. More...
 
void OPJ_CALLCONV opj_setup_decoder (opj_dinfo_t *dinfo, opj_dparameters_t *parameters)
 Setup the decoder decoding parameters using user parameters. More...
 
opj_image_t *OPJ_CALLCONV opj_decode (opj_dinfo_t *dinfo, opj_cio_t *cio)
 Decode an image from a JPEG-2000 codestream. More...
 
opj_image_t *OPJ_CALLCONV opj_decode_with_info (opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
 Decode an image from a JPEG-2000 codestream and extract the codestream information. More...
 
opj_cinfo_t *OPJ_CALLCONV opj_create_compress (OPJ_CODEC_FORMAT format)
 Creates a J2K/JP2 compression structure. More...
 
void OPJ_CALLCONV opj_destroy_compress (opj_cinfo_t *cinfo)
 Destroy a compressor handle. More...
 
void OPJ_CALLCONV opj_set_default_encoder_parameters (opj_cparameters_t *parameters)
 Set encoding parameters to default values, that means : More...
 
void OPJ_CALLCONV opj_setup_encoder (opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image)
 Setup the encoder parameters using the current image and using user parameters. More...
 
opj_bool OPJ_CALLCONV opj_encode (opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index)
 Encode an image into a JPEG-2000 codestream 3. More...
 
opj_bool OPJ_CALLCONV opj_encode_with_info (opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info)
 Encode an image into a JPEG-2000 codestream and extract the codestream information. More...
 
void OPJ_CALLCONV opj_destroy_cstr_info (opj_codestream_info_t *cstr_info)
 Destroy Codestream information after compression or decompression. More...
 

Function Documentation

opj_cinfo_t* OPJ_CALLCONV opj_create_compress ( OPJ_CODEC_FORMAT  format)

Creates a J2K/JP2 compression structure.

Parameters
formatCoder to select
Returns
Returns a handle to a compressor if successful, returns NULL otherwise

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_create_compress(), jp2_create_compress(), opj_calloc, OPJ_FALSE, and opj_free.

opj_dinfo_t* OPJ_CALLCONV opj_create_decompress ( OPJ_CODEC_FORMAT  format)

Creates a J2K/JPT/JP2 decompression structure.

Parameters
formatDecoder to select
Returns
Returns a handle to a decompressor if successful, returns NULL otherwise

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_create_decompress(), jp2_create_decompress(), opj_calloc, opj_free, and OPJ_TRUE.

opj_image_t* OPJ_CALLCONV opj_decode ( opj_dinfo_t dinfo,
opj_cio_t cio 
)

Decode an image from a JPEG-2000 codestream.

Parameters
dinfodecompressor handle
cioInput buffer stream
Returns
Returns a decoded image if successful, returns NULL otherwise

References opj_decode_with_info().

opj_image_t* OPJ_CALLCONV opj_decode_with_info ( opj_dinfo_t dinfo,
opj_cio_t cio,
opj_codestream_info_t cstr_info 
)

Decode an image from a JPEG-2000 codestream and extract the codestream information.

Parameters
dinfodecompressor handle
cioInput buffer stream
cstr_infoCodestream information structure if needed afterwards, NULL otherwise
Returns
Returns a decoded image if successful, returns NULL otherwise

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_decode(), j2k_decode_jpt_stream(), and opj_jp2_decode().

Referenced by opj_decode().

void OPJ_CALLCONV opj_destroy_compress ( opj_cinfo_t cinfo)

Destroy a compressor handle.

Parameters
cinfocompressor handle to destroy

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_destroy_compress(), jp2_destroy_compress(), and opj_free.

void OPJ_CALLCONV opj_destroy_cstr_info ( opj_codestream_info_t cstr_info)

Destroy Codestream information after compression or decompression.

Parameters
cstr_infoCodestream information structure

References opj_tile_info::marker, opj_codestream_info::marker, opj_codestream_info::numdecompos, opj_free, opj_tile_info::packet, opj_codestream_info::th, opj_tile_info::thresh, opj_codestream_info::tile, opj_tile_info::tp, and opj_codestream_info::tw.

void OPJ_CALLCONV opj_destroy_decompress ( opj_dinfo_t dinfo)

Destroy a decompressor handle.

Parameters
dinfodecompressor handle to destroy

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_destroy_decompress(), jp2_destroy_decompress(), and opj_free.

opj_bool OPJ_CALLCONV opj_encode ( opj_cinfo_t cinfo,
opj_cio_t cio,
opj_image_t image,
char *  index 
)

Encode an image into a JPEG-2000 codestream 3.

Parameters
cinfocompressor handle
cioOutput buffer stream
imageImage to encode
indexDepreacted -> Set to NULL. To extract index, used opj_encode_wci()
Returns
Returns true if successful, returns false otherwise

References EVT_WARNING, opj_encode_with_info(), and opj_event_msg().

opj_bool OPJ_CALLCONV opj_encode_with_info ( opj_cinfo_t cinfo,
opj_cio_t cio,
opj_image_t image,
opj_codestream_info_t cstr_info 
)

Encode an image into a JPEG-2000 codestream and extract the codestream information.

Parameters
cinfocompressor handle
cioOutput buffer stream
imageImage to encode
cstr_infoCodestream information structure if needed afterwards, NULL otherwise
Returns
Returns true if successful, returns false otherwise

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_encode(), OPJ_FALSE, and opj_jp2_encode().

Referenced by opj_encode().

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
parametersCompression 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, LRCP, opj_cparameters::max_comp_size, opj_cparameters::numresolution, OFF, OPJ_FALSE, opj_cparameters::prog_order, opj_cparameters::roi_compno, STD_RSIZ, opj_cparameters::subsampling_dx, opj_cparameters::subsampling_dy, opj_cparameters::tcp_numlayers, opj_cparameters::tcp_rates, and opj_cparameters::tp_on.

void OPJ_CALLCONV opj_setup_decoder ( opj_dinfo_t dinfo,
opj_dparameters_t parameters 
)

Setup the decoder decoding parameters using user parameters.

Decoding parameters are returned in j2k->cp.

Parameters
dinfodecompressor handle
parametersdecompression parameters

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_setup_decoder(), and jp2_setup_decoder().

void OPJ_CALLCONV opj_setup_encoder ( opj_cinfo_t cinfo,
opj_cparameters_t parameters,
opj_image_t image 
)

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

Parameters
cinfoCompressor handle
parametersCompression parameters
imageInput filled image

References CODEC_J2K, CODEC_JP2, CODEC_JPT, CODEC_UNKNOWN, j2k_setup_encoder(), and jp2_setup_encoder().

const char* OPJ_CALLCONV opj_version ( void  )