Grok 20.3.2
grk::PacketIter Struct Reference

Iterates through JPEG 2000 packets following a progression order. More...

#include <PacketIter.h>

Public Member Functions

 PacketIter ()
 Constructs PacketIter.
 ~PacketIter ()
 Destroys PacketIter.
void init (PacketManager *packetMan, uint32_t pocIndex, TileCodingParams *tcp, Rect32 tileBounds, bool compression, uint8_t max_res, uint64_t max_precincts, uint32_t **componentPrecinctInfo)
 Initializes PacketItr.
void printStaticState (void)
 Prints static debug state of iterator.
void printDynamicState (void)
 Prints dynamic debug state of the iterator.
void enable_tile_part_generation (uint32_t prog_iter_num, bool first_poc_tile_part, uint8_t newTilePartProgressionPosition)
 Modifies the packet iterator to enable tile part generation.
bool genPrecinctInfoOPT ()
 Generates optimized precinct information.
void genPrecinctInfo ()
 Generates non-optimized precinct information.
void genPrecinctInfo (PacketIterInfoComponent *comp, PacketIterInfoResolution *res, uint8_t resNumber)
 Generates precinct information.
uint8_t * get_include (uint16_t layerIndex)
 Gets point to packet include information i.e.
bool update_include (void)
 Updates include state for current packet.
void destroy_include (void)
 Clears all include states.
bool next (SparseBuffer *compressedPackets)
 Moves to next packet.
GRK_PROG_ORDER getProgression (void) const
 Gets current progression order.
uint16_t getCompno (void) const
 Gets component number for iterator's current packet.
uint8_t getResno (void) const
 Gets resolution number for iterator's current packet.
uint64_t getPrecinctIndex (void) const
 Gets precinct index for iterator's current packet.
uint16_t getLayno (void) const
 Gets layer number for iterator's current packet.

Private Member Functions

void update_dxy (void)
 Computes dx/dy step sizes for all components.
bool checkForRemainingValidProgression (int32_t prog, uint32_t prog_iter_num, const char *progString)
 Checks if there is a remaining valid progression for tile part generation.
bool genPrecinctY0Grid (ResPrecinctInfo *rpInfo)
 Computes py0grid_ for the current (x,y) position (non-OPT path).
bool genPrecinctX0Grid (ResPrecinctInfo *rpInfo)
 Computes px0grid_ for the current (x,y) position (non-OPT path).
void genPrecinctY0GridRPCL_OPT (ResPrecinctInfo *rpInfo)
 Computes py0grid_ for RPCL OPT path (tile origin at (0,0), no subsampling).
void genPrecinctX0GridRPCL_OPT (ResPrecinctInfo *rpInfo)
 Computes px0grid_ for RPCL OPT path.
bool genPrecinctX0GridPCRL_OPT (ResPrecinctInfo *rpInfo)
 Computes px0grid_ for PCRL/CPRL OPT path.
bool genPrecinctY0GridPCRL_OPT (ResPrecinctInfo *rpInfo)
 Computes py0grid_ for PCRL/CPRL OPT path.
bool precInfoCheck (ResPrecinctInfo *rpInfo)
 Validates that the current (compno, resno, x, y) maps to a valid precinct.
void generatePrecinctIndex (void)
 Computes precinctIndex from (px0grid_, py0grid_) and precinct grid width.
bool validatePrecinct (void)
 Validates the current precinct and computes grid coordinates.
void update_dxy_for_comp (PacketIterInfoComponent *comp, bool updateActive)
 Computes dx/dy for a single component and merges into the global minimum.
bool isWholeTile (void)
 Returns true if the full tile is being decoded (no windowed sub-region).
bool next_cprl (SparseBuffer *)
 Get next packet in component-precinct-resolution-layer order.
bool next_cprlOPT (SparseBuffer *compressedPackets)
bool next_pcrl ()
 Get next packet in precinct-component-resolution-layer order.
bool next_pcrlOPT ()
bool next_lrcp ()
 Get next packet in layer-resolution-component-precinct order.
bool next_lrcpOPT ()
bool next_rlcp ()
 Get next packet in resolution-layer-component-precinct order.
bool next_rlcpOPT ()
bool next_rpcl (SparseBuffer *)
 Get next packet in resolution-precinct-component-layer order.
bool next_rpclOPT (SparseBuffer *compressedPackets)
bool skipPackets (SparseBuffer *compressedPackets, uint64_t numPackets)

Private Attributes

uint16_t compno = 0
 current component number in iteration
uint8_t resno = 0
 current resolution number in iteration
uint64_t precinctIndex = 0
 current precinct index in iteration
uint16_t layno = 0
 current layer number in iteration
grk_progression prog
 progression order and iteration bounds
uint16_t numcomps = 0
 number of image components
PacketIterInfoComponentcomps = nullptr
 per-component precinct grid info, length = numcomps
uint64_t x = 0
 current x position in spatial progression (projected coordinates)
uint64_t y = 0
 current y position in spatial progression (projected coordinates)
uint32_t dx = 0
 Minimum horizontal step size across all components/resolutions for spatial progressions (PCRL, RPCL, CPRL).
uint32_t dy = 0
 Minimum vertical step size across all components/resolutions for spatial progressions.
uint32_t dxActive = 0
 active horizontal step (accounts for alignment to current x position)
uint32_t dyActive = 0
 active vertical step (accounts for alignment to current y position)
bool incrementInner = false
PacketManagerpacketManager = nullptr
 owning packet manager
uint8_t maxNumDecompositionResolutions = 0
 max number of decomposition resolutions to decompress
bool singleProgression_ = false
 true if there is exactly one progression (no POC markers)
bool compression_ = false
 true when used for compression, false for decompression
ResPrecinctInfoprecinctInfoOPT_ = nullptr
 Cached per-resolution precinct info for the optimized iteration path.
uint32_t px0grid_ = 0
 precinct grid x-coordinate of current precinct's top-left corner
uint32_t py0grid_ = 0
 precinct grid y-coordinate of current precinct's top-left corner
bool skippedLeft_ = false
 RPCL OPT: tracks whether left-of-window precincts have been skipped for current row.

Detailed Description

Iterates through JPEG 2000 packets following a progression order.

A JPEG 2000 codestream organizes compressed data into packets, each identified by a (layer, resolution, component, precinct) tuple. The order in which packets appear is determined by the progression order (LRCP, RLCP, RPCL, PCRL, or CPRL).

This iterator generates the packet sequence for a given progression order, supporting both compression and decompression, with optional windowed (sub-region) decode and progression order changes (POC).

Optimized vs Non-Optimized Paths

When decompressing under common conditions, an optimized code path (methods suffixed with OPT) is used. The OPT path caches all resolution precinct info in precinctInfoOPT_ and avoids per-packet recomputation. The optimization conditions are:

  1. Single progression (no POC)
  2. No subsampling (all components have dx=dy=1)
  3. Constant number of resolutions across all components
  4. Non-decreasing projected precinct size as resolution decreases (CPRL/PCRL only)
  5. Tile origin at (0,0)

Spatial Progressions and Step Sizes

PCRL, RPCL, and CPRL iterate over spatial (x,y) coordinates using step sizes dx/dy computed from component subsampling and precinct dimensions. If all resolution precinct step sizes exceed UINT32_MAX, dx/dy remain 0 and next() returns false immediately to prevent infinite loops.

Constructor & Destructor Documentation

◆ PacketIter()

grk::PacketIter::PacketIter ( )

Constructs PacketIter.

References prog.

◆ ~PacketIter()

grk::PacketIter::~PacketIter ( )

Destroys PacketIter.

References comps, and precinctInfoOPT_.

Member Function Documentation

◆ checkForRemainingValidProgression()

bool grk::PacketIter::checkForRemainingValidProgression ( int32_t prog,
uint32_t prog_iter_num,
const char * progString )
private

Checks if there is a remaining valid progression for tile part generation.

Check if there is a remaining valid progression order.

References checkForRemainingValidProgression(), GRK_LRCP, GRK_RLCP, packetManager, and prog.

Referenced by checkForRemainingValidProgression(), and enable_tile_part_generation().

◆ destroy_include()

void grk::PacketIter::destroy_include ( void )

Clears all include states.

References packetManager.

◆ enable_tile_part_generation()

void grk::PacketIter::enable_tile_part_generation ( uint32_t prog_iter_num,
bool first_poc_tile_part,
uint8_t newTilePartProgressionPosition )

Modifies the packet iterator to enable tile part generation.

Parameters
prog_iter_numpacket iterator number
first_poc_tile_parttrue for first POC tile part
newTilePartProgressionPositionposition of tile part flag in the progression order

References checkForRemainingValidProgression(), grk::CodeStreamCompress::convertProgressionOrder(), grk::FINAL_PASS, GRK_IS_CINEMA, GRK_IS_IMF, GRK_LRCP, GRK_RLCP, packetManager, and prog.

◆ generatePrecinctIndex()

void grk::PacketIter::generatePrecinctIndex ( void )
private

Computes precinctIndex from (px0grid_, py0grid_) and precinct grid width.

References compno, comps, precinctIndex, px0grid_, py0grid_, and resno.

Referenced by next_cprl(), next_pcrl(), and next_rpcl().

◆ genPrecinctInfo() [1/2]

void grk::PacketIter::genPrecinctInfo ( )

Generates non-optimized precinct information.

Try the OPT path first; if preconditions aren't met, fall back to per-component, per-resolution init.

References comps, genPrecinctInfo(), genPrecinctInfoOPT(), and numcomps.

Referenced by genPrecinctInfo(), and init().

◆ genPrecinctInfo() [2/2]

void grk::PacketIter::genPrecinctInfo ( PacketIterInfoComponent * comp,
PacketIterInfoResolution * res,
uint8_t resNumber )

◆ genPrecinctInfoOPT()

bool grk::PacketIter::genPrecinctInfoOPT ( void )

Generates optimized precinct information.

Attempt to use the optimized precinct info path.

Returns
true if image meets optimization criteria

Preconditions for OPT:

  1. Decompression (not compression)
  2. Single progression (no POC)
  3. No subsampling (all dx=dy=1)
  4. All components have the same number of resolutions
  5. For PCRL/CPRL: projected precinct sizes are non-decreasing as resolution decreases (ensures the highest-resolution precinct grid covers all lower-resolution precincts)

The OPT path uses per-resolution precinct step sizes for spatial progressions (RPCL), avoiding degenerate iteration when tiles have large dimensions or many resolution levels combined with small global dx/dy.

Returns
true if OPT path was used, false if caller should use the non-OPT path

References compno, compression_, comps, GRK_CPRL, GRK_LRCP, GRK_PCRL, GRK_RLCP, GRK_RPCL, isWholeTile(), numcomps, packetManager, precinctInfoOPT_, prog, resno, and singleProgression_.

Referenced by genPrecinctInfo().

◆ genPrecinctX0Grid()

bool grk::PacketIter::genPrecinctX0Grid ( ResPrecinctInfo * rpInfo)
private

Computes px0grid_ for the current (x,y) position (non-OPT path).

Returns
false if current x is not aligned to a precinct boundary

References grk::ceildiv(), grk::ResPrecinctInfo::dxPRJ, grk::floordivpow2(), packetManager, grk::ResPrecinctInfo::precWidthExp, grk::ResPrecinctInfo::precWidthPRJ, px0grid_, grk::ResPrecinctInfo::resInPrecGridX0, grk::ResPrecinctInfo::resOffsetX0PRJ, and x.

Referenced by validatePrecinct().

◆ genPrecinctX0GridPCRL_OPT()

bool grk::PacketIter::genPrecinctX0GridPCRL_OPT ( ResPrecinctInfo * rpInfo)
private

Computes px0grid_ for PCRL/CPRL OPT path.

Returns
false if current x is not aligned to a precinct boundary

References grk::ceildivpow2(), grk::ResPrecinctInfo::decompLevel_, grk::ResPrecinctInfo::precWidthExp, grk::ResPrecinctInfo::precWidthPRJMinusOne, px0grid_, grk::ResPrecinctInfo::resInPrecGridX0, and x.

Referenced by next_cprlOPT(), and next_pcrlOPT().

◆ genPrecinctX0GridRPCL_OPT()

void grk::PacketIter::genPrecinctX0GridRPCL_OPT ( ResPrecinctInfo * rpInfo)
private

◆ genPrecinctY0Grid()

bool grk::PacketIter::genPrecinctY0Grid ( ResPrecinctInfo * rpInfo)
private

Computes py0grid_ for the current (x,y) position (non-OPT path).

Returns
false if current y is not aligned to a precinct boundary

References grk::ceildiv(), grk::ResPrecinctInfo::dyPRJ, grk::floordivpow2(), packetManager, grk::ResPrecinctInfo::precHeightExp, grk::ResPrecinctInfo::precHeightPRJ, py0grid_, grk::ResPrecinctInfo::resInPrecGridY0, grk::ResPrecinctInfo::resOffsetY0PRJ, and y.

Referenced by validatePrecinct().

◆ genPrecinctY0GridPCRL_OPT()

bool grk::PacketIter::genPrecinctY0GridPCRL_OPT ( ResPrecinctInfo * rpInfo)
private

Computes py0grid_ for PCRL/CPRL OPT path.

Returns
false if current y is not aligned to a precinct boundary

References grk::ceildivpow2(), grk::ResPrecinctInfo::decompLevel_, grk::ResPrecinctInfo::precHeightExp, grk::ResPrecinctInfo::precHeightPRJMinusOne, py0grid_, grk::ResPrecinctInfo::resInPrecGridY0, and y.

Referenced by next_cprlOPT(), and next_pcrlOPT().

◆ genPrecinctY0GridRPCL_OPT()

void grk::PacketIter::genPrecinctY0GridRPCL_OPT ( ResPrecinctInfo * rpInfo)
private

Computes py0grid_ for RPCL OPT path (tile origin at (0,0), no subsampling).

References grk::ceildivpow2(), grk::ResPrecinctInfo::decompLevel_, grk::ResPrecinctInfo::precHeightExp, py0grid_, grk::ResPrecinctInfo::resInPrecGridY0, and y.

Referenced by next_rpclOPT().

◆ get_include()

uint8_t * grk::PacketIter::get_include ( uint16_t layerIndex)

Gets point to packet include information i.e.

whether packet has already been generated or not

Parameters
layerIndexlayer index
Returns
ponter to packet include information

◆ getCompno()

uint16_t grk::PacketIter::getCompno ( void ) const

Gets component number for iterator's current packet.

Returns
component number

References compno.

Referenced by grk::T2Compress::compressPacket(), and grk::T2Compress::compressPacketSimulate().

◆ getLayno()

uint16_t grk::PacketIter::getLayno ( void ) const

Gets layer number for iterator's current packet.

Returns
layer number

References layno.

Referenced by grk::T2Compress::compressPacket(), and grk::T2Compress::compressPacketSimulate().

◆ getPrecinctIndex()

uint64_t grk::PacketIter::getPrecinctIndex ( void ) const

Gets precinct index for iterator's current packet.

Returns
precinct index

References precinctIndex.

Referenced by grk::T2Compress::compressPacket(), and grk::T2Compress::compressPacketSimulate().

◆ getProgression()

GRK_PROG_ORDER grk::PacketIter::getProgression ( void ) const

Gets current progression order.

Returns
GRK_PROG_ORDER

References prog.

◆ getResno()

uint8_t grk::PacketIter::getResno ( void ) const

Gets resolution number for iterator's current packet.

Returns
resolution number

References resno.

Referenced by grk::T2Compress::compressPacket(), and grk::T2Compress::compressPacketSimulate().

◆ init()

void grk::PacketIter::init ( PacketManager * packetMan,
uint32_t pocIndex,
TileCodingParams * tcp,
Rect32 tileBounds,
bool compression,
uint8_t max_res,
uint64_t max_precincts,
uint32_t ** componentPrecinctInfo )

Initializes PacketItr.

Parameters
packetManPacketManager
pocIndexindex into array of progression order changes
tcpTileCodingParams
tileBoundstile bounds
compressiontrue if the iterator is for the compressor
max_resmaximum number of resolutions across all components
max_precintsmaximum number of precincts, across all components
componentPrecinctInfoprecinct info for each component

References compno, compression_, comps, genPrecinctInfo(), grk::PacketManager::getImage(), GRK_CPRL, GRK_LRCP, GRK_PCRL, GRK_RLCP, GRK_RPCL, grk::TileCodingParams::hasPoc(), maxNumDecompositionResolutions, numcomps, grk::TileCodingParams::numLayers_, packetManager, precinctInfoOPT_, grk::TileCodingParams::prg_, prog, grk::TileCodingParams::progressionOrderChange_, resno, singleProgression_, grk::TileCodingParams::tccps_, update_dxy(), x, grk::Rect< T >::x0, grk::Rect< T >::x1, y, grk::Rect< T >::y0, and grk::Rect< T >::y1.

◆ isWholeTile()

bool grk::PacketIter::isWholeTile ( void )
private

Returns true if the full tile is being decoded (no windowed sub-region).

References compression_, and packetManager.

Referenced by genPrecinctInfo(), genPrecinctInfoOPT(), next_cprlOPT(), next_pcrlOPT(), next_rpclOPT(), and validatePrecinct().

◆ next()

bool grk::PacketIter::next ( SparseBuffer * compressedPackets)

Moves to next packet.

Parameters
compressedPacketsSparseBuffer holding packet This parameter is only non-null when there are PLT markers
Returns
false if packet iterator points to final packet, otherwise true

References dx, dy, GRK_CPRL, GRK_LRCP, GRK_PCRL, GRK_RLCP, GRK_RPCL, next_cprl(), next_cprlOPT(), next_lrcp(), next_lrcpOPT(), next_pcrl(), next_pcrlOPT(), next_rlcp(), next_rlcpOPT(), next_rpcl(), next_rpclOPT(), precinctInfoOPT_, and prog.

◆ next_cprl()

bool grk::PacketIter::next_cprl ( SparseBuffer * )
private

Get next packet in component-precinct-resolution-layer order.

Returns
returns false if pi pointed to the final packet, otherwise true

References compno, comps, dx, dxActive, dy, dyActive, generatePrecinctIndex(), incrementInner, layno, prog, resno, update_dxy_for_comp(), update_include(), validatePrecinct(), x, and y.

Referenced by next().

◆ next_cprlOPT()

bool grk::PacketIter::next_cprlOPT ( SparseBuffer * compressedPackets)
private

◆ next_lrcp()

bool grk::PacketIter::next_lrcp ( )
private

Get next packet in layer-resolution-component-precinct order.

Returns
returns false if pi pointed to the final packet, otherwise true

References compno, comps, incrementInner, layno, precinctIndex, prog, resno, and update_include().

Referenced by next().

◆ next_lrcpOPT()

bool grk::PacketIter::next_lrcpOPT ( )
private

◆ next_pcrl()

bool grk::PacketIter::next_pcrl ( )
private

Get next packet in precinct-component-resolution-layer order.

Returns
returns false if pi pointed to the final packet, otherwise true

References compno, dx, dxActive, dy, dyActive, generatePrecinctIndex(), incrementInner, layno, packetManager, prog, resno, singleProgression_, update_include(), validatePrecinct(), x, and y.

Referenced by next().

◆ next_pcrlOPT()

◆ next_rlcp()

bool grk::PacketIter::next_rlcp ( )
private

Get next packet in resolution-layer-component-precinct order.

Returns
returns false if pi pointed to the final packet, otherwise true

References compno, comps, incrementInner, layno, precinctIndex, prog, resno, and update_include().

Referenced by next().

◆ next_rlcpOPT()

bool grk::PacketIter::next_rlcpOPT ( )
private

◆ next_rpcl()

bool grk::PacketIter::next_rpcl ( SparseBuffer * )
private

Get next packet in resolution-precinct-component-layer order.

Returns
returns false if pi pointed to the final packet, otherwise true

References compno, comps, dx, dxActive, dy, dyActive, generatePrecinctIndex(), incrementInner, layno, prog, resno, update_include(), validatePrecinct(), x, and y.

Referenced by next().

◆ next_rpclOPT()

◆ precInfoCheck()

bool grk::PacketIter::precInfoCheck ( ResPrecinctInfo * rpInfo)
private

Validates that the current (compno, resno, x, y) maps to a valid precinct.

Returns
false if the precinct is invalid or degenerate

References comps, resno, and grk::ResPrecinctInfo::valid.

Referenced by next_cprlOPT(), next_lrcpOPT(), next_pcrlOPT(), next_rlcpOPT(), and next_rpclOPT().

◆ printDynamicState()

void grk::PacketIter::printDynamicState ( void )

Prints dynamic debug state of the iterator.

References compno, grk::grklog, layno, precinctIndex, precinctInfoOPT_, resno, x, and y.

◆ printStaticState()

void grk::PacketIter::printStaticState ( void )

Prints static debug state of iterator.

References comps, grk::grklog, precinctInfoOPT_, prog, and resno.

◆ skipPackets()

bool grk::PacketIter::skipPackets ( SparseBuffer * compressedPackets,
uint64_t numPackets )
private

◆ update_dxy()

void grk::PacketIter::update_dxy ( void )
private

Computes dx/dy step sizes for all components.

Compute the minimum spatial step sizes (dx, dy) across all components and resolutions.

These are used as the x/y loop increments in spatial progression orders (PCRL, RPCL, CPRL).

For each resolution, the projected precinct width is: comp->dx * 2^(precWidthExp + numresolutions - 1 - resno)

The global dx is the minimum of all such values that fit in uint32_t. If ALL values exceed UINT_MAX, dx remains 0, which is detected by next() to prevent infinite loops.

References compno, comps, dx, dxActive, dy, dyActive, numcomps, update_dxy_for_comp(), x, and y.

Referenced by init().

◆ update_dxy_for_comp()

void grk::PacketIter::update_dxy_for_comp ( PacketIterInfoComponent * comp,
bool updateActive )
private

Computes dx/dy for a single component and merges into the global minimum.

Parameters
compcomponent info
updateActiveif true, also updates dxActive/dyActive

References dx, grk::PacketIterInfoComponent::dx, dxActive, dy, grk::PacketIterInfoComponent::dy, dyActive, grk::PacketIterInfoComponent::numresolutions, resno, grk::PacketIterInfoComponent::resolutions, x, and y.

Referenced by next_cprl(), and update_dxy().

◆ update_include()

bool grk::PacketIter::update_include ( void )

Updates include state for current packet.

Returns
true if successful

References compno, layno, packetManager, precinctIndex, resno, and singleProgression_.

Referenced by next_cprl(), next_lrcp(), next_pcrl(), next_rlcp(), and next_rpcl().

◆ validatePrecinct()

bool grk::PacketIter::validatePrecinct ( void )
private

Validates the current precinct and computes grid coordinates.

Validate that the current (compno, resno, x, y) maps to a real precinct.

Returns
true if precinct is valid, false otherwise (skip this packet position)

On success, sets px0grid_ and py0grid_ for use by generatePrecinctIndex().

References compno, compression_, comps, genPrecinctX0Grid(), genPrecinctY0Grid(), grk::ResPrecinctInfo::init(), isWholeTile(), packetManager, grk::ResPrecinctInfo::precHeightExp, precinctInfoOPT_, grk::ResPrecinctInfo::precWidthExp, and resno.

Referenced by next_cprl(), next_pcrl(), and next_rpcl().

Member Data Documentation

◆ compno

◆ compression_

bool grk::PacketIter::compression_ = false
private

true when used for compression, false for decompression

Referenced by genPrecinctInfo(), genPrecinctInfoOPT(), init(), isWholeTile(), and validatePrecinct().

◆ comps

◆ dx

uint32_t grk::PacketIter::dx = 0
private

Minimum horizontal step size across all components/resolutions for spatial progressions (PCRL, RPCL, CPRL).

Computed as the smallest projected precinct width that fits in uint32_t. Zero if all projected precinct widths exceed UINT_MAX.

Referenced by next(), next_cprl(), next_cprlOPT(), next_pcrl(), next_pcrlOPT(), next_rpcl(), update_dxy(), and update_dxy_for_comp().

◆ dxActive

uint32_t grk::PacketIter::dxActive = 0
private

active horizontal step (accounts for alignment to current x position)

Referenced by next_cprl(), next_pcrl(), next_rpcl(), update_dxy(), and update_dxy_for_comp().

◆ dy

uint32_t grk::PacketIter::dy = 0
private

Minimum vertical step size across all components/resolutions for spatial progressions.

Same semantics as dx.

Referenced by next(), next_cprl(), next_cprlOPT(), next_pcrl(), next_pcrlOPT(), next_rpcl(), update_dxy(), and update_dxy_for_comp().

◆ dyActive

uint32_t grk::PacketIter::dyActive = 0
private

active vertical step (accounts for alignment to current y position)

Referenced by next_cprl(), next_pcrl(), next_rpcl(), update_dxy(), and update_dxy_for_comp().

◆ incrementInner

bool grk::PacketIter::incrementInner = false
private

◆ layno

uint16_t grk::PacketIter::layno = 0
private

◆ maxNumDecompositionResolutions

uint8_t grk::PacketIter::maxNumDecompositionResolutions = 0
private

max number of decomposition resolutions to decompress

Referenced by init(), and next_rpclOPT().

◆ numcomps

uint16_t grk::PacketIter::numcomps = 0
private

number of image components

Referenced by genPrecinctInfo(), genPrecinctInfoOPT(), init(), and update_dxy().

◆ packetManager

◆ precinctIndex

uint64_t grk::PacketIter::precinctIndex = 0
private

◆ precinctInfoOPT_

ResPrecinctInfo* grk::PacketIter::precinctInfoOPT_ = nullptr
private

Cached per-resolution precinct info for the optimized iteration path.

Non-null only when all OPT preconditions are met. Length = comps[0].numresolutions.

Referenced by genPrecinctInfoOPT(), init(), next(), next_cprlOPT(), next_lrcpOPT(), next_pcrlOPT(), next_rlcpOPT(), next_rpclOPT(), printDynamicState(), printStaticState(), validatePrecinct(), and ~PacketIter().

◆ prog

◆ px0grid_

uint32_t grk::PacketIter::px0grid_ = 0
private

precinct grid x-coordinate of current precinct's top-left corner

Referenced by generatePrecinctIndex(), genPrecinctX0Grid(), genPrecinctX0GridPCRL_OPT(), genPrecinctX0GridRPCL_OPT(), next_cprlOPT(), next_pcrlOPT(), and next_rpclOPT().

◆ py0grid_

uint32_t grk::PacketIter::py0grid_ = 0
private

precinct grid y-coordinate of current precinct's top-left corner

Referenced by generatePrecinctIndex(), genPrecinctY0Grid(), genPrecinctY0GridPCRL_OPT(), genPrecinctY0GridRPCL_OPT(), next_cprlOPT(), next_pcrlOPT(), and next_rpclOPT().

◆ resno

◆ singleProgression_

bool grk::PacketIter::singleProgression_ = false
private

true if there is exactly one progression (no POC markers)

Referenced by genPrecinctInfoOPT(), init(), next_pcrl(), and update_include().

◆ skippedLeft_

bool grk::PacketIter::skippedLeft_ = false
private

RPCL OPT: tracks whether left-of-window precincts have been skipped for current row.

Referenced by next_rpclOPT().

◆ x

uint64_t grk::PacketIter::x = 0
private

◆ y

uint64_t grk::PacketIter::y = 0
private

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