|
OpenJPEG 1.5.2
|
Functions | |
Local static functions | |
| static opj_bool | jp2_read_boxhdr (opj_common_ptr cinfo, opj_cio_t *cio, opj_jp2_box_t *box) |
| Read box headers. | |
| static opj_bool | jp2_read_ihdr (opj_jp2_t *jp2, opj_cio_t *cio) |
| Read the IHDR box - Image Header box. | |
| static void | jp2_write_ihdr (opj_jp2_t *jp2, opj_cio_t *cio) |
| static void | jp2_write_bpcc (opj_jp2_t *jp2, opj_cio_t *cio) |
| static opj_bool | jp2_read_bpcc (opj_jp2_t *jp2, opj_cio_t *cio) |
| static void | jp2_write_colr (opj_jp2_t *jp2, opj_cio_t *cio) |
| static void | jp2_write_ftyp (opj_jp2_t *jp2, opj_cio_t *cio) |
| Write the FTYP box - File type box. | |
| static opj_bool | jp2_read_ftyp (opj_jp2_t *jp2, opj_cio_t *cio) |
| Read the FTYP box - File type box. | |
| static int | jp2_write_jp2c (opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) |
| static opj_bool | jp2_read_jp2c (opj_jp2_t *jp2, opj_cio_t *cio, unsigned int *j2k_codestream_length, unsigned int *j2k_codestream_offset) |
| static void | jp2_write_jp (opj_cio_t *cio) |
| static opj_bool | jp2_read_jp (opj_jp2_t *jp2, opj_cio_t *cio) |
| Read the JP box - JPEG 2000 signature. | |
| static opj_bool | jp2_read_struct (opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_color_t *color) |
| Decode the structure of a JP2 file. | |
| static void | jp2_apply_pclr (opj_jp2_color_t *color, opj_image_t *image, opj_common_ptr cinfo) |
| Apply collected palette data. | |
| static opj_bool | jp2_read_pclr (opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_box_t *box, opj_jp2_color_t *color) |
| Collect palette data. | |
| static opj_bool | jp2_read_cmap (opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_box_t *box, opj_jp2_color_t *color) |
| Collect component mapping data. | |
| static opj_bool | jp2_read_colr (opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_box_t *box, opj_jp2_color_t *color) |
| Collect colour specification data. | |
| static int | write_fidx (int offset_jp2c, int length_jp2c, int offset_idx, int length_idx, opj_cio_t *cio) |
| Write file Index (superbox). | |
| static void | write_iptr (int offset, int length, opj_cio_t *cio) |
| Write index Finder box. | |
| static void | write_prxy (int offset_jp2c, int length_jp2c, int offset_idx, int length_idx, opj_cio_t *cio) |
| Write proxy box. | |
| static void | jp2_free_pclr (opj_jp2_color_t *color) |
| static void | free_color_data (opj_jp2_color_t *color) |
| static void | jp2_apply_cdef (opj_image_t *image, opj_jp2_color_t *color) |
| static opj_bool | jp2_read_cdef (opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_box_t *box, opj_jp2_color_t *color) |
| opj_bool | jp2_read_jp2h (opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_color_t *color) |
| Read the JP2H box - JP2 Header box (used in MJ2). | |
| static opj_bool | opj_jp2_check_color (opj_image_t *image, opj_jp2_color_t *color, opj_common_ptr cinfo) |
| opj_image_t * | opj_jp2_decode (opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info) |
| Decode an image from a JPEG-2000 file stream. | |
| void | jp2_write_jp2h (opj_jp2_t *jp2, opj_cio_t *cio) |
| Write the JP2H box - JP2 Header box (used in MJ2). | |
| opj_jp2_t * | jp2_create_decompress (opj_common_ptr cinfo) |
| Creates a JP2 decompression structure. | |
| void | jp2_destroy_decompress (opj_jp2_t *jp2) |
| Destroy a JP2 decompressor handle. | |
| void | jp2_setup_decoder (opj_jp2_t *jp2, opj_dparameters_t *parameters) |
| Setup the decoder decoding parameters using user parameters. | |
| opj_jp2_t * | jp2_create_compress (opj_common_ptr cinfo) |
| Creates a JP2 compression structure. | |
| void | jp2_destroy_compress (opj_jp2_t *jp2) |
| Destroy a JP2 compressor handle. | |
| void | jp2_setup_encoder (opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image) |
| Setup the encoder parameters using the current image and using user parameters. | |
| opj_bool | opj_jp2_encode (opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) |
| Encode an image into a JPEG-2000 file stream. | |
|
static |
References opj_jp2_color::icc_profile_buf, opj_jp2_cdef::info, opj_jp2_color::jp2_cdef, jp2_free_pclr(), opj_jp2_color::jp2_pclr, and opj_free.
Referenced by opj_jp2_decode().
|
static |
References opj_jp2_cdef_info::asoc, opj_jp2_cdef_info::cn, opj_image::comps, opj_jp2_cdef::info, opj_jp2_color::jp2_cdef, opj_jp2_cdef::n, opj_free, and opj_jp2_cdef_info::typ.
Referenced by opj_jp2_decode().
|
static |
Apply collected palette data.
| color | Collector for profile, cdef and pclr data |
| image |
References opj_jp2_pclr::channel_sign, opj_jp2_pclr::channel_size, opj_jp2_pclr::cmap, opj_jp2_cmap_comp::cmp, opj_image::comps, opj_image_comp::data, opj_jp2_pclr::entries, EVT_ERROR, opj_image_comp::h, jp2_free_pclr(), opj_jp2_color::jp2_pclr, opj_jp2_pclr::nr_channels, opj_jp2_pclr::nr_entries, opj_image::numcomps, opj_event_msg(), opj_free, opj_malloc, opj_jp2_cmap_comp::pcol, opj_image_comp::prec, opj_image_comp::sgnd, and opj_image_comp::w.
Referenced by opj_jp2_decode().
| opj_jp2_t * jp2_create_compress | ( | opj_common_ptr | cinfo | ) |
Creates a JP2 compression structure.
| cinfo | Codec context info |
References opj_jp2::cinfo, opj_jp2::j2k, j2k_create_compress(), jp2_destroy_compress(), and opj_malloc.
Referenced by opj_create_compress().
| opj_jp2_t * jp2_create_decompress | ( | opj_common_ptr | cinfo | ) |
Creates a JP2 decompression structure.
| cinfo | Codec context info |
References opj_jp2::cinfo, opj_jp2::j2k, j2k_create_decompress(), jp2_destroy_decompress(), and opj_calloc.
Referenced by opj_create_decompress().
| void jp2_destroy_compress | ( | opj_jp2_t * | jp2 | ) |
Destroy a JP2 compressor handle.
| jp2 | JP2 compressor handle to destroy |
References opj_jp2::cl, opj_jp2::comps, opj_jp2::j2k, j2k_destroy_compress(), and opj_free.
Referenced by jp2_create_compress(), and opj_destroy_compress().
| void jp2_destroy_decompress | ( | opj_jp2_t * | jp2 | ) |
Destroy a JP2 decompressor handle.
| jp2 | JP2 decompressor handle to destroy |
References opj_jp2::cl, opj_jp2::comps, opj_jp2::j2k, j2k_destroy_decompress(), and opj_free.
Referenced by jp2_create_decompress(), and opj_destroy_decompress().
|
static |
References opj_jp2_pclr::channel_sign, opj_jp2_pclr::channel_size, opj_jp2_pclr::cmap, opj_jp2_pclr::entries, opj_jp2_color::jp2_pclr, and opj_free.
Referenced by free_color_data(), jp2_apply_pclr(), and opj_jp2_decode().
|
static |
Read box headers.
| cinfo | Codec context info |
| cio | Input stream |
| box |
References cio_numbytesleft(), cio_read(), cio_tell(), EVT_ERROR, opj_jp2_box::init_pos, opj_jp2_box::length, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and opj_jp2_box::type.
Referenced by jp2_read_bpcc(), jp2_read_ftyp(), jp2_read_ihdr(), jp2_read_jp(), jp2_read_jp2c(), and jp2_read_jp2h().
References opj_jp2_comps::bpcc, opj_jp2::cinfo, cio_read(), cio_tell(), opj_jp2::comps, EVT_ERROR, opj_jp2_box::init_pos, JP2_BPCC, jp2_read_boxhdr(), opj_jp2_box::length, opj_jp2::numcomps, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and opj_jp2_box::type.
Referenced by jp2_read_jp2h().
|
static |
References opj_jp2_cdef_info::asoc, cio_read(), opj_jp2_cdef_info::cn, opj_jp2_cdef::info, opj_jp2_color::jp2_cdef, opj_jp2_cdef::n, OPJ_ARG_NOT_USED, OPJ_FALSE, opj_malloc, OPJ_TRUE, and opj_jp2_cdef_info::typ.
Referenced by jp2_read_jp2h().
|
static |
Collect component mapping data.
| jp2 | JP2 handle |
| cio | Input buffer stream |
| box | |
| color | Collector for profile, cdef and pclr data |
References cio_read(), opj_jp2_pclr::cmap, opj_jp2_cmap_comp::cmp, opj_jp2_color::jp2_pclr, opj_jp2_cmap_comp::mtyp, opj_jp2_pclr::nr_channels, OPJ_ARG_NOT_USED, OPJ_FALSE, opj_malloc, OPJ_TRUE, and opj_jp2_cmap_comp::pcol.
Referenced by jp2_read_jp2h().
|
static |
Collect colour specification data.
| jp2 | JP2 handle |
| cio | Input buffer stream |
| box | |
| color | Collector for profile, cdef and pclr data |
References opj_jp2::approx, opj_jp2::cinfo, cio_getbp(), cio_read(), cio_skip(), cio_tell(), opj_jp2::enumcs, EVT_ERROR, opj_jp2_color::icc_profile_buf, opj_jp2_color::icc_profile_len, opj_jp2_box::init_pos, opj_jp2_color::jp2_has_colr, opj_jp2_box::length, opj_jp2::meth, opj_event_msg(), OPJ_FALSE, opj_malloc, OPJ_TRUE, and opj_jp2::precedence.
Referenced by jp2_read_jp2h().
Read the FTYP box - File type box.
| jp2 | JP2 handle |
| cio | Input buffer stream |
References opj_jp2::brand, opj_jp2::cinfo, cio_numbytesleft(), cio_read(), cio_tell(), opj_jp2::cl, EVT_ERROR, opj_jp2_box::init_pos, JP2_FTYP, jp2_read_boxhdr(), opj_jp2_box::length, opj_jp2::minversion, opj_jp2::numcl, opj_event_msg(), OPJ_FALSE, opj_malloc, OPJ_TRUE, and opj_jp2_box::type.
Referenced by jp2_read_struct().
Read the IHDR box - Image Header box.
| jp2 | JP2 handle |
| cio | Input buffer stream |
References opj_jp2::bpc, opj_jp2::C, opj_jp2::cinfo, cio_read(), cio_tell(), opj_jp2::comps, EVT_ERROR, opj_jp2::h, opj_jp2_box::init_pos, opj_jp2::IPR, JP2_IHDR, jp2_read_boxhdr(), opj_jp2_box::length, opj_jp2::numcomps, opj_event_msg(), OPJ_FALSE, opj_malloc, OPJ_TRUE, opj_jp2_box::type, opj_jp2::UnkC, and opj_jp2::w.
Referenced by jp2_read_jp2h().
Read the JP box - JPEG 2000 signature.
| jp2 | JP2 handle |
| cio | Input buffer stream |
References opj_jp2::cinfo, cio_read(), cio_tell(), EVT_ERROR, opj_jp2_box::init_pos, JP2_JP, jp2_read_boxhdr(), opj_jp2_box::length, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and opj_jp2_box::type.
Referenced by jp2_read_struct().
|
static |
References opj_jp2::cinfo, cio_skip(), cio_tell(), EVT_ERROR, JP2_JP2C, jp2_read_boxhdr(), opj_jp2_box::length, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and opj_jp2_box::type.
Referenced by jp2_read_struct().
| opj_bool jp2_read_jp2h | ( | opj_jp2_t * | jp2, |
| opj_cio_t * | cio, | ||
| opj_jp2_color_t * | color ) |
Read the JP2H box - JP2 Header box (used in MJ2).
| jp2 | JP2 handle |
| cio | Input buffer stream |
| ext | Collector for profile, cdef and pclr data |
References opj_cio::bp, opj_jp2::bpc, opj_jp2::cinfo, cio_seek(), cio_skip(), cio_tell(), opj_cio::end, EVT_ERROR, opj_jp2::ignore_pclr_cmap_cdef, opj_jp2_box::init_pos, JP2_CDEF, JP2_CMAP, JP2_COLR, opj_jp2_color::jp2_has_colr, JP2_JP2C, JP2_JP2H, JP2_PCLR, jp2_read_boxhdr(), jp2_read_bpcc(), jp2_read_cdef(), jp2_read_cmap(), jp2_read_colr(), jp2_read_ihdr(), jp2_read_pclr(), opj_jp2_box::length, opj_event_msg(), OPJ_FALSE, and opj_jp2_box::type.
Referenced by jp2_read_struct().
|
static |
Collect palette data.
| jp2 | JP2 handle |
| cio | Input buffer stream |
| box | |
| color | Collector for profile, cdef and pclr data |
References opj_jp2_pclr::channel_sign, opj_jp2_pclr::channel_size, cio_read(), opj_jp2_pclr::cmap, opj_jp2_pclr::entries, opj_jp2_color::jp2_pclr, opj_jp2_pclr::nr_channels, opj_jp2_pclr::nr_entries, OPJ_ARG_NOT_USED, OPJ_FALSE, opj_malloc, and OPJ_TRUE.
Referenced by jp2_read_jp2h().
|
static |
Decode the structure of a JP2 file.
| jp2 | JP2 handle |
| cio | Input buffer stream |
| color | Collector for profile, cdef and pclr data |
References opj_jp2::j2k_codestream_length, opj_jp2::j2k_codestream_offset, jp2_read_ftyp(), jp2_read_jp(), jp2_read_jp2c(), jp2_read_jp2h(), OPJ_FALSE, and OPJ_TRUE.
Referenced by opj_jp2_decode().
| void jp2_setup_decoder | ( | opj_jp2_t * | jp2, |
| opj_dparameters_t * | parameters ) |
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in jp2->j2k->cp.
| jp2 | JP2 decompressor handle |
| parameters | decompression parameters |
References opj_dparameters::flags, opj_jp2::ignore_pclr_cmap_cdef, opj_jp2::j2k, j2k_setup_decoder(), and OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG.
Referenced by opj_setup_decoder().
| void jp2_setup_encoder | ( | opj_jp2_t * | jp2, |
| opj_cparameters_t * | parameters, | ||
| opj_image_t * | image ) |
Setup the encoder parameters using the current image and using user parameters.
Coding parameters are returned in jp2->j2k->cp.
| jp2 | JP2 compressor handle |
| parameters | compression parameters |
| image | input filled image |
References opj_jp2::approx, opj_jp2::bpc, opj_jp2_comps::bpcc, opj_jp2::brand, opj_jp2::C, opj_jp2::cinfo, opj_jp2::cl, opj_image::color_space, opj_image::comps, opj_jp2::comps, opj_jp2::enumcs, EVT_ERROR, opj_jp2::h, opj_jp2::IPR, opj_jp2::j2k, j2k_setup_encoder(), JP2_JP2, opj_cparameters::jpip_on, opj_jp2::jpip_on, opj_jp2::meth, opj_jp2::minversion, opj_jp2::numcl, opj_image::numcomps, opj_jp2::numcomps, opj_event_msg(), opj_malloc, opj_image_comp::prec, opj_jp2::precedence, opj_image_comp::sgnd, opj_jp2::UnkC, opj_jp2::w, opj_image::x0, opj_image::x1, opj_image::y0, and opj_image::y1.
Referenced by opj_setup_encoder().
References opj_jp2_comps::bpcc, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_jp2::comps, opj_jp2_box::init_pos, JP2_BPCC, opj_jp2_box::length, and opj_jp2::numcomps.
Referenced by jp2_write_jp2h().
References opj_jp2::approx, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_jp2::enumcs, opj_jp2_box::init_pos, JP2_COLR, opj_jp2_box::length, opj_jp2::meth, and opj_jp2::precedence.
Referenced by jp2_write_jp2h().
Write the FTYP box - File type box.
| jp2 | JP2 handle |
| cio | Output buffer stream |
References opj_jp2::brand, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_jp2::cl, opj_jp2_box::init_pos, JP2_FTYP, opj_jp2_box::length, opj_jp2::minversion, and opj_jp2::numcl.
Referenced by opj_jp2_encode().
References opj_jp2::bpc, opj_jp2::C, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_jp2::h, opj_jp2_box::init_pos, opj_jp2::IPR, JP2_IHDR, opj_jp2_box::length, opj_jp2::numcomps, opj_jp2::UnkC, and opj_jp2::w.
Referenced by jp2_write_jp2h().
|
static |
References cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_jp2_box::init_pos, JP2_JP, and opj_jp2_box::length.
Referenced by opj_jp2_encode().
|
static |
References opj_j2k::cinfo, cio_seek(), cio_skip(), cio_tell(), cio_write(), EVT_ERROR, opj_jp2_box::init_pos, opj_jp2::j2k, opj_jp2::j2k_codestream_length, opj_jp2::j2k_codestream_offset, j2k_encode(), JP2_JP2C, opj_jp2_box::length, and opj_event_msg().
Referenced by opj_jp2_encode().
Write the JP2H box - JP2 Header box (used in MJ2).
| jp2 | JP2 handle |
| cio | Output buffer stream |
References opj_jp2::bpc, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_jp2_box::init_pos, JP2_JP2H, jp2_write_bpcc(), jp2_write_colr(), jp2_write_ihdr(), and opj_jp2_box::length.
Referenced by opj_jp2_encode().
|
static |
| opj_image_t * opj_jp2_decode | ( | opj_jp2_t * | jp2, |
| opj_cio_t * | cio, | ||
| opj_codestream_info_t * | cstr_info ) |
Decode an image from a JPEG-2000 file stream.
| jp2 | JP2 decompressor handle |
| cio | Input buffer stream |
| cstr_info | Codestream information structure if required, NULL otherwise |
References opj_jp2::cinfo, CLRSPC_GRAY, CLRSPC_SRGB, CLRSPC_SYCC, CLRSPC_UNKNOWN, opj_jp2_pclr::cmap, opj_image::color_space, opj_jp2::enumcs, EVT_ERROR, free_color_data(), opj_image::icc_profile_buf, opj_jp2_color::icc_profile_buf, opj_image::icc_profile_len, opj_jp2_color::icc_profile_len, opj_jp2::ignore_pclr_cmap_cdef, opj_jp2::j2k, j2k_decode(), jp2_apply_cdef(), jp2_apply_pclr(), opj_jp2_color::jp2_cdef, jp2_free_pclr(), opj_jp2_color::jp2_pclr, jp2_read_struct(), opj_event_msg(), and opj_jp2_check_color().
Referenced by opj_decode_with_info().
| opj_bool opj_jp2_encode | ( | opj_jp2_t * | jp2, |
| opj_cio_t * | cio, | ||
| opj_image_t * | image, | ||
| opj_codestream_info_t * | cstr_info ) |
Encode an image into a JPEG-2000 file stream.
| jp2 | JP2 compressor handle |
| cio | Output buffer stream |
| image | Image to encode |
| cstr_info | Codestream information structure if required, NULL otherwise |
References opj_jp2::cinfo, cio_seek(), cio_skip(), cio_tell(), EVT_ERROR, jp2_write_ftyp(), jp2_write_jp(), jp2_write_jp2c(), jp2_write_jp2h(), opj_jp2::jpip_on, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, write_cidx(), write_fidx(), and write_iptr().
Referenced by opj_encode_with_info().
|
static |
Write file Index (superbox).
| [in] | offset_jp2c | offset of jp2c box |
| [in] | length_jp2c | length of jp2c box |
| [in] | offset_idx | offset of cidx box |
| [in] | length_idx | length of cidx box |
| [in] | cio | file output handle |
References cio_seek(), cio_skip(), cio_tell(), cio_write(), JPIP_FIDX, and write_prxy().
Referenced by opj_jp2_encode().
|
static |
Write index Finder box.
| [in] | offset | offset of fidx box |
| [in] | length | length of fidx box |
| [in] | cio | file output handle |
References cio_seek(), cio_skip(), cio_tell(), cio_write(), and JPIP_IPTR.
Referenced by opj_jp2_encode().
|
static |
Write proxy box.
| [in] | offset_jp2c | offset of jp2c box |
| [in] | length_jp2c | length of jp2c box |
| [in] | offset_idx | offset of cidx box |
| [in] | length_idx | length of cidx box |
| [in] | cio | file output handle |
References cio_seek(), cio_skip(), cio_tell(), cio_write(), JP2_JP2C, JPIP_CIDX, and JPIP_PRXY.
Referenced by write_fidx().