Grok 20.3.2
grk::TileComponent Struct Reference

Stores sub-sampled, unreduced tile component dimensions, along with reduction information. More...

#include <TileComponent.h>

Inheritance diagram for grk::TileComponent:
grk::Rect< uint32_t >

Public Member Functions

 TileComponent ()
 Constructs a new Tile Component object.
 ~TileComponent ()
 Destroys the Tile Component object.
bool allocRegionWindow (uint32_t numres, bool truncatedTile)
 Allocates a region window.
bool canCreateWindow (Rect32 windowBounds)
 Check if a window can be created.
void createWindow (Rect32 unreducedTileCompOrImageCompWindow)
 Creates tile component window.
void dealloc (void)
 Deallocates component resources.
void init (Resolution *resolutions, bool isCompressor, bool wholeTileDecompress, uint8_t reduce, TileComponentCodingParams *tccp)
 Initalizes tile component.
void update (uint8_t reduce)
 Differential decompression update.
template<typename T>
TileComponentWindow< T > * typedWindow () const
 Gets typed window (static_cast from type-erased pointer).
TileComponentWindow< int32_t > * getWindow () const
TileComponentWindow< int16_t > * getWindow16 () const
bool is16BitDwt () const
void setUse16BitDwt (bool use16Bit)
bool allocWindow ()
Rect32 windowBounds () const
Rect32 windowUnreducedBounds () const
const Rect32getBandWindowPadded (uint8_t resno, t1::eBandOrientation orientation) const
void transferWindowData (void **data, uint32_t *stride)
void attachWindowData (void *data, uint32_t stride)
uint32_t highestResStride () const
uint64_t windowStridedArea () const
bool isWholeTileDecoding ()
 Checks if whole tile will be decoded.
ISparseCanvas< int32_t > * getRegionWindow ()
 Gets return window.
void postProcessBlock (int32_t *srcData, t1::DecompressBlockExec *block)
 Post processes code block via virtual dispatch on window.
void postProcessBlockHT (int32_t *srcData, t1::DecompressBlockExec *block, uint16_t stride)
 Post processes HTJ2K code block via virtual dispatch on window.
