Grok 20.3.2
grk::FileFormatMJ2Decompress Class Reference

#include <FileFormatMJ2Decompress.h>

Inheritance diagram for grk::FileFormatMJ2Decompress:
grk::IDecompressor grk::FileFormatMJ2 grk::FileFormatJP2Family

Classes

struct  SampleCodeStream

Public Member Functions

 FileFormatMJ2Decompress (IStream *stream)
 ~FileFormatMJ2Decompress () override
bool readHeader (grk_header_info *header_info) override
 Reads header.
GrkImagegetImage (uint16_t tile_index, bool wait) override
 Gets GrkImage for specified tile.
GrkImagegetImage (void) override
 Gets composite GrkImage for all tiles in decompress region.
void init (grk_decompress_parameters *param) override
 Initializes decompressor.
grk_progression_state getProgressionState (uint16_t tile_index) override
 Gets the grk_progression_state for a tile.
bool setProgressionState (grk_progression_state state) override
 Sets the grk_progression_state for a tile.
bool decompress (grk_plugin_tile *tile) override
 Decompresses image / image region.
bool decompressTile (uint16_t tile_index) override
 Decompresses a single tile.
void dump (uint32_t flag, FILE *outputFileStream) override
 Dumps image tags to file.
void wait (grk_wait_swath *swath) override
 Waits for asynchronous decompression to complete.
void setBandCallback (grk_io_band_callback callback, void *user_data) override
 Sets a band-completion callback for incremental writing.
uint32_t getNumSamples (void) override
bool decompressSample (uint32_t sampleIndex) override
GrkImagegetSampleImage (uint32_t sampleIndex) override
GrkImagegetSampleTileImage (uint32_t sampleIndex, uint16_t tileIndex) override
Public Member Functions inherited from grk::IDecompressor
virtual ~IDecompressor ()=default
 Destroys the IDecompressor object.
virtual void scheduleSwathCopy (const grk_wait_swath *swath, grk_swath_buffer *buf)
 Schedule Taskflow copy tasks for tiles in a completed swath.
virtual void waitSwathCopy ()
 Wait for all in-flight swath copy tasks to complete.
Public Member Functions inherited from grk::FileFormatMJ2
 FileFormatMJ2 (IStream *stream)
 ~FileFormatMJ2 () override
Public Member Functions inherited from grk::FileFormatJP2Family
 FileFormatJP2Family (IStream *stream)
virtual ~FileFormatJP2Family ()
 FileFormatJP2Family (const FileFormatJP2Family &)=delete
FileFormatJP2Familyoperator= (const FileFormatJP2Family &)=delete

Private Member Functions

bool decompressSampleInternal (uint32_t sampleIndex)
GrkImagegetHeaderImage (void) override
void read_version_and_flag (uint8_t **headerData, uint8_t &version, uint32_t &flag)
bool read_version_and_flag_check (uint8_t **headerData, uint32_t *headerSize, uint8_t maxVersion, std::set< uint32_t > allowedFlags)
bool read_mvhd (uint8_t *headerData, uint32_t headerSize)
bool read_tkhd (uint8_t *headerData, uint32_t headerSize)
bool read_mdhd (uint8_t *headerData, uint32_t headerSize)
bool read_mdat (uint8_t *headerData, uint32_t headerSize)
bool read_hdlr (uint8_t *headerData, uint32_t headerSize)
bool read_vmhd (uint8_t *headerData, uint32_t headerSize)
bool read_dref (uint8_t *headerData, uint32_t headerSize)
bool read_stsd (uint8_t *headerData, uint32_t headerSize)
bool read_stts (uint8_t *headerData, uint32_t headerSize)
bool read_stsc (uint8_t *headerData, uint32_t headerSize)
bool read_stsz (uint8_t *headerData, uint32_t headerSize)
bool read_stco (uint8_t *headerData, uint32_t headerSize)
bool read_smj2 (uint8_t *headerData, uint32_t headerSize)
bool read_fiel (uint8_t *headerData, uint32_t headerSize)
bool read_jp2p (uint8_t *headerData, uint32_t headerSize)
bool read_jp2x (uint8_t *headerData, uint32_t headerSize)
bool read_jsub (uint8_t *headerData, uint32_t headerSize)
bool read_orfo (uint8_t *headerData, uint32_t headerSize)
bool read_url (uint8_t *headerData, uint32_t headerSize)
bool read_urn (uint8_t *headerData, uint32_t headerSize)
void tts_decompact (mj2_tk *tk)
void stsc_decompact (mj2_tk *tk)
void stco_decompact (mj2_tk *tk)

Private Attributes

grk_decompress_parameters decompressParams_
bool decompressParamsSet_
std::vector< GrkImage * > decompressedImages_
std::vector< SampleCodeStreamsampleCodeStreams_

Additional Inherited Members

Protected Member Functions inherited from grk::FileFormatJP2Family
void init (grk_decompress_parameters *param)
bool readHeaderProcedure ()
bool readHeader (grk_header_info *header_info, GrkImage *headerImage)
grk_colorgetColour (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 inherited from grk::FileFormatMJ2
GrkImageheaderImage_
uint32_t creation_time_
uint32_t modification_time_
int32_t timescale_
uint32_t duration_
int32_t rate_
int32_t num_vtk_
int32_t num_stk_
int32_t num_htk_
int16_t volume_
int32_t trans_matrix_ [9]
int32_t next_tk_id_
std::unordered_map< int32_t, mj2_tk * > tracks_
mj2_tkcurrent_track_
Protected Attributes inherited from grk::FileFormatJP2Family
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
ComponentInfocomps
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_FUNCheader
AsocBox root_asoc
uint32_t jp2_state
bool headerError_
bool headerRead_
std::stack< BoxsuperBoxes_
std::unordered_map< uint32_t, BOX_FUNCimg_header
IStreamstream_

Constructor & Destructor Documentation

◆ FileFormatMJ2Decompress()

◆ ~FileFormatMJ2Decompress()

grk::FileFormatMJ2Decompress::~FileFormatMJ2Decompress ( )
override

Member Function Documentation

◆ decompress()

bool grk::FileFormatMJ2Decompress::decompress ( grk_plugin_tile * tile)
overridevirtual

Decompresses image / image region.

Parameters
tilegrk_plugin_tile
Returns
true if successful

Implements grk::IDecompressor.

References grk::FileFormatMJ2::current_track_, decompress(), decompressedImages_, decompressSampleInternal(), grk::grk_unref(), grk::grklog, and grk::FileFormatMJ2::headerImage_.

Referenced by decompress().

◆ decompressSample()

bool grk::FileFormatMJ2Decompress::decompressSample ( uint32_t sampleIndex)
overridevirtual

◆ decompressSampleInternal()

◆ decompressTile()

bool grk::FileFormatMJ2Decompress::decompressTile ( uint16_t tile_index)
overridevirtual

Decompresses a single tile.

Parameters
tile_indextile index
Returns
true if successful

Implements grk::IDecompressor.

References grk::FileFormatMJ2::current_track_, decompressSample(), decompressTile(), and grk::grklog.

Referenced by decompressTile().

◆ dump()

void grk::FileFormatMJ2Decompress::dump ( uint32_t flag,
FILE * outputFileStream )
overridevirtual

Dumps image tags to file.

Parameters
flagflag indicating main header, tile header etc.
outputFileStreamFILE stream

Implements grk::IDecompressor.

References dump().

Referenced by dump().

◆ getHeaderImage()

GrkImage * grk::FileFormatMJ2Decompress::getHeaderImage ( void )
overrideprivatevirtual

Reimplemented from grk::FileFormatMJ2.

References getHeaderImage(), and grk::FileFormatMJ2::headerImage_.

Referenced by getHeaderImage().

◆ getImage() [1/2]

GrkImage * grk::FileFormatMJ2Decompress::getImage ( uint16_t tile_index,
bool wait )
overridevirtual

Gets GrkImage for specified tile.

Parameters
tile_indextile index
Returns
GrkImage

Implements grk::IDecompressor.

References decompressedImages_, getImage(), grk::FileFormatMJ2::headerImage_, and wait().

Referenced by getImage(), and getImage().

◆ getImage() [2/2]

GrkImage * grk::FileFormatMJ2Decompress::getImage ( void )
overridevirtual

Gets composite GrkImage for all tiles in decompress region.

Returns
GrkImage

Implements grk::IDecompressor.

References decompressedImages_, getImage(), and grk::FileFormatMJ2::headerImage_.

◆ getNumSamples()

uint32_t grk::FileFormatMJ2Decompress::getNumSamples ( void )
overridevirtual

Reimplemented from grk::IDecompressor.

References grk::FileFormatMJ2::current_track_, and getNumSamples().

Referenced by getNumSamples().

◆ getProgressionState()

grk_progression_state grk::FileFormatMJ2Decompress::getProgressionState ( uint16_t tile_index)
overridevirtual

Gets the grk_progression_state for a tile.

Parameters
tile_index
Returns
grk_progression_state

Implements grk::IDecompressor.

References getProgressionState().

Referenced by getProgressionState().

◆ getSampleImage()

GrkImage * grk::FileFormatMJ2Decompress::getSampleImage ( uint32_t sampleIndex)
overridevirtual

◆ getSampleTileImage()

GrkImage * grk::FileFormatMJ2Decompress::getSampleTileImage ( uint32_t sampleIndex,
uint16_t tileIndex )
overridevirtual

Reimplemented from grk::IDecompressor.

References getSampleTileImage(), and sampleCodeStreams_.

Referenced by getSampleTileImage().

◆ init()

void grk::FileFormatMJ2Decompress::init ( grk_decompress_parameters * param)
overridevirtual

Initializes decompressor.

Parameters

ref grk_decompress_parameters

Implements grk::IDecompressor.

References decompressParams_, decompressParamsSet_, grk::FileFormatJP2Family::init(), and init().

Referenced by init().

◆ read_dref()

bool grk::FileFormatMJ2Decompress::read_dref ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_fiel()

bool grk::FileFormatMJ2Decompress::read_fiel ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_hdlr()

bool grk::FileFormatMJ2Decompress::read_hdlr ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_jp2p()

bool grk::FileFormatMJ2Decompress::read_jp2p ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_jp2x()

bool grk::FileFormatMJ2Decompress::read_jp2x ( uint8_t * headerData,
uint32_t headerSize )
private

References read_jp2x().

Referenced by read_jp2x().

◆ read_jsub()

bool grk::FileFormatMJ2Decompress::read_jsub ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_mdat()

bool grk::FileFormatMJ2Decompress::read_mdat ( uint8_t * headerData,
uint32_t headerSize )
private

References read_mdat().

Referenced by FileFormatMJ2Decompress(), and read_mdat().

◆ read_mdhd()

bool grk::FileFormatMJ2Decompress::read_mdhd ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_mvhd()

◆ read_orfo()

bool grk::FileFormatMJ2Decompress::read_orfo ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_smj2()

◆ read_stco()

bool grk::FileFormatMJ2Decompress::read_stco ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_stsc()

◆ read_stsd()

◆ read_stsz()

bool grk::FileFormatMJ2Decompress::read_stsz ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_stts()

bool grk::FileFormatMJ2Decompress::read_stts ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_tkhd()

bool grk::FileFormatMJ2Decompress::read_tkhd ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_url()

bool grk::FileFormatMJ2Decompress::read_url ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_urn()

bool grk::FileFormatMJ2Decompress::read_urn ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_version_and_flag()

void grk::FileFormatMJ2Decompress::read_version_and_flag ( uint8_t ** headerData,
uint8_t & version,
uint32_t & flag )
private

◆ read_version_and_flag_check()

bool grk::FileFormatMJ2Decompress::read_version_and_flag_check ( uint8_t ** headerData,
uint32_t * headerSize,
uint8_t maxVersion,
std::set< uint32_t > allowedFlags )
private

◆ read_vmhd()

bool grk::FileFormatMJ2Decompress::read_vmhd ( uint8_t * headerData,
uint32_t headerSize )
private

◆ readHeader()

bool grk::FileFormatMJ2Decompress::readHeader ( grk_header_info * header_info)
overridevirtual

◆ setBandCallback()

void grk::FileFormatMJ2Decompress::setBandCallback ( grk_io_band_callback callback,
void * user_data )
overridevirtual

Sets a band-completion callback for incremental writing.

Must be called after readHeader() but before decompress().

Reimplemented from grk::IDecompressor.

References sampleCodeStreams_, and setBandCallback().

Referenced by setBandCallback().

◆ setProgressionState()

bool grk::FileFormatMJ2Decompress::setProgressionState ( grk_progression_state state)
overridevirtual

Sets the grk_progression_state for a tile.

Parameters
stategrk_progression_state
Returns
true if successful

Implements grk::IDecompressor.

References setProgressionState().

Referenced by setProgressionState().

◆ stco_decompact()

void grk::FileFormatMJ2Decompress::stco_decompact ( mj2_tk * tk)
private

◆ stsc_decompact()

void grk::FileFormatMJ2Decompress::stsc_decompact ( mj2_tk * tk)
private

◆ tts_decompact()

void grk::FileFormatMJ2Decompress::tts_decompact ( mj2_tk * tk)
private

◆ wait()

void grk::FileFormatMJ2Decompress::wait ( grk_wait_swath * swath)
overridevirtual

Waits for asynchronous decompression to complete.

Implements grk::IDecompressor.

References wait().

Referenced by getImage(), and wait().

Member Data Documentation

◆ decompressedImages_

std::vector<GrkImage*> grk::FileFormatMJ2Decompress::decompressedImages_
private

◆ decompressParams_

grk_decompress_parameters grk::FileFormatMJ2Decompress::decompressParams_
private

◆ decompressParamsSet_

bool grk::FileFormatMJ2Decompress::decompressParamsSet_
private

◆ sampleCodeStreams_

std::vector<SampleCodeStream> grk::FileFormatMJ2Decompress::sampleCodeStreams_
private

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