Grok 12.0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
grk::FileFormatDecompress Class Reference

#include <FileFormatDecompress.h>

Inheritance diagram for grk::FileFormatDecompress:
grk::FileFormat grk::ICodeStreamDecompress

Public Member Functions

 FileFormatDecompress (BufferedStream *stream)
 
virtual ~FileFormatDecompress ()
 
bool readHeader (grk_header_info *header_info)
 Main header reading function handler.
 
GrkImagegetImage (uint16_t tileIndex)
 
GrkImagegetImage (void)
 
void init (grk_decompress_core_params *p_param)
 Set up decompressor function handler.
 
bool setDecompressRegion (grk_rect_single region)
 
bool decompress (grk_plugin_tile *tile)
 
bool decompressTile (uint16_t tileIndex)
 
bool end (void)
 
bool postProcess (void)
 
bool preProcess (void)
 
void dump (uint32_t flag, FILE *outputFileStream)
 
- Public Member Functions inherited from grk::FileFormat
 FileFormat (void)
 
virtual ~FileFormat ()
 
- Public Member Functions inherited from grk::ICodeStreamDecompress
virtual ~ICodeStreamDecompress ()=default
 

Private Member Functions

grk_colorgetColour (void)
 
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, bool codeStreamBoxWasRead, BufferedStream *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)
 
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)
 
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.
 
bool read_jp (uint8_t *headerData, uint32_t header_size)
 Reads a JPEG 2000 file signature box.
 
bool read_ftyp (uint8_t *headerData, uint32_t header_size)
 Reads a a FTYP box - File type box.
 
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).
 
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)
 

Private Attributes

std::map< uint32_t, BOX_FUNCheader
 
std::map< uint32_t, BOX_FUNCimg_header
 
bool headerError_
 
AsocBox root_asoc
 
CodeStreamDecompresscodeStream
 
uint32_t jp2_state
 

Additional Inherited Members

- Protected Member Functions inherited from grk::FileFormat
bool exec (std::vector< PROCEDURE_FUNC > *procs)
 
- Protected Attributes inherited from grk::FileFormat
std::vector< PROCEDURE_FUNC > * validation_list_
 list of validation procedures
 
std::vector< PROCEDURE_FUNC > * procedure_list_
 list of execution procedures
 
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_tcl
 
ComponentInfocomps
 
bool has_capture_resolution
 
double capture_resolution [2]
 
bool has_display_resolution
 
double display_resolution [2]
 
grk_buf8 xml
 
UUIDBox uuids [JP2_MAX_NUM_UUIDS]
 
uint32_t numUuids
 

Constructor & Destructor Documentation

◆ FileFormatDecompress()

grk::FileFormatDecompress::FileFormatDecompress ( BufferedStream * stream)

◆ ~FileFormatDecompress()

grk::FileFormatDecompress::~FileFormatDecompress ( )
virtual

References codeStream.

Member Function Documentation

◆ calc_res()

double grk::FileFormatDecompress::calc_res ( uint16_t num,
uint16_t den,
uint8_t exponent )
private

References grk::grk_read().

Referenced by read_res().

◆ decompress()

bool grk::FileFormatDecompress::decompress ( grk_plugin_tile * tile)
virtual

◆ decompressTile()

bool grk::FileFormatDecompress::decompressTile ( uint16_t tileIndex)
virtual

◆ dump()

void grk::FileFormatDecompress::dump ( uint32_t flag,
FILE * outputFileStream )
virtual

◆ end()

bool grk::FileFormatDecompress::end ( void )

◆ find_handler()

const BOX_FUNC grk::FileFormatDecompress::find_handler ( uint32_t id)
private

References grk::grk_read(), and header.

Referenced by readHeaderProcedureImpl().

◆ getColour()

grk_color * grk::FileFormatDecompress::getColour ( void )
private

◆ getImage() [1/2]

GrkImage * grk::FileFormatDecompress::getImage ( uint16_t tileIndex)
virtual

◆ getImage() [2/2]

GrkImage * grk::FileFormatDecompress::getImage ( void )
virtual

◆ img_find_handler()

const BOX_FUNC grk::FileFormatDecompress::img_find_handler ( uint32_t id)
private

Finds the image execution function related to the given box id.

Parameters
idthe id of the handler to fetch.
Returns
the given handler or nullptr if it could not be found.

References grk::grk_read(), and img_header.

Referenced by read_jp2h(), and readHeaderProcedureImpl().

◆ init()

void grk::FileFormatDecompress::init ( grk_decompress_core_params * p_param)
virtual

Set up decompressor function handler.

Implements grk::ICodeStreamDecompress.

References codeStream, grk::grk_read(), and grk::CodeStreamDecompress::init().

◆ postProcess()

bool grk::FileFormatDecompress::postProcess ( void )
virtual

◆ preProcess()

bool grk::FileFormatDecompress::preProcess ( void )
virtual

◆ read_asoc() [1/2]

uint32_t grk::FileFormatDecompress::read_asoc ( AsocBox * parent,
uint8_t ** header_data,
uint32_t * header_data_size,
uint32_t asocSize )
private

◆ read_asoc() [2/2]

bool grk::FileFormatDecompress::read_asoc ( uint8_t * header_data,
uint32_t header_data_size )
private