Public Member Functions inherited from grk::Rect< uint32_t >
 Rect (uint32_t origin_x0, uint32_t origin_y0, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
 Rect (uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
 Rect (const Rect &rhs)
 Rect (const Rect *rhs)
 Rect (void)
virtual ~Rect ()=default
Rect< uint32_t > & setOrigin (uint32_t origx, uint32_t origy, bool absolute)
Rect< uint32_t > & setOrigin (const Rect< uint32_t > &rhs, bool absolute)
Rect< uint32_t > & setOrigin (const Rect< uint32_t > *rhs, bool absolute)
Rect< uint32_t > & toRelative (void)
Rect< uint32_t > & toAbsolute (void)
virtual void print (void) const
bool valid (void) const
bool empty (void) const
bool contains (Point< uint32_t > pt)
bool contains (uint32_t x, uint32_t y)
Rect< uint32_t > & operator= (const Rect &rhs)
Rect< uint32_t > & operator= (const Rect *rhs)
bool operator!= (const Rect &other) const
bool operator== (const Rect &rhs) const
void setRect (const Rect *rhs)
void setRect (const Rect &rhs)
Rect< uint32_t > scaleDownCeil (uint32_t den) const
Rect< uint32_t > scale (uint32_t scalex, uint32_t scaley) const
Rect< uint32_t > scaleDown (uint64_t denx, uint64_t deny) const
Rect< uint32_t > scaleDownPow2 (uint8_t powx, uint8_t powy) const
Rect< uint32_t > scaleDownPow2 (Point8 pow) const
Rect< uint32_t > scaleDownCeil (uint64_t denx, uint64_t deny) const
Rect< uint32_t > scaleDownCeilPow2 (uint8_t power) const
Rect< uint32_t > scaleDownCeilPow2 (uint8_t powx, uint8_t powy) const
Rect< uint32_t > intersection (const Rect< uint32_t > &rhs) const
Rect< uint32_t > clip (const Rect *rhs) const
Rect< uint32_t > clip (const Rect32_16 &rhs) const
Rect< uint32_t > clip (const Rect32_16 *rhs) const
Rect< uint32_t > clip (const Rect &rhs) const
Rect< uint32_t > & clip_IN_PLACE (const Rect &rhs)
Rect< uint32_t > intersection (const Rect *rhs) const
bool nonEmptyIntersection (const Rect *rhs) const
bool nonEmptyIntersection (const Rect32_16 *rhs) const
Rect< uint32_t > rectUnion (const Rect *rhs) const
Rect< uint32_t > rectUnion (const Rect &rhs) const
uint64_t area (void) const
uint32_t width () const
uint32_t height () const
Line< uint32_t > dimX () const
Line< uint32_t > dimY () const
Rect< uint32_t > pan (int64_t x, int64_t y) const
Rect< uint32_t > & pan_IN_PLACE (int64_t x, int64_t y)
Rect< uint32_t > & grow_IN_PLACE (uint32_t boundary)
Rect< uint32_t > & grow_IN_PLACE (uint32_t boundaryx, uint32_t boundaryy)
Rect< uint32_t > & grow_IN_PLACE (uint32_t boundary, uint32_t maxX, uint32_t maxY)
Rect< uint32_t > & grow_IN_PLACE (uint32_t boundaryx, uint32_t boundaryy, uint32_t maxX, uint32_t maxY)
Rect< uint32_t > & grow_IN_PLACE (uint32_t boundary, const Rect< uint32_t > &bounds)
Rect< uint32_t > & grow_IN_PLACE (uint32_t boundaryx, uint32_t boundaryy, Rect bounds)

Public Attributes

Resolutionresolutions_
 array of Resolution
uint8_t num_resolutions_
 number of resolutions
uint8_t resolutions_to_decompress_
 number of desired resolutions to decompress
PacketProgressionState currentPacketProgressionState_
 current PacketProgressionState
PacketProgressionState nextPacketProgressionState_
 next PacketProgressionState
Public Attributes inherited from grk::Rect< uint32_t >
bool absoluteCoordinates
uint32_t origin_x0
uint32_t origin_y0
uint32_t x0
uint32_t y0
uint32_t x1
uint32_t y1

Private Attributes

ISparseCanvas< int32_t > * regionWindow_
 @ISparseCanvas for region window
bool wholeTileDecompress_
 true if whole tile will be decompressed
bool isCompressor_
 true if compression is occcurring
ITileComponentWindowwindow_
 ITileComponentWindow (type-erased, points to TileComponentWindow<int32_t> or <int16_t>)
bool use16BitDwt_ = false
TileComponentCodingParamstccp_
 TileComponentCodingParams

Detailed Description

Stores sub-sampled, unreduced tile component dimensions, along with reduction information.

Also manages TileComponentWindow

Constructor & Destructor Documentation

◆ TileComponent()

grk::TileComponent::TileComponent ( )
inline

◆ ~TileComponent()

grk::TileComponent::~TileComponent ( )
inline

Destroys the Tile Component object.

References dealloc(), num_resolutions_, and resolutions_.

Member Function Documentation

◆ allocRegionWindow()

bool grk::TileComponent::allocRegionWindow ( uint32_t numres,
bool truncatedTile )
inline

Allocates a region window.

Parameters
numresnumber of resolutions
truncatedTiletrue if tile was truncated
Returns
true if successful

References grk::Rect< T >::grow_IN_PLACE(), grk::Rect< T >::rectUnion(), regionWindow_, resolutions_, and window_.

◆ allocWindow()

bool grk::TileComponent::allocWindow ( )
inline

References window_.

◆ attachWindowData()

void grk::TileComponent::attachWindowData ( void * data,
uint32_t stride )
inline

References window_.

◆ canCreateWindow()

bool grk::TileComponent::canCreateWindow ( Rect32 windowBounds)
inline

Check if a window can be created.

Parameters
unreducedTileCompOrImageCompWindowwindow bounds
Returns
true if successful

References grk::grklog, num_resolutions_, resolutions_, and windowBounds().

◆ createWindow()

void grk::TileComponent::createWindow ( Rect32 unreducedTileCompOrImageCompWindow)
inline

Creates tile component window.

Compression: unreduced, unsubsampled, full size tile component Decompresssion: unreduced, subsampled, windowed image component

Parameters
unreducedTileCompOrImageCompWindowwindow bounds

References dealloc(), isCompressor_, num_resolutions_, resolutions_, resolutions_to_decompress_, tccp_, use16BitDwt_, wholeTileDecompress_, and window_.

◆ dealloc()

void grk::TileComponent::dealloc ( void )
inline

Deallocates component resources.

References regionWindow_, and window_.

Referenced by createWindow(), and ~TileComponent().

◆ getBandWindowPadded()

const Rect32 * grk::TileComponent::getBandWindowPadded ( uint8_t resno,
t1::eBandOrientation orientation ) const
inline

References window_.

◆ getRegionWindow()

ISparseCanvas< int32_t > * grk::TileComponent::getRegionWindow ( )
inline

Gets return window.

Returns
ISparseCanvas*

References regionWindow_.

◆ getWindow()

◆ getWindow16()

TileComponentWindow< int16_t > * grk::TileComponent::getWindow16 ( ) const
inline

References typedWindow().

◆ highestResStride()

uint32_t grk::TileComponent::highestResStride ( ) const
inline

References window_.

◆ init()

void grk::TileComponent::init ( Resolution * resolutions,
bool isCompressor,
bool wholeTileDecompress,
uint8_t reduce,
TileComponentCodingParams * tccp )
inline

Initalizes tile component.

Parameters
tileProcessorITileProcessor
unreducedTileCompunreduced bounds
precprecision
tccpTileComponentCodingParams Initialize tile component in unreduced tile component coordinates (tile component coordinates take sub-sampling into account).

References currentPacketProgressionState_, isCompressor_, nextPacketProgressionState_, num_resolutions_, grk::TileComponentCodingParams::numresolutions_, resolutions_, tccp_, update(), and wholeTileDecompress_.

◆ is16BitDwt()

bool grk::TileComponent::is16BitDwt ( ) const
inline

References use16BitDwt_.

◆ isWholeTileDecoding()

bool grk::TileComponent::isWholeTileDecoding ( )
inline

Checks if whole tile will be decoded.

Returns
true if whole tile will be decoded

References wholeTileDecompress_.

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

◆ postProcessBlock()

void grk::TileComponent::postProcessBlock ( int32_t * srcData,
t1::DecompressBlockExec * block )
inline

Post processes code block via virtual dispatch on window.

Parameters
srcDatasource data (always int32_t from T1 decoder)
blockDecompressBlockExec

References regionWindow_, and window_.

◆ postProcessBlockHT()

void grk::TileComponent::postProcessBlockHT ( int32_t * srcData,
t1::DecompressBlockExec * block,
uint16_t stride )
inline

Post processes HTJ2K code block via virtual dispatch on window.

Parameters
srcDatasource data (always int32_t from T1 decoder)
blockDecompressBlockExec
stridesource data stride

References regionWindow_, and window_.

◆ setUse16BitDwt()

void grk::TileComponent::setUse16BitDwt ( bool use16Bit)
inline

References use16BitDwt_.

◆ transferWindowData()

void grk::TileComponent::transferWindowData ( void ** data,
uint32_t * stride )
inline

References window_.

◆ typedWindow()

template<typename T>
TileComponentWindow< T > * grk::TileComponent::typedWindow ( ) const
inline

Gets typed window (static_cast from type-erased pointer).

References window_.

Referenced by getWindow(), and getWindow16().

◆ update()

void grk::TileComponent::update ( uint8_t reduce)
inline

Differential decompression update.

Parameters
tileProcessorITileProcessor

References isCompressor_, num_resolutions_, resolutions_, resolutions_to_decompress_, grk::Rect< uint32_t >::setRect(), and tccp_.

Referenced by init().

◆ windowBounds()

Rect32 grk::TileComponent::windowBounds ( ) const
inline

References window_.

Referenced by canCreateWindow(), and grk::GrkImage::extractFrom().

◆ windowStridedArea()

uint64_t grk::TileComponent::windowStridedArea ( ) const
inline

References window_.

◆ windowUnreducedBounds()

Rect32 grk::TileComponent::windowUnreducedBounds ( ) const
inline

References window_.

Member Data Documentation

◆ currentPacketProgressionState_

◆ isCompressor_

bool grk::TileComponent::isCompressor_
private

true if compression is occcurring

Referenced by createWindow(), init(), TileComponent(), and update().

◆ nextPacketProgressionState_

PacketProgressionState grk::TileComponent::nextPacketProgressionState_

next PacketProgressionState

Referenced by init().

◆ num_resolutions_

◆ regionWindow_

ISparseCanvas<int32_t>* grk::TileComponent::regionWindow_
private

◆ resolutions_

◆ resolutions_to_decompress_

uint8_t grk::TileComponent::resolutions_to_decompress_

number of desired resolutions to decompress

Referenced by createWindow(), TileComponent(), and update().

◆ tccp_

TileComponentCodingParams* grk::TileComponent::tccp_
private

◆ use16BitDwt_

bool grk::TileComponent::use16BitDwt_ = false
private

◆ wholeTileDecompress_

bool grk::TileComponent::wholeTileDecompress_
private

true if whole tile will be decompressed

Referenced by createWindow(), init(), isWholeTileDecoding(), and TileComponent().

◆ window_


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