Grok 20.3.2
grk::FileFormatJP2Decompress Class Referencefinal

#include <FileFormatJP2Decompress.h>

Inheritance diagram for grk::FileFormatJP2Decompress:
grk::FileFormatJP2Family grk::IDecompressor

Public Member Functions

 FileFormatJP2Decompress (IStream *stream)
 ~FileFormatJP2Decompress ()
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
 Set up decompressor function handler.
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.
bool end (void)
bool postProcess (GrkImage *img)
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 scheduleSwathCopy (const grk_wait_swath *swath, grk_swath_buffer *buf) override
 Schedule Taskflow copy tasks for tiles in a completed swath.
void waitSwathCopy () override
 Wait for all in-flight swath copy tasks to complete.
void setBandCallback (grk_io_band_callback callback, void *user_data) override
 Sets a band-completion callback for incremental writing.
CodingParamsgetCodingParams (void)
Public Member Functions inherited from grk::FileFormatJP2Family
 FileFormatJP2Family (IStream *stream)
virtual ~FileFormatJP2Family ()
 FileFormatJP2Family (const FileFormatJP2Family &)=delete
FileFormatJP2Familyoperator= (const FileFormatJP2Family &)=delete
Public Member Functions inherited from grk::IDecompressor
virtual ~IDecompressor ()=default
 Destroys the IDecompressor object.
virtual uint32_t getNumSamples (void)
virtual bool decompressSample (uint32_t sampleIndex)
virtual GrkImagegetSampleImage (uint32_t sampleIndex)
virtual GrkImagegetSampleTileImage (uint32_t sampleIndex, uint16_t tileIndex)

Protected Attributes

CodeStreamDecompresscodeStream
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_

Private Member Functions

GrkImagegetHeaderImage (void) override
bool read_xml (uint8_t *p_xml_data, uint32_t xml_size)
bool read_uuid (uint8_t *headerData, uint32_t headerSize)
bool read_ipr (uint8_t *headerData, uint32_t headerSize)

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)

Constructor & Destructor Documentation

◆ FileFormatJP2Decompress()

◆ ~FileFormatJP2Decompress()

grk::FileFormatJP2Decompress::~FileFormatJP2Decompress ( )

References codeStream.

Member Function Documentation

◆ decompress()

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

Decompresses image / image region.

Parameters
tilegrk_plugin_tile
Returns
true if successful

Implements grk::IDecompressor.

References codeStream, and grk::grklog.

◆ decompressTile()

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

Decompresses a single tile.

Parameters
tile_indextile index
Returns
true if successful

Implements grk::IDecompressor.

References codeStream.

◆ dump()

void grk::FileFormatJP2Decompress::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 codeStream.

◆ end()

bool grk::FileFormatJP2Decompress::end ( void )

◆ getCodingParams()

CodingParams * grk::FileFormatJP2Decompress::getCodingParams ( void )

◆ getHeaderImage()

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

Implements grk::FileFormatJP2Family.

References codeStream.

Referenced by readHeader().

◆ getImage() [1/2]

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

Gets GrkImage for specified tile.

Parameters
tile_indextile index
Returns
GrkImage

Implements grk::IDecompressor.

References codeStream, and wait().

◆ getImage() [2/2]

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

Gets composite GrkImage for all tiles in decompress region.

Returns
GrkImage

Implements grk::IDecompressor.

References codeStream.

◆ getProgressionState()

grk_progression_state grk::FileFormatJP2Decompress::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 codeStream.

◆ init()

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

Set up decompressor function handler.

Implements grk::IDecompressor.

References codeStream, and grk::FileFormatJP2Family::init().

◆ postProcess()

bool grk::FileFormatJP2Decompress::postProcess ( GrkImage * img)

◆ read_ipr()

bool grk::FileFormatJP2Decompress::read_ipr ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_uuid()

bool grk::FileFormatJP2Decompress::read_uuid ( uint8_t * headerData,
uint32_t headerSize )
private

◆ read_xml()

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

◆ readHeader()

◆ scheduleSwathCopy()

void grk::FileFormatJP2Decompress::scheduleSwathCopy ( const grk_wait_swath * swath,
grk_swath_buffer * buf )
overridevirtual

Schedule Taskflow copy tasks for tiles in a completed swath.

For each tile in swath, submits a Taskflow task to the shared executor that converts the int32_t planar tile data into buf via Highway SIMD. Tiles that are still in-flight (decompressed ahead of the current swath) have their copy deferred via a Taskflow continuation.

Reimplemented from grk::IDecompressor.

References codeStream.

◆ setBandCallback()

void grk::FileFormatJP2Decompress::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 codeStream.

◆ setProgressionState()

bool grk::FileFormatJP2Decompress::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 codeStream.

◆ wait()

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

Waits for asynchronous decompression to complete.

Implements grk::IDecompressor.

References codeStream.

Referenced by getImage().

◆ waitSwathCopy()

void grk::FileFormatJP2Decompress::waitSwathCopy ( )
overridevirtual

Wait for all in-flight swath copy tasks to complete.

Reimplemented from grk::IDecompressor.

References codeStream.

Member Data Documentation

◆ codeStream


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