◆ read_box()

bool grk::FileFormatDecompress::read_box ( FileFormatBox * box,
uint8_t * p_data,
uint32_t * p_number_bytes_read,
uint64_t p_box_max_size )
private

◆ read_box_hdr()

bool grk::FileFormatDecompress::read_box_hdr ( FileFormatBox * box,
uint32_t * p_number_bytes_read,
bool codeStreamBoxWasRead,
BufferedStream * stream )
private

◆ read_bpc()

bool grk::FileFormatDecompress::read_bpc ( uint8_t * p_bpc_header_data,
uint32_t bpc_header_size )
private

◆ read_channel_definition()

bool grk::FileFormatDecompress::read_channel_definition ( uint8_t * p_cdef_header_data,
uint32_t cdef_header_size )
private

◆ read_colr()

bool grk::FileFormatDecompress::read_colr ( uint8_t * p_colr_header_data,
uint32_t colr_header_size )
private

◆ read_component_mapping()

bool grk::FileFormatDecompress::read_component_mapping ( uint8_t * component_mapping_header_data,
uint32_t component_mapping_header_size )
private

◆ read_ftyp()

bool grk::FileFormatDecompress::read_ftyp ( uint8_t * headerData,
uint32_t header_size )
private

Reads a a FTYP box - File type box.

Parameters
headerDatathe data contained in the FTYP box.
header_sizethe size of the data contained in the FTYP box.
Returns
true if the FTYP box is valid.

References grk::FileFormat::brand, grk::FileFormat::cl, grk::Logger::error(), grk::grk_calloc(), grk::grk_read(), jp2_state, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_SIGNATURE, grk::Logger::logger_, grk::FileFormat::minversion, and grk::FileFormat::numcl.

Referenced by FileFormatDecompress().

◆ read_ihdr()

bool grk::FileFormatDecompress::read_ihdr ( uint8_t * p_image_header_data,
uint32_t image_header_size )
private

◆ read_jp()

bool grk::FileFormatDecompress::read_jp ( uint8_t * headerData,
uint32_t header_size )
private

Reads a JPEG 2000 file signature box.

Parameters
headerDatathe data contained in the signature box.
header_sizethe size of the data contained in the signature box.
Returns
true if the file signature box is valid.

References grk::Logger::error(), grk::grk_read(), jp2_state, grk::JP2_STATE_NONE, grk::JP2_STATE_SIGNATURE, and grk::Logger::logger_.

Referenced by FileFormatDecompress().

◆ read_jp2h()

bool grk::FileFormatDecompress::read_jp2h ( uint8_t * headerData,
uint32_t header_size )
private

Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).

Parameters
headerDatathe data contained in the file header box.
header_sizethe size of the data contained in the file header box.
Returns
true if the JP2 Header box was successfully recognized.

References grk::Logger::error(), grk::grk_read(), img_find_handler(), JP2_IHDR, jp2_state, grk::JP2_STATE_FILE_TYPE, grk::JP2_STATE_HEADER, grk::Logger::logger_, and read_box().

Referenced by FileFormatDecompress().

◆ read_palette_clr()

bool grk::FileFormatDecompress::read_palette_clr ( uint8_t * p_pclr_header_data,
uint32_t pclr_header_size )
private

◆ read_res()

bool grk::FileFormatDecompress::read_res ( uint8_t * p_resolution_data,
uint32_t resolution_size )
private

◆ read_res_box()

bool grk::FileFormatDecompress::read_res_box ( uint32_t * id,
uint32_t * num,
uint32_t * den,
uint32_t * exponent,
uint8_t ** p_resolution_data )
private

References grk::grk_read().

Referenced by read_res().

◆ read_uuid()

bool grk::FileFormatDecompress::read_uuid ( uint8_t * headerData,
uint32_t header_size )
private

◆ read_xml()

bool grk::FileFormatDecompress::read_xml ( uint8_t * p_xml_data,
uint32_t xml_size )
private

◆ readHeader()

bool grk::FileFormatDecompress::readHeader ( grk_header_info * header_info)
virtual

◆ readHeaderProcedureImpl()

bool grk::FileFormatDecompress::readHeaderProcedureImpl ( void )
private

◆ serializeAsoc()

void grk::FileFormatDecompress::serializeAsoc ( AsocBox * asoc,
grk_asoc * serial_asocs,
uint32_t * num_asocs,
uint32_t level )
private

◆ setDecompressRegion()

bool grk::FileFormatDecompress::setDecompressRegion ( grk_rect_single region)
virtual

Member Data Documentation

◆ codeStream

CodeStreamDecompress* grk::FileFormatDecompress::codeStream
private

◆ header

std::map<uint32_t, BOX_FUNC> grk::FileFormatDecompress::header
private

◆ headerError_

bool grk::FileFormatDecompress::headerError_
private

Referenced by readHeader().

◆ img_header

std::map<uint32_t, BOX_FUNC> grk::FileFormatDecompress::img_header
private

◆ jp2_state

uint32_t grk::FileFormatDecompress::jp2_state
private

◆ root_asoc

AsocBox grk::FileFormatDecompress::root_asoc
private

Referenced by read_asoc(), and readHeader().


The documentation for this class was generated from the following files: