|
Grok 20.3.2
|
JPEG 2000 file format reader/writer. More...
#include <FileFormatJP2Family.h>
Public Member Functions | |
| FileFormatJP2Family (IStream *stream) | |
| virtual | ~FileFormatJP2Family () |
| FileFormatJP2Family (const FileFormatJP2Family &)=delete | |
| FileFormatJP2Family & | operator= (const FileFormatJP2Family &)=delete |
Protected Member Functions | |
| void | init (grk_decompress_parameters *param) |
| bool | readHeaderProcedure () |
| bool | readHeader (grk_header_info *header_info, GrkImage *headerImage) |
| virtual GrkImage * | getHeaderImage (void)=0 |
| grk_color * | getColour (void) |
| std::string | getBoxName (const Box &box) |
| const FindHandlerInfo | img_find_handler (uint32_t id) |
| Finds the BOX_FUNC related to given box id. | |
| uint32_t | read_asoc (AsocBox *parent, uint8_t **header_data, uint32_t *header_data_size, uint32_t asocSize) |
| bool | read_asoc (uint8_t *header_data, uint32_t header_data_size) |
| void | serializeAsoc (AsocBox *asoc, grk_asoc *serial_asocs, uint32_t *num_asocs, uint32_t level) |
| bool | read_box_header (Box *box, IStream *stream, uint32_t *bytesRead, bool codeStreamBoxWasRead) |
| bool | read_box_header (Box *box, uint8_t *p_data, uint32_t *bytesRead, uint64_t availableBytes) |
| uint8_t * | write_buffer (uint32_t boxId, Buffer8 *buffer, uint32_t *p_nb_bytes_written) |
| bool | write_ftyp (IStream *stream, uint32_t file_type) |
| bool | write_signature (IStream *stream, uint32_t sig) |
| bool | exec (std::vector< PROCEDURE_FUNC > *procs) |
| bool | read_jp2h (uint8_t *headerData, uint32_t headerSize) |
| Reads the Jpeg2000 file Header box - JP2 Header box. | |
| void | skip (uint8_t **headerData, uint32_t *headerSize, uint32_t skip) |
Protected Attributes | |
| std::vector< PROCEDURE_FUNC > * | procedure_list_ |
| list of execution procedures | |
| uint32_t | brand |
| uint32_t | minversion |
| uint32_t | numcl |
| uint32_t * | cl |
| uint32_t | w |
| uint32_t | h |
| uint16_t | numcomps |
| uint8_t | bpc |
| uint8_t | C |
| uint8_t | UnkC |
| uint8_t | IPR |
| uint8_t | meth |
| uint8_t | approx |
| GRK_ENUM_COLOUR_SPACE | enumcs |
| uint8_t | precedence |
| ComponentInfo * | comps |
| bool | has_capture_resolution |
| double | capture_resolution [2] |
| bool | has_display_resolution |
| double | display_resolution [2] |
| Buffer8 | xml |
| Buffer8 | xml_boxes [JP2_MAX_NUM_XML_BOXES] |
| uint32_t | numXmlBoxes |
| bool | io_xml_ |
| std::string | xml_outfile_ |
| Buffer8 | ipr |
| UUIDBox | uuids [JP2_MAX_NUM_UUIDS] |
| uint32_t | numUuids |
| std::unordered_map< uint32_t, BOX_FUNC > | header |
| AsocBox | root_asoc |
| uint32_t | jp2_state |
| bool | headerError_ |
| bool | headerRead_ |
| std::stack< Box > | superBoxes_ |
| std::unordered_map< uint32_t, BOX_FUNC > | img_header |
| IStream * | stream_ |
Private Member Functions | |
| double | calc_res (uint16_t num, uint16_t den, uint8_t exponent) |
| bool | read_ihdr (uint8_t *p_image_header_data, uint32_t image_header_size) |
| bool | read_res_box (uint32_t *id, uint32_t *num, uint32_t *den, uint32_t *exponent, uint8_t **p_resolution_data) |
| bool | read_res (uint8_t *p_resolution_data, uint32_t resolution_size) |
| bool | read_bpc (uint8_t *p_bpc_header_data, uint32_t bpc_header_size) |
| bool | read_channel_definition (uint8_t *p_cdef_header_data, uint32_t cdef_header_size) |
| bool | read_colr (uint8_t *p_colr_header_data, uint32_t colr_header_size) |
| bool | read_component_mapping (uint8_t *component_mapping_header_data, uint32_t component_mapping_header_size) |
| bool | read_palette_clr (uint8_t *p_pclr_header_data, uint32_t pclr_header_size) |
| bool | read_signature (uint8_t *headerData, uint32_t headerSize) |
| Reads a JPEG 2000 file signature box. | |
| bool | read_ftyp (uint8_t *headerData, uint32_t headerSize) |
| Reads a FTYP box - File type box. | |
| const FindHandlerInfo | find_handler (uint32_t id) |
| void | updateSuperBoxes (uint64_t boxBytes) |
JPEG 2000 file format reader/writer.
| grk::FileFormatJP2Family::FileFormatJP2Family | ( | IStream * | stream | ) |
References approx, bpc, brand, C, capture_resolution, cl, comps, display_resolution, enumcs, GRK_ENUM_CLRSPC_UNKNOWN, h, has_capture_resolution, has_display_resolution, header, headerError_, headerRead_, img_header, io_xml_, IPR, grk::JP2_BPCC, grk::JP2_CDEF, grk::JP2_CMAP, grk::JP2_COLR, grk::JP2_FTYP, grk::JP2_IHDR, grk::JP2_JP, grk::JP2_PCLR, grk::JP2_RES, jp2_state, meth, minversion, numcl, numcomps, numUuids, numXmlBoxes, precedence, procedure_list_, read_bpc(), read_channel_definition(), read_colr(), read_component_mapping(), read_ftyp(), read_ihdr(), read_palette_clr(), read_res(), read_signature(), stream_, UnkC, and w.
Referenced by grk::FileFormatJP2Compress::FileFormatJP2Compress(), grk::FileFormatJP2Decompress::FileFormatJP2Decompress(), FileFormatJP2Family(), grk::FileFormatMJ2::FileFormatMJ2(), and operator=().
|
virtual |
References cl, comps, grk::grk_free(), ipr, numUuids, numXmlBoxes, procedure_list_, uuids, xml, and xml_boxes.
|
delete |
References FileFormatJP2Family().
|
private |
Referenced by read_res().
|
protected |
Referenced by grk::FileFormatJP2Compress::end(), and grk::FileFormatJP2Compress::start().
|
private |
References header.
Referenced by readHeaderProcedure().
|
protected |
References grk::toBigEndian(), and grk::Box::type.
Referenced by read_jp2h(), grk::FileFormatMJ2Decompress::read_smj2(), and readHeaderProcedure().
|
protected |
References getHeaderImage().
Referenced by grk::FileFormatJP2Decompress::postProcess(), read_channel_definition(), read_colr(), read_component_mapping(), and read_palette_clr().
|
protectedpure virtual |
Implemented in grk::FileFormatJP2Compress, grk::FileFormatJP2Decompress, grk::FileFormatMJ2, and grk::FileFormatMJ2Decompress.
Referenced by getColour(), and read_palette_clr().
|
protected |
Finds the BOX_FUNC related to given box id.
| id | the id of the handler to fetch. |
References img_header.
Referenced by read_jp2h(), and readHeaderProcedure().
|
protected |
References io_xml_, and xml_outfile_.
Referenced by grk::FileFormatJP2Decompress::init(), and grk::FileFormatMJ2Decompress::init().
|
delete |
References FileFormatJP2Family().
|
protected |
References grk::AsocBox::children, grk::grk_read(), grk::grklog, grk::JP2_ASOC, grk::JP2_LBL, grk::JP2_XML, and read_asoc().
Referenced by grk::FileFormatJP2Decompress::FileFormatJP2Decompress(), read_asoc(), and read_asoc().
|
protected |
References grk::grklog, read_asoc(), and root_asoc.
|
protected |
References grk::grk_read(), grk::grklog, grk::JP2_JP2C, grk::Box::length, grk::IStream::numBytesLeft(), grk::IStream::read(), grk::IStream::supportsZeroCopy(), and grk::Box::type.
Referenced by grk::FileFormatMJ2Decompress::read_dref(), read_jp2h(), grk::FileFormatMJ2Decompress::read_smj2(), grk::FileFormatMJ2Decompress::read_stsd(), readHeaderProcedure(), and grk::FileFormatJP2Compress::transcode().
|
protected |
References grk::grk_read(), grk::grklog, grk::Box::length, and grk::Box::type.
|
private |
References bpc, comps, grk::grk_read(), grk::grklog, and numcomps.
Referenced by FileFormatJP2Family().
|
private |
References getColour(), GRK_CHANNEL_ASSOC_UNASSOCIATED, GRK_CHANNEL_TYPE_UNSPECIFIED, grk::grk_read(), and grk::grklog.
Referenced by FileFormatJP2Family().
|
private |
References approx, enumcs, getColour(), GRK_CUSTOM_CIELAB_SPACE, GRK_DEFAULT_CIELAB_SPACE, GRK_ENUM_CLRSPC_CIE, GRK_ENUM_CLRSPC_CMYK, GRK_ENUM_CLRSPC_EYCC, GRK_ENUM_CLRSPC_GRAY, GRK_ENUM_CLRSPC_SRGB, GRK_ENUM_CLRSPC_SYCC, GRK_ENUM_CLRSPC_UNKNOWN, grk::grk_read(), grk::grklog, meth, and precedence.
Referenced by FileFormatJP2Family().
|
private |
References getColour(), grk::grk_read(), and grk::grklog.
Referenced by FileFormatJP2Family().
|
private |
Reads a FTYP box - File type box.
| headerData | the data contained in the FTYP box. |
| headerSize | the size of the data contained in the FTYP box. |
References brand, cl, grk::grk_calloc(), grk::grk_read(), grk::grklog, jp2_state, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_SIGNATURE, minversion, and numcl.
Referenced by FileFormatJP2Family().
|
private |
References bpc, C, comps, GRK_MAX_SUPPORTED_IMAGE_PRECISION, grk::grk_read(), grk::grklog, h, IPR, grk::maxNumComponentsJ2K, numcomps, UnkC, and w.
Referenced by FileFormatJP2Family().
|
protected |
Reads the Jpeg2000 file Header box - JP2 Header box.
(warning, this is a super box).
| headerData | the data contained in the file header box. |
| headerSize | the size of the data contained in the file header box. |
References debugBoxes, getBoxName(), grk::grklog, img_find_handler(), grk::JP2_IHDR, jp2_state, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_HEADER, grk::Box::length, read_box_header(), and grk::Box::type.
Referenced by grk::FileFormatJP2Decompress::FileFormatJP2Decompress(), and grk::FileFormatMJ2Decompress::read_smj2().
|
private |
References grk::GrkImage::allocPalette(), getColour(), getHeaderImage(), GRK_MAX_SUPPORTED_IMAGE_PRECISION, grk::grk_read(), and grk::grklog.
Referenced by FileFormatJP2Family().
|
private |
References calc_res(), capture_resolution, display_resolution, GRK_RESOLUTION_BOX_SIZE, grk::grklog, has_capture_resolution, has_display_resolution, grk::JP2_CAPTURE_RES, grk::JP2_DISPLAY_RES, and read_res_box().
Referenced by FileFormatJP2Family().
|
private |
References grk::grk_read(), and grk::grklog.
Referenced by read_res().
|
private |
Reads a JPEG 2000 file signature box.
| headerData | the data contained in the signature box. |
| headerSize | the size of the data contained in the signature box. |
References grk::grk_read(), grk::grklog, grk::JP2_SIG, jp2_state, grk::JP2_STATE_NONE, and grk::JP2_STATE_SIGNATURE.
Referenced by FileFormatJP2Family().
|
protected |
References capture_resolution, grk::GrkImage::check_color(), display_resolution, enumcs, GRK_CLRSPC_CMYK, GRK_CLRSPC_CUSTOM_CIE, GRK_CLRSPC_DEFAULT_CIE, GRK_CLRSPC_EYCC, GRK_CLRSPC_GRAY, GRK_CLRSPC_SRGB, GRK_CLRSPC_SYCC, GRK_CLRSPC_UNKNOWN, GRK_DEFAULT_CIELAB_SPACE, GRK_ENUM_CLRSPC_CIE, GRK_ENUM_CLRSPC_CMYK, GRK_ENUM_CLRSPC_EYCC, GRK_ENUM_CLRSPC_GRAY, GRK_ENUM_CLRSPC_SRGB, GRK_ENUM_CLRSPC_SYCC, GRK_NUM_XML_BOXES_SUPPORTED, grk::grklog, has_capture_resolution, has_display_resolution, headerError_, headerRead_, io_xml_, numcomps, numXmlBoxes, readHeaderProcedure(), root_asoc, serializeAsoc(), xml, xml_boxes, and xml_outfile_.
Referenced by grk::FileFormatJP2Decompress::readHeader(), and grk::FileFormatMJ2Decompress::readHeader().
|
protected |
References grk::Box::byteCount, debugBoxes, find_handler(), getBoxName(), GRK_BOX_SIZE, grk::grk_calloc(), grk::grk_free(), grk::grk_realloc(), grk::grklog, img_find_handler(), grk::JP2_JP2C, jp2_state, grk::JP2_STATE_CODESTREAM, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_HEADER, grk::JP2_STATE_SIGNATURE, grk::Box::length, read_box_header(), stream_, superBoxes_, grk::Box::type, and updateSuperBoxes().
Referenced by readHeader().
|
protected |
References grk::Buffer< T, A >::buf(), grk::AsocBox::children, GRK_NUM_ASOC_BOXES_SUPPORTED, grk::grklog, grk::AsocBox::label, grk::Buffer< T, A >::num_elts(), and serializeAsoc().
Referenced by readHeader(), and serializeAsoc().
|
protected |
|
private |
References grk::Box::byteCount, and superBoxes_.
Referenced by readHeaderProcedure().
|
protected |
|
protected |
References brand, cl, grk::grklog, minversion, numcl, and grk::t1_t2::IStreamWriter::write().
Referenced by grk::FileFormatJP2Compress::write_ftyp(), and grk::FileFormatMJ2Compress::write_mj2_ftyp().
|
protected |
References grk::JP2_SIG, and grk::t1_t2::IStreamWriter::write().
Referenced by grk::FileFormatMJ2Compress::write_mj2_signature(), and grk::FileFormatJP2Compress::write_signature().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by FileFormatJP2Family(), grk::FileFormatJP2Decompress::readHeader(), and readHeader().
|
protected |
Referenced by FileFormatJP2Family(), grk::FileFormatJP2Decompress::readHeader(), and readHeader().
|
protected |
Referenced by FileFormatJP2Family(), and img_find_handler().
|
protected |
Referenced by FileFormatJP2Family(), init(), and readHeader().
|
protected |
|
protected |
|
protected |
Referenced by FileFormatJP2Family(), read_ftyp(), read_jp2h(), read_signature(), and readHeaderProcedure().
|
protected |
|
protected |
Referenced by FileFormatJP2Family(), grk::FileFormatJP2Compress::init(), read_ftyp(), and write_ftyp().
|
protected |
Referenced by FileFormatJP2Family(), grk::FileFormatJP2Compress::init(), read_ftyp(), and write_ftyp().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
list of execution procedures
Referenced by grk::FileFormatJP2Compress::default_validation(), grk::FileFormatJP2Compress::end(), FileFormatJP2Family(), grk::FileFormatJP2Compress::init_end_header_writing(), grk::FileFormatJP2Compress::init_header_writing(), grk::FileFormatJP2Compress::start(), and ~FileFormatJP2Family().
|
protected |
|
protected |
|
protected |
Referenced by readHeaderProcedure(), and updateSuperBoxes().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by init(), and readHeader().