Grok 20.3.2
grk::ITileProcessor Struct Referenceabstract

Interface for managing tile compression/decompression. More...

#include <ITileProcessor.h>

Inheritance diagram for grk::ITileProcessor:
grk::ITileProcessorCompress grk::TileProcessor grk::TileProcessorCompress grk::TileProcessorCompress

Public Member Functions

virtual ~ITileProcessor ()=default
 Destroys the TileProcessor.
virtual void setProcessors (MarkerParser *parser)=0
 Sets the marker parser for processing.
virtual bool init (void)=0
 Initializes the TileProcessor.
virtual void setStream (IStream *stream, bool ownsStream)=0
 Sets the stream for input/output operations.
virtual bool decompressWithTLM (const std::shared_ptr< TPFetchSeq > &tilePartFetchSeq, CoderPool *streamPool, Rect32 unreducedImageBounds, std::function< void()> post, TileFutureManager &futures)=0
 Decompresses the tile using Tile Length Markers (TLM).
virtual bool decompressPrepareWithTLM (const std::shared_ptr< TPFetchSeq > &tilePartFetchSeq)=0
 Prepares for decompression using Tile Length Markers (TLM).
virtual bool doPostT1 (void)=0
 Performs post-T1 processing.
virtual void prepareForDecompression (void)=0
 Prepares the processor for decompression.
virtual bool parseTilePart (std::vector< std::unique_ptr< MarkerParser > > *parsers, IStream *bifurcatedStream, uint16_t mainMarkerId, TilePartInfo tilePartInfo)=0
 Parses a tile part.
virtual bool decompressFromCachedTileParts ()=0
 Parse tile-part packets using cached SOT offsets from tilePartSeq_, without re-reading SOT markers.
virtual bool readSOT (IStream *stream, uint8_t *headerData, uint16_t headerSize, TilePartInfo &tilePartInfo, bool needToReadIndexAndLength)=0
 Reads the Start of Tile (SOT) marker.
virtual void scheduleAndRunDecompress (CoderPool *coderPool, Rect32 unreducedImageBounds, std::function< void()> post, TileFutureManager &futures)=0
 Schedules T2/T1 decompression tasks.
virtual void post_decompressT2T1 (GrkImage *scratch)=0
 Performs post-T2+T1 decompression processing.
virtual bool differentialUpdate (Rect32 unreducedImageBounds)=0
 Updates the differential decompression state.
virtual GrkImagegetImage (void)=0
 Gets the associated GrkImage for the tile.
virtual void setImage (GrkImage *img)=0
 Sets the associated GrkImage for the tile.
virtual Rect32 getUnreducedTileWindow (void)=0
 Gets the unreduced tile window.
virtual TileCodingParamsgetTCP (void)=0
 Gets the Tile Coding Parameters (TCP).
virtual uint8_t getMaxNumDecompressResolutions (void)=0
 Gets the maximum number of decompress resolutions.
virtual IStreamgetStream (void)=0
 Gets the associated stream.
virtual uint16_t getIndex (void) const =0
 Gets the tile index.
virtual void incrementIndex (void)=0
 Increments the tile index.
virtual TilegetTile (void)=0
 Gets the associated Tile.
virtual grk_progression_state getProgressionState ()=0
 Gets the progression state.
virtual CodecSchedulergetScheduler (void)=0
 Gets the codec scheduler.
virtual bool isCompressor (void)=0
 Checks if the processor is in compressor mode.
virtual uint64_t getNumProcessedPackets (void)=0
 Gets the number of processed packets.
virtual void incNumProcessedPackets (void)=0
 Increments the number of processed packets by 1.
virtual void incNumProcessedPackets (uint64_t numPackets)=0
 Increments the number of processed packets by a specified amount.
virtual void incNumReadDataPackets (void)=0
 Increments the number of read data packets by 1.
virtual uint32_t getTileCacheStrategy (void)=0
 Gets the tile cache strategy.
virtual grk_plugin_tilegetCurrentPluginTile (void) const =0
 Gets the current plugin tile.
virtual void setCurrentPluginTile (grk_plugin_tile *tile)=0
 Sets the current plugin tile.
virtual CodingParamsgetCodingParams (void)=0
 Gets the coding parameters.
virtual GrkImagegetHeaderImage (void)=0
 Gets the header image.
virtual std::shared_ptr< PacketLengthCache< uint32_t > > getPacketLengthCache (void)=0
 Gets the packet length cache.
virtual bool needsMctDecompress (uint16_t compno)=0
 Checks if MCT decompression is needed for a specific component.
virtual bool needsMctDecompress (void)=0
 Checks if MCT decompression is needed overall.
virtual bool shouldDecodeComponent (uint16_t compno)=0
 Check if a component should be decoded based on user selection.
virtual MctgetMCT (void)=0
 Gets the MCT (Multi-Component Transform) object.
virtual void release (void)=0
 Releases all resources (image and tile).
virtual void release (uint32_t strategy)=0
 Releases select resources based on strategy.
virtual void releaseForSwath ()=0
 Unconditionally releases both image and tile data (swath consumer path).
virtual bool readPLT (uint8_t *headerData, uint16_t headerSize)=0
 Reads a PLT marker (Packet length, tile-part header).
virtual bool allSOTMarkersParsed ()=0
 Checks if all SOT markers for the tile are parsed.
virtual bool hasUnparsedTileParts ()=0
 True when we know for certain that tile parts are missing.
virtual void resetSOTParsing ()=0
 Reset SOT parsing state so the tile can be re-parsed from the codestream.
virtual void setTruncated (void)=0
 Sets the processor to truncated state if not all tile parts are parsed.
virtual bool hasError (void)=0
 Checks if an error has occurred.
virtual bool isInitialized (void)=0
 Checks if the processor is initialized.
virtual bool isBestEffortDecompressed (void)=0
 Check if tile was decompressed on a best-effort basis (may have been truncated or errored).
virtual void setBestEffortDecompressed (void)=0
virtual bool scheduledForDecompression (void)=0
virtual bool reinitForReDecompress (void)=0
 Reinitialize for re-decompression after LRU eviction.
virtual bool isStripOutputWritten () const =0
 Check if strip-mode output was written directly (bypass multi-tile band callback).

Detailed Description

Interface for managing tile compression/decompression.

Constructor & Destructor Documentation

◆ ~ITileProcessor()

virtual grk::ITileProcessor::~ITileProcessor ( )
virtualdefault

Destroys the TileProcessor.

Member Function Documentation

◆ allSOTMarkersParsed()

virtual bool grk::ITileProcessor::allSOTMarkersParsed ( )
pure virtual

Checks if all SOT markers for the tile are parsed.

Returns
true if all parsed (or tile is truncated), false otherwise

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::decompressTileImpl().

◆ decompressFromCachedTileParts()

virtual bool grk::ITileProcessor::decompressFromCachedTileParts ( )
pure virtual

Parse tile-part packets using cached SOT offsets from tilePartSeq_, without re-reading SOT markers.

Returns
true if successful

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::decompressTileImpl().

◆ decompressPrepareWithTLM()

virtual bool grk::ITileProcessor::decompressPrepareWithTLM ( const std::shared_ptr< TPFetchSeq > & tilePartFetchSeq)
pure virtual

Prepares for decompression using Tile Length Markers (TLM).

Parameters
tilePartFetchSeqSequence for fetching tile parts
Returns
true if preparation succeeds, false otherwise

Implemented in grk::TileProcessor.

◆ decompressWithTLM()

virtual bool grk::ITileProcessor::decompressWithTLM ( const std::shared_ptr< TPFetchSeq > & tilePartFetchSeq,
CoderPool * streamPool,
Rect32 unreducedImageBounds,
std::function< void()> post,
TileFutureManager & futures )
pure virtual

Decompresses the tile using Tile Length Markers (TLM).

Parameters
tilePartFetchSeqSequence for fetching tile parts
streamPoolPool of coders for streaming
unreducedImageBoundsBounds of the unreduced image
postPost-decompression callback function
futuresManager for tile futures
Returns
true if decompression succeeds, false otherwise

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::decompressTileImpl(), and grk::CodeStreamDecompress::genDecompressTileTLMTask().

◆ differentialUpdate()

virtual bool grk::ITileProcessor::differentialUpdate ( Rect32 unreducedImageBounds)
pure virtual

Updates the differential decompression state.

Parameters
unreducedImageBoundsBounds of the unreduced image
Returns
true if update succeeds, false otherwise

Implemented in grk::TileProcessor.

◆ doPostT1()

virtual bool grk::ITileProcessor::doPostT1 ( void )
pure virtual

Performs post-T1 processing.

Returns
true if post-processing succeeds, false otherwise

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().

◆ getCodingParams()

virtual CodingParams * grk::ITileProcessor::getCodingParams ( void )
pure virtual

Gets the coding parameters.

Returns
Pointer to CodingParams

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().

◆ getCurrentPluginTile()

virtual grk_plugin_tile * grk::ITileProcessor::getCurrentPluginTile ( void ) const
pure virtual

Gets the current plugin tile.

Returns
Pointer to the current grk_plugin_tile

Implemented in grk::TileProcessor.

Referenced by grk::compress_synch_with_plugin().

◆ getHeaderImage()

virtual GrkImage * grk::ITileProcessor::getHeaderImage ( void )
pure virtual

Gets the header image.

Returns
Pointer to GrkImage

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().

◆ getImage()

virtual GrkImage * grk::ITileProcessor::getImage ( void )
pure virtual

Gets the associated GrkImage for the tile.

Returns
Pointer to the GrkImage

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::postMultiTile().

◆ getIndex()

◆ getMaxNumDecompressResolutions()

virtual uint8_t grk::ITileProcessor::getMaxNumDecompressResolutions ( void )
pure virtual

Gets the maximum number of decompress resolutions.

Returns
Maximum number of resolutions

Implemented in grk::TileProcessor.

◆ getMCT()

virtual Mct * grk::ITileProcessor::getMCT ( void )
pure virtual

Gets the MCT (Multi-Component Transform) object.

Returns
Pointer to Mct

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().

◆ getNumProcessedPackets()

virtual uint64_t grk::ITileProcessor::getNumProcessedPackets ( void )
pure virtual

Gets the number of processed packets.

Returns
Number of processed packets

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::decompressTileImpl().

◆ getPacketLengthCache()

virtual std::shared_ptr< PacketLengthCache< uint32_t > > grk::ITileProcessor::getPacketLengthCache ( void )
pure virtual

Gets the packet length cache.

Returns
Shared pointer to PacketLengthCache<uint32_t>

Implemented in grk::TileProcessor.

◆ getProgressionState()

virtual grk_progression_state grk::ITileProcessor::getProgressionState ( )
pure virtual

Gets the progression state.

Returns
The progression state

Implemented in grk::TileProcessor.

◆ getScheduler()

virtual CodecScheduler * grk::ITileProcessor::getScheduler ( void )
pure virtual

Gets the codec scheduler.

Returns
Pointer to CodecScheduler

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().

◆ getStream()

virtual IStream * grk::ITileProcessor::getStream ( void )
pure virtual

Gets the associated stream.

Returns
Pointer to IStream

Implemented in grk::TileProcessor.

Referenced by grk::SOTMarker::write().

◆ getTCP()

virtual TileCodingParams * grk::ITileProcessor::getTCP ( void )
pure virtual

◆ getTile()

virtual Tile * grk::ITileProcessor::getTile ( void )
pure virtual

Gets the associated Tile.

Returns
Pointer to Tile

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1(), and grk::DecompressSchedulerExcalibur::scheduleT1().

◆ getTileCacheStrategy()

virtual uint32_t grk::ITileProcessor::getTileCacheStrategy ( void )
pure virtual

Gets the tile cache strategy.

Returns
The tile cache strategy value

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1(), and grk::DecompressSchedulerExcalibur::scheduleT1().

◆ getUnreducedTileWindow()

virtual Rect32 grk::ITileProcessor::getUnreducedTileWindow ( void )
pure virtual

Gets the unreduced tile window.

Returns
Rect32 representing the unreduced tile window

Implemented in grk::TileProcessor.

◆ hasError()

virtual bool grk::ITileProcessor::hasError ( void )
pure virtual

Checks if an error has occurred.

Returns
true if error, false otherwise

Implemented in grk::TileProcessor.

◆ hasUnparsedTileParts()

virtual bool grk::ITileProcessor::hasUnparsedTileParts ( )
pure virtual

True when we know for certain that tile parts are missing.

Returns true only when the SOT marker explicitly signalled a tile-part count (TNsot > 0) and fewer parts have been parsed so far. When TNsot is 0 (unspecified), we cannot tell whether parts are missing, so this returns false— callers should not assume the tile is incomplete.

Implemented in grk::TileProcessor.

◆ incNumProcessedPackets() [1/2]

virtual void grk::ITileProcessor::incNumProcessedPackets ( uint64_t numPackets)
pure virtual

Increments the number of processed packets by a specified amount.

Parameters
numPacketsNumber of packets to add

Implemented in grk::TileProcessor.

◆ incNumProcessedPackets() [2/2]

virtual void grk::ITileProcessor::incNumProcessedPackets ( void )
pure virtual

Increments the number of processed packets by 1.

Implemented in grk::TileProcessor.

◆ incNumReadDataPackets()

virtual void grk::ITileProcessor::incNumReadDataPackets ( void )
pure virtual

Increments the number of read data packets by 1.

Implemented in grk::TileProcessor.

◆ incrementIndex()

virtual void grk::ITileProcessor::incrementIndex ( void )
pure virtual

Increments the tile index.

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamCompress::writeTileParts().

◆ init()

virtual bool grk::ITileProcessor::init ( void )
pure virtual

Initializes the TileProcessor.

Returns
true if initialization succeeds, false otherwise

Implemented in grk::TileProcessor, and grk::TileProcessorCompress.

◆ isBestEffortDecompressed()

virtual bool grk::ITileProcessor::isBestEffortDecompressed ( void )
pure virtual

Check if tile was decompressed on a best-effort basis (may have been truncated or errored).

Such tiles should not be re-decompressed on codec reuse.

Implemented in grk::TileProcessor.

◆ isCompressor()

virtual bool grk::ITileProcessor::isCompressor ( void )
pure virtual

Checks if the processor is in compressor mode.

Returns
true if compressor, false otherwise

Implemented in grk::TileProcessor.

◆ isInitialized()

virtual bool grk::ITileProcessor::isInitialized ( void )
pure virtual

Checks if the processor is initialized.

Returns
true if initialized, false otherwise

Implemented in grk::TileProcessor.

◆ isStripOutputWritten()

virtual bool grk::ITileProcessor::isStripOutputWritten ( ) const
pure virtual

Check if strip-mode output was written directly (bypass multi-tile band callback).

Implemented in grk::TileProcessor.

◆ needsMctDecompress() [1/2]

virtual bool grk::ITileProcessor::needsMctDecompress ( uint16_t compno)
pure virtual

Checks if MCT decompression is needed for a specific component.

Parameters
compnoComponent number
Returns
true if needed, false otherwise

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().

◆ needsMctDecompress() [2/2]

virtual bool grk::ITileProcessor::needsMctDecompress ( void )
pure virtual

Checks if MCT decompression is needed overall.

Returns
true if needed, false otherwise

Implemented in grk::TileProcessor.

◆ parseTilePart()

virtual bool grk::ITileProcessor::parseTilePart ( std::vector< std::unique_ptr< MarkerParser > > * parsers,
IStream * bifurcatedStream,
uint16_t mainMarkerId,
TilePartInfo tilePartInfo )
pure virtual

Parses a tile part.

Parameters
parsersVector of unique marker parsers
bifurcatedStreamBifurcated stream for reading
mainMarkerIdID of the main marker
tilePartInfoInformation about the tile part
Returns
true if parsing succeeds, false otherwise

Implemented in grk::TileProcessor.

◆ post_decompressT2T1()

virtual void grk::ITileProcessor::post_decompressT2T1 ( GrkImage * scratch)
pure virtual

Performs post-T2+T1 decompression processing.

Parameters
scratchScratch image for processing

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::postMultiTile(), and grk::CodeStreamDecompress::postSingleTile().

◆ prepareForDecompression()

virtual void grk::ITileProcessor::prepareForDecompression ( void )
pure virtual

Prepares the processor for decompression.

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::sequentialParseAndSchedule().

◆ readPLT()

virtual bool grk::ITileProcessor::readPLT ( uint8_t * headerData,
uint16_t headerSize )
pure virtual

Reads a PLT marker (Packet length, tile-part header).

Parameters
headerDataHeader data buffer
headerSizeSize of the header data
Returns
true if reading succeeds, false otherwise

Implemented in grk::TileProcessor.

◆ readSOT()

virtual bool grk::ITileProcessor::readSOT ( IStream * stream,
uint8_t * headerData,
uint16_t headerSize,
TilePartInfo & tilePartInfo,
bool needToReadIndexAndLength )
pure virtual

Reads the Start of Tile (SOT) marker.

Parameters
streamInput stream
headerDataHeader data buffer
headerSizeSize of the header data
tilePartInfoReference to tile part information (updated on success)
needToReadIndexAndLengthTrue if index and length need to be read
Returns
true if reading succeeds, false otherwise

Implemented in grk::TileProcessor.

◆ reinitForReDecompress()

virtual bool grk::ITileProcessor::reinitForReDecompress ( void )
pure virtual

Reinitialize for re-decompression after LRU eviction.

Recreates the Tile structure and re-runs init() so that the T2+T1 pipeline can be re-executed from cached packet data.

Returns
true if successful

Implemented in grk::TileProcessor.

◆ release() [1/2]

virtual void grk::ITileProcessor::release ( uint32_t strategy)
pure virtual

Releases select resources based on strategy.

Parameters
strategyTile cache strategy

Implemented in grk::TileProcessor.

◆ release() [2/2]

virtual void grk::ITileProcessor::release ( void )
pure virtual

Releases all resources (image and tile).

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::postMultiTile().

◆ releaseForSwath()

virtual void grk::ITileProcessor::releaseForSwath ( )
pure virtual

Unconditionally releases both image and tile data (swath consumer path).

Implemented in grk::TileProcessor.

◆ resetSOTParsing()

virtual void grk::ITileProcessor::resetSOTParsing ( )
pure virtual

Reset SOT parsing state so the tile can be re-parsed from the codestream.

Implemented in grk::TileProcessor.

◆ scheduleAndRunDecompress()

virtual void grk::ITileProcessor::scheduleAndRunDecompress ( CoderPool * coderPool,
Rect32 unreducedImageBounds,
std::function< void()> post,
TileFutureManager & futures )
pure virtual

Schedules T2/T1 decompression tasks.

Parameters
coderPoolPool of coders
unreducedImageBoundsBounds of the unreduced image
postPost-scheduling callback function
futuresManager for tile futures

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::schedule().

◆ scheduledForDecompression()

virtual bool grk::ITileProcessor::scheduledForDecompression ( void )
pure virtual

Implemented in grk::TileProcessor.

◆ setBestEffortDecompressed()

virtual void grk::ITileProcessor::setBestEffortDecompressed ( void )
pure virtual

◆ setCurrentPluginTile()

virtual void grk::ITileProcessor::setCurrentPluginTile ( grk_plugin_tile * tile)
pure virtual

Sets the current plugin tile.

Parameters
tilePointer to the grk_plugin_tile to set

Implemented in grk::TileProcessor.

◆ setImage()

virtual void grk::ITileProcessor::setImage ( GrkImage * img)
pure virtual

Sets the associated GrkImage for the tile.

Parameters
imgPointer to the GrkImage to set

Implemented in grk::TileProcessor.

Referenced by grk::CodeStreamDecompress::postSingleTile().

◆ setProcessors()

virtual void grk::ITileProcessor::setProcessors ( MarkerParser * parser)
pure virtual

Sets the marker parser for processing.

Parameters
parserThe marker parser to set

Implemented in grk::TileProcessor.

◆ setStream()

virtual void grk::ITileProcessor::setStream ( IStream * stream,
bool ownsStream )
pure virtual

Sets the stream for input/output operations.

Parameters
streamThe stream to set
ownsStreamTrue if the processor owns the stream and should manage its lifetime

Implemented in grk::TileProcessor.

◆ setTruncated()

virtual void grk::ITileProcessor::setTruncated ( void )
pure virtual

Sets the processor to truncated state if not all tile parts are parsed.

Implemented in grk::TileProcessor.

◆ shouldDecodeComponent()

virtual bool grk::ITileProcessor::shouldDecodeComponent ( uint16_t compno)
pure virtual

Check if a component should be decoded based on user selection.

When MCT=1 is active and any of components 0-2 is requested, all three are decoded.

Parameters
compno0-based component index
Returns
true if the component should be decoded

Implemented in grk::TileProcessor.

Referenced by grk::DecompressScheduler::scheduleT1().


The documentation for this struct was generated from the following file: