Grok 20.3.2
grk::Precinct Struct Referenceabstract

Lightweight precinct struct storing only bounds, some book-keeping variables and a pointer to the PrecinctImpl. More...

#include <Precinct.h>

Inheritance diagram for grk::Precinct:
grk::Rect32_16 grk::PrecinctCompress grk::PrecinctDecompress

Public Member Functions

 Precinct (uint16_t numLayers, const Rect32_16 &bounds, Point8 cblk_expn)
 Constructs a new Precinct object.
virtual ~Precinct ()
 Destroys the Precinct object.
void deleteTagTrees ()
 Deletes tag trees.
Rect32_16 getCodeBlockBounds (uint32_t cblkno)
 Gets code block bounds.
TagTreeU16getInclTree (void)
 Gets inclusion TagTreeU16.
TagTreeU8getImsbTree (void)
 Get msb TagTreeU8.
uint16_t getNominalBlockSize (void)
 Gets nominal size (area) of code block.
uint32_t getNumCblks (void)
 Gets the number of code blocks in the precinct.
t1::CodeblockCompressgetCompressBlock (uint32_t cblkno)
 Gets CodeblockCompress for a code block A CodeblockCompress will be created if it hasn't already been created yet.
t1::CodeblockDecompressgetDecompressBlock (uint32_t cblkno)
 Gets CodeblockDecompress for a code block A CodeBlockDecompress will be created if it hasn't been created yet.
t1::CodeblockDecompresstryGetDecompressBlock (uint32_t cblkno)
 Gets a CodeblockDecompress if it exists, otherwise returns nullptr.
Point8 getCblkExpn (void)
 Gets log2 of nominal code block dimensions.
Rect32_16 getCblkGrid (void)
 Gets the code block grid.
Public Member Functions inherited from grk::Rect32_16
 Rect32_16 (uint32_t x0, uint32_t y0, uint16_t w, uint16_t h)
 Rect32_16 (void)
virtual ~Rect32_16 ()=default
uint32_t x0 (void) const
uint32_t y0 (void) const
uint32_t x1 (void) const
uint32_t y1 (void) const
uint16_t width () const
uint16_t height () const
bool valid () const
bool empty (void) const
uint32_t area (void) const
Rect32_16 intersection (const Rect32_16 *rhs) const
void setRect (const Rect32_16 *rhs)
void setRect (const Rect32_16 rhs)
virtual void print (void) const

Protected Attributes

uint16_t numLayers_

Private Member Functions

PrecinctImplgetImpl (void)
virtual PrecinctImplmakeImpl (void)=0

Private Attributes

PrecinctImplimpl_ = nullptr
Point8 cblk_expn_

Detailed Description

Lightweight precinct struct storing only bounds, some book-keeping variables and a pointer to the PrecinctImpl.

Constructor & Destructor Documentation

◆ Precinct()

grk::Precinct::Precinct ( uint16_t numLayers,
const Rect32_16 & bounds,
Point8 cblk_expn )

Constructs a new Precinct object.

Parameters
numLayersnumber of layers
boundsprecinct bounds
cblk_expnlog2 of nominal code block dimensions

References cblk_expn_, numLayers_, and grk::Rect32_16::Rect32_16().

◆ ~Precinct()

grk::Precinct::~Precinct ( )
virtual

Destroys the Precinct object.

References impl_.

Member Function Documentation

◆ deleteTagTrees()

void grk::Precinct::deleteTagTrees ( )

Deletes tag trees.

◆ getCblkExpn()

Point8 grk::Precinct::getCblkExpn ( void )

Gets log2 of nominal code block dimensions.

Returns
Point8 log2 of block dimensions

References cblk_expn_.

◆ getCblkGrid()

Rect32_16 grk::Precinct::getCblkGrid ( void )

Gets the code block grid.

Returns
Rect32_16

References grk::PrecinctImpl::cblk_grid_, getImpl(), and grk::Rect32_16::Rect32_16().

◆ getCodeBlockBounds()

Rect32_16 grk::Precinct::getCodeBlockBounds ( uint32_t cblkno)

Gets code block bounds.

Parameters
cblknocode block index in precinct
Returns
Rect32_16 bounds

References grk::PrecinctImpl::getCodeBlockBounds(), getImpl(), and grk::Rect32_16::Rect32_16().

◆ getCompressBlock()

t1::CodeblockCompress * grk::Precinct::getCompressBlock ( uint32_t cblkno)

Gets CodeblockCompress for a code block A CodeblockCompress will be created if it hasn't already been created yet.

Parameters
cblknocode block index
Returns
t1::CodeblockCompress* CodeblockCompress

References grk::PrecinctImpl::enc_, and getImpl().

◆ getDecompressBlock()

t1::CodeblockDecompress * grk::Precinct::getDecompressBlock ( uint32_t cblkno)

Gets CodeblockDecompress for a code block A CodeBlockDecompress will be created if it hasn't been created yet.

Parameters
cblknocode block index
Returns
t1::CodeblockDecompress* CodeblockDecompress

References grk::PrecinctImpl::dec_, and getImpl().

◆ getImpl()

◆ getImsbTree()

TagTreeU8 * grk::Precinct::getImsbTree ( void )

Get msb TagTreeU8.

Returns
TagTreeU8* TagTreeU8

References getImpl(), and grk::PrecinctImpl::getIMsbTagTree().

◆ getInclTree()

TagTreeU16 * grk::Precinct::getInclTree ( void )

Gets inclusion TagTreeU16.

Returns
TagTreeU16* TagTreeU16

References getImpl(), and grk::PrecinctImpl::getIncludeTagTree().

◆ getNominalBlockSize()

uint16_t grk::Precinct::getNominalBlockSize ( void )

Gets nominal size (area) of code block.

Returns
uint16_t nominal size

References cblk_expn_.

◆ getNumCblks()

uint32_t grk::Precinct::getNumCblks ( void )

Gets the number of code blocks in the precinct.

Returns
uint32_t number of code blocks

References grk::Rect32_16::area(), grk::PrecinctImpl::cblk_grid_, and getImpl().

◆ makeImpl()

virtual PrecinctImpl * grk::Precinct::makeImpl ( void )
privatepure virtual

Implemented in grk::PrecinctCompress, and grk::PrecinctDecompress.

Referenced by getImpl().

◆ tryGetDecompressBlock()

t1::CodeblockDecompress * grk::Precinct::tryGetDecompressBlock ( uint32_t cblkno)

Gets a CodeblockDecompress if it exists, otherwise returns nullptr.

Parameters
cblknocode block index
Returns
CodeblockDecompress*

References grk::PrecinctImpl::dec_, and getImpl().

Member Data Documentation

◆ cblk_expn_

Point8 grk::Precinct::cblk_expn_
private

◆ impl_

PrecinctImpl* grk::Precinct::impl_ = nullptr
private

Referenced by getImpl(), and ~Precinct().

◆ numLayers_

uint16_t grk::Precinct::numLayers_
protected

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