Grok
9.5.0
|
#include <FileFormatDecompress.h>
Public Member Functions | |
FileFormatDecompress (IBufferedStream *stream) | |
virtual | ~FileFormatDecompress () |
bool | readHeader (grk_header_info *header_info) |
Main header reading function handler. More... | |
GrkImage * | getImage (uint16_t tileIndex) |
GrkImage * | getImage (void) |
void | initDecompress (grk_dparameters *p_param) |
Set up decompressor function handler. More... | |
bool | setDecompressWindow (grkRectU32 window) |
bool | decompress (grk_plugin_tile *tile) |
bool | decompressTile (uint16_t tileIndex) |
bool | endDecompress (void) |
Reading function used after code stream if necessary. More... | |
void | dump (uint32_t flag, FILE *outputFileStream) |
![]() | |
FileFormat (void) | |
virtual | ~FileFormat () |
![]() | |
virtual | ~ICodeStreamDecompress ()=default |
Static Public Member Functions | |
static void | free_color (grk_color *color) |
Private Member Functions | |
uint32_t | read_asoc (AsocBox *parent, uint8_t **header_data, uint32_t *header_data_size, uint32_t asocSize) |
bool | readHeaderProcedureImpl (void) |
bool | read_box_hdr (FileFormatBox *box, uint32_t *p_number_bytes_read, IBufferedStream *stream) |
bool | read_ihdr (uint8_t *p_image_header_data, uint32_t image_header_size) |
bool | read_xml (uint8_t *p_xml_data, uint32_t xml_size) |
bool | read_uuid (uint8_t *headerData, uint32_t 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) |
double | calc_res (uint16_t num, uint16_t den, uint8_t exponent) |
bool | read_bpc (uint8_t *p_bpc_header_data, uint32_t bpc_header_size) |
void | apply_channel_definition (GrkImage *image, grk_color *color) |
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 | check_color (GrkImage *image, grk_color *color) |
bool | apply_palette_clr (GrkImage *image, grk_color *color) |
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) |
const BOX_FUNC | find_handler (uint32_t id) |
const BOX_FUNC | img_find_handler (uint32_t id) |
Finds the image execution function related to the given box id. More... | |
bool | read_jp (uint8_t *headerData, uint32_t header_size) |
Reads a JPEG 2000 file signature box. More... | |
bool | read_ftyp (uint8_t *headerData, uint32_t header_size) |
Reads a a FTYP box - File type box. More... | |
bool | read_jp2h (uint8_t *headerData, uint32_t header_size) |
Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box). More... | |
bool | read_box (FileFormatBox *box, uint8_t *p_data, uint32_t *p_number_bytes_read, uint64_t p_box_max_size) |
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) |
void | init_end_header_reading (void) |
bool | applyColour (GrkImage *img) |
bool | applyColour (void) |
Static Private Member Functions | |
static void | alloc_palette (grk_color *color, uint8_t num_channels, uint16_t num_entries) |
static void | free_palette_clr (grk_color *color) |
Private Attributes | |
std::map< uint32_t, BOX_FUNC > | header |
std::map< uint32_t, BOX_FUNC > | img_header |
bool | m_headerError |
AsocBox | root_asoc |
CodeStreamDecompress * | codeStream |
uint32_t | jp2_state |
Additional Inherited Members | |
![]() | |
bool | exec (std::vector< PROCEDURE_FUNC > *procs) |
![]() | |
std::vector< PROCEDURE_FUNC > * | m_validation_list |
list of validation procedures More... | |
std::vector< PROCEDURE_FUNC > * | m_procedure_list |
list of execution procedures More... | |
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 |
uint32_t | brand |
uint32_t | minversion |
uint32_t | numcl |
uint32_t * | cl |
ComponentInfo * | comps |
grk_color | color |
bool | has_capture_resolution |
double | capture_resolution [2] |
bool | has_display_resolution |
double | display_resolution [2] |
grkBufferU8 | xml |
UUIDBox | uuids [JP2_MAX_NUM_UUIDS] |
uint32_t | numUuids |
grk::FileFormatDecompress::FileFormatDecompress | ( | IBufferedStream * | stream | ) |
References header, img_header, JP2_ASOC, JP2_BPCC, JP2_CDEF, JP2_CMAP, JP2_COLR, JP2_FTYP, JP2_IHDR, JP2_JP, JP2_JP2H, JP2_PCLR, JP2_RES, JP2_UUID, JP2_XML, read_asoc(), read_bpc(), read_channel_definition(), read_colr(), read_component_mapping(), read_ftyp(), read_ihdr(), read_jp(), read_jp2h(), read_palette_clr(), read_res(), read_uuid(), and read_xml().
|
virtual |
References codeStream.
|
staticprivate |
References grk::FileFormat::color, free_palette_clr(), and grk_color::palette.
Referenced by read_palette_clr().
|
private |
References grk_color::channel_definition, grk::FileFormat::color, _grk_image::comps, _grk_channel_definition::descriptions, GRK_COMPONENT_ASSOC_WHOLE_IMAGE, GRK_COMPONENT_TYPE_COLOUR, grk::GRK_WARN(), ojph::info, _grk_channel_definition::num_channel_descriptions, _grk_image::numcomps, and _grk_image_comp::type.
Referenced by applyColour().
References grk::GrkImage::allocData(), _grk_palette_data::channel_prec, grk::FileFormat::color, _grk_image::comps, _grk_image_comp::data, grk::GRK_ERROR(), grk_image_single_component_data_free(), grk::grkAlignedFree(), grk::FileFormat::h, _grk_image::numcomps, grk_color::palette, _grk_image_comp::prec, and grk::FileFormat::w.
Referenced by applyColour().
|
private |
|
private |
References codeStream, and grk::CodeStreamDecompress::getAllImages().
Referenced by decompress(), and decompressTile().
|
private |
Referenced by read_res().
References grk_color::channel_definition, grk::FileFormat::color, _grk_palette_data::component_mapping, _grk_channel_definition::descriptions, GRK_COMPONENT_ASSOC_UNASSOCIATED, grk::GRK_ERROR(), grk::GRK_WARN(), grk::grkCalloc(), grk::grkFree(), ojph::info, _grk_channel_definition::num_channel_descriptions, _grk_palette_data::num_channels, _grk_image::numcomps, and grk_color::palette.
Referenced by readHeader().
|
virtual |
Implements grk::ICodeStreamDecompress.
References applyColour(), codeStream, grk::CodeStreamDecompress::decompress(), and grk::GRK_ERROR().
|
virtual |
Implements grk::ICodeStreamDecompress.
References applyColour(), codeStream, grk::CodeStreamDecompress::decompressTile(), and grk::GRK_ERROR().
|
virtual |
Implements grk::ICodeStreamDecompress.
References codeStream, and grk::CodeStreamDecompress::dump().
|
virtual |
Reading function used after code stream if necessary.
Implements grk::ICodeStreamDecompress.
References codeStream, grk::CodeStreamDecompress::endDecompress(), grk::FileFormat::exec(), init_end_header_reading(), and grk::FileFormat::m_procedure_list.
|
private |
References header.
Referenced by readHeaderProcedureImpl().
|
static |
|
staticprivate |
References _grk_palette_data::channel_prec, _grk_palette_data::channel_sign, grk::FileFormat::color, _grk_palette_data::component_mapping, _grk_palette_data::lut, and grk_color::palette.
Referenced by alloc_palette(), applyColour(), and free_color().
|
virtual |
Implements grk::ICodeStreamDecompress.
References codeStream, and grk::CodeStreamDecompress::getImage().
|
virtual |
Implements grk::ICodeStreamDecompress.
References codeStream, and grk::CodeStreamDecompress::getImage().
|
private |
Finds the image execution function related to the given box id.
id | the id of the handler to fetch. |
References img_header.
Referenced by read_jp2h(), and readHeaderProcedureImpl().
|
private |
References grk::FileFormat::m_procedure_list, and readHeaderProcedureImpl().
Referenced by endDecompress().
|
virtual |
Set up decompressor function handler.
Implements grk::ICodeStreamDecompress.
References codeStream, grk::FileFormat::color, grk_color::has_colour_specification_box, and grk::CodeStreamDecompress::initDecompress().
|
private |
References grk::AsocBox::children, grk::GRK_ERROR(), JP2_ASOC, JP2_LBL, and JP2_XML.
Referenced by FileFormatDecompress(), and read_asoc().
|
private |
References grk::GRK_ERROR(), GRK_UNUSED, read_asoc(), and root_asoc.
|
private |
References grk::GRK_ERROR(), grk::FileFormatBox::length, and grk::FileFormatBox::type.
Referenced by read_jp2h().
|
private |
References grk::GRK_ERROR(), grk::FileFormatBox::length, grk::IBufferedStream::numBytesLeft(), grk::IBufferedStream::read(), and grk::FileFormatBox::type.
Referenced by readHeaderProcedureImpl().
|
private |
References grk::FileFormat::bpc, grk::FileFormat::comps, grk::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), and grk::FileFormat::numcomps.
Referenced by FileFormatDecompress().
|
private |
|
private |
References grk::FileFormat::approx, grk::FileFormat::color, grk::FileFormat::enumcs, 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_ERROR(), grk::GRK_WARN(), grk_color::has_colour_specification_box, grk_color::icc_profile_buf, grk_color::icc_profile_len, grk::FileFormat::meth, and grk::FileFormat::precedence.
Referenced by FileFormatDecompress().
|
private |
References grk::FileFormat::color, _grk_palette_data::component_mapping, grk::GRK_ERROR(), _grk_palette_data::num_channels, and grk_color::palette.
Referenced by FileFormatDecompress().
|
private |
Reads a a FTYP box - File type box.
headerData | the data contained in the FTYP box. |
header_size | the size of the data contained in the FTYP box. |
References grk::FileFormat::brand, grk::FileFormat::cl, grk::GRK_ERROR(), grk::grkCalloc(), jp2_state, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_SIGNATURE, grk::FileFormat::minversion, and grk::FileFormat::numcl.
Referenced by FileFormatDecompress().
|
private |
References grk::FileFormat::bpc, grk::FileFormat::C, grk::FileFormat::comps, GRK_ENUM_CLRSPC_CIE, grk::GRK_ERROR(), GRK_MAX_SUPPORTED_IMAGE_PRECISION, grk::GRK_WARN(), grk::FileFormat::h, grk::FileFormat::IPR, grk::maxNumComponentsJ2K, grk::FileFormat::numcomps, grk::FileFormat::UnkC, and grk::FileFormat::w.
Referenced by FileFormatDecompress().
|
private |
Reads a JPEG 2000 file signature box.
headerData | the data contained in the signature box. |
header_size | the size of the data contained in the signature box. |
References grk::GRK_ERROR(), jp2_state, grk::JP2_STATE_NONE, and grk::JP2_STATE_SIGNATURE.
Referenced by FileFormatDecompress().
|
private |
Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
headerData | the data contained in the file header box. |
header_size | the size of the data contained in the file header box. |
References grk::GRK_ERROR(), img_find_handler(), JP2_IHDR, jp2_state, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_HEADER, grk::FileFormatBox::length, read_box(), and grk::FileFormatBox::type.
Referenced by FileFormatDecompress().
|
private |
References alloc_palette(), grk::FileFormat::color, grk::GRK_ERROR(), GRK_MAX_SUPPORTED_IMAGE_PRECISION, and grk_color::palette.
Referenced by FileFormatDecompress().
|
private |
References calc_res(), grk::FileFormat::capture_resolution, grk::FileFormat::display_resolution, grk::GRK_ERROR(), GRK_RESOLUTION_BOX_SIZE, grk::FileFormat::has_capture_resolution, grk::FileFormat::has_display_resolution, JP2_CAPTURE_RES, JP2_DISPLAY_RES, and read_res_box().
Referenced by FileFormatDecompress().
|
private |
Referenced by read_res().
|
private |
References grk::GRK_WARN(), JP2_MAX_NUM_UUIDS, grk::FileFormat::numUuids, and grk::FileFormat::uuids.
Referenced by FileFormatDecompress().
|
private |
References grk::grkBuffer< T, A >::alloc(), grk::grkBuffer< T, A >::buf, grk::grkBuffer< T, A >::len, and grk::FileFormat::xml.
Referenced by FileFormatDecompress().
|
virtual |
Main header reading function handler.
Implements grk::ICodeStreamDecompress.
References _grk_header_info::asocs, grk::grkBuffer< T, A >::buf, grk::FileFormat::capture_resolution, check_color(), grk::AsocBox::children, codeStream, grk::FileFormat::color, grk::FileFormat::display_resolution, grk::FileFormat::enumcs, grk::FileFormat::exec(), grk::CodeStreamDecompress::getCompositeImage(), grk::CodeStreamDecompress::getHeaderImage(), GRK_CLRSPC_CMYK, GRK_CLRSPC_CUSTOM_CIE, GRK_CLRSPC_DEFAULT_CIE, GRK_CLRSPC_EYCC, GRK_CLRSPC_GRAY, GRK_CLRSPC_ICC, 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::GRK_ERROR(), grk::GRK_WARN(), grk::FileFormat::has_capture_resolution, grk::FileFormat::has_display_resolution, grk_color::icc_profile_buf, grk_color::icc_profile_len, grk::IPTC_UUID, grk::grkBuffer< T, A >::len, m_headerError, grk::FileFormat::m_procedure_list, grk::FileFormat::m_validation_list, grk::FileFormat::meth, _grk_header_info::num_asocs, grk::FileFormat::numUuids, grk::CodeStreamDecompress::readHeader(), readHeaderProcedureImpl(), root_asoc, serializeAsoc(), grk::FileFormat::uuids, grk::FileFormat::xml, _grk_header_info::xml_data, _grk_header_info::xml_data_len, and grk::XMP_UUID.
|
private |
References codeStream, find_handler(), grk::CodeStream::getStream(), GRK_BOX_SIZE, grk::GRK_ERROR(), GRK_UNUSED, grk::GRK_WARN(), grk::grkCalloc(), grk::grkFree(), grk::grkRealloc(), img_find_handler(), JP2_JP2C, jp2_state, grk::JP2_STATE_CODESTREAM, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_HEADER, grk::JP2_STATE_SIGNATURE, grk::JP2_STATE_UNKNOWN, grk::FileFormatBox::length, read_box_hdr(), and grk::FileFormatBox::type.
Referenced by init_end_header_reading(), and readHeader().
|
private |
References grk::grkBuffer< T, A >::buf, grk::AsocBox::children, GRK_NUM_ASOC_BOXES_SUPPORTED, grk::GRK_WARN(), grk::AsocBox::label, grk_asoc::label, and grk::grkBuffer< T, A >::len.
Referenced by readHeader().
|
virtual |
Implements grk::ICodeStreamDecompress.
References codeStream, and grk::CodeStreamDecompress::setDecompressWindow().
|
private |
|
private |
Referenced by FileFormatDecompress(), and find_handler().
|
private |
Referenced by FileFormatDecompress(), and img_find_handler().
|
private |
Referenced by read_ftyp(), read_jp(), read_jp2h(), and readHeaderProcedureImpl().
|
private |
Referenced by readHeader().
|
private |
Referenced by read_asoc(), and readHeader().