Grok 20.3.2
grk::Subband Struct Reference

Stores sub band bounds and precincts. More...

#include <Subband.h>

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

Public Member Functions

 Subband ()=default
 Construct a new Subband object.
 Subband (const Subband &rhs)
 Copy-constructs a new Subband object.
virtual ~Subband ()=default
 Destroys a Subband object.
Subbandoperator= (const Subband &rhs)
 operator=
void print () const override
bool empty ()
 Returns true if this subband is empty i.e.
PrecincttryGetPrecinct (uint64_t precinctIndex)
 Gets a #ref Precinct if it has already been created, otherwise returns nullptr.
Rect32_16 generateBandPrecinctBounds (uint64_t precinctIndex, Rect32 bandPrecinctPartition, Point8 bandPrecinctExpn, uint32_t precinctGridWidth)
 Generates band precinct bounds (canvas coordinates).
PrecinctcreatePrecinct (bool isCompressor, uint16_t numLayers, uint64_t precinctIndex, Rect32 bandPrecinctPartition, Point8 bandPrecinctExpn, uint32_t precinctGridWidth, Point8 cblk_expn)
 Creates a Precinct.
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)
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

t1::eBandOrientation orientation_ = t1::BAND_ORIENT_LL
 band orientation
std::vector< Precinct * > precincts_
 flat vector of precincts
std::unordered_map< uint64_t, uint64_t > precinctMap_
 maps global precinct index to precincts vector index
uint8_t maxBitPlanes_ = 0
 band max number of bit planes
float stepsize_ = 0
 quantization step size
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

Detailed Description

Stores sub band bounds and precincts.

Constructor & Destructor Documentation

◆ Subband() [1/2]

grk::Subband::Subband ( )
default

Construct a new Subband object.

References Subband().

Referenced by operator=(), Subband(), Subband(), and ~Subband().

◆ Subband() [2/2]

grk::Subband::Subband ( const Subband & rhs)

Copy-constructs a new Subband object.

Parameters
rhsright hand side of copy

References maxBitPlanes_, orientation_, stepsize_, and Subband().

◆ ~Subband()

virtual grk::Subband::~Subband ( )
virtualdefault

Destroys a Subband object.

References Subband().

Member Function Documentation

◆ createPrecinct()

Precinct * grk::Subband::createPrecinct ( bool isCompressor,
uint16_t numLayers,
uint64_t precinctIndex,
Rect32 bandPrecinctPartition,
Point8 bandPrecinctExpn,
uint32_t precinctGridWidth,
Point8 cblk_expn )

Creates a Precinct.

Parameters
numLayersnumber of layers
precinctIndexprecinct index
bandPrecinctPartitionprecinct partition top left hand corner
bandPrecinctExpnlog2 nominal precinct dimensions
precinctGridWidthprecinct grid width
cblk_expnlo2 of code block dimensions
Returns
Precinct* Precinct

References generateBandPrecinctBounds(), grk::grklog, precinctMap_, and precincts_.

◆ empty()

bool grk::Subband::empty ( void )

Returns true if this subband is empty i.e.

one or more dimensions of the subband is zero

Returns
true if empty, otherwise false

References grk::Rect< uint32_t >::x0, grk::Rect< uint32_t >::x1, grk::Rect< uint32_t >::y0, and grk::Rect< uint32_t >::y1.

◆ generateBandPrecinctBounds()

Rect32_16 grk::Subband::generateBandPrecinctBounds ( uint64_t precinctIndex,
Rect32 bandPrecinctPartition,
Point8 bandPrecinctExpn,
uint32_t precinctGridWidth )

Generates band precinct bounds (canvas coordinates).

Parameters
precinctIndexprecinct index
bandPrecinctPartitionband precinct partition in canvas coordinates
bandPrecinctExpnlog2 of nominal band precinct dimensions
precinctGridWidthprecinct grid width
Returns
Rect32_16 precinct bounds in canvas coordinates

References grk::intersect(), grk::Point< T >::x, grk::Rect< T >::x0, grk::Point< T >::y, and grk::Rect< T >::y0.

Referenced by createPrecinct().

◆ operator=()

Subband & grk::Subband::operator= ( const Subband & rhs)

operator=

Parameters
rhsright hand side of operator=
Returns
Subband&

References Subband().

◆ print()

void grk::Subband::print ( void ) const
overridevirtual

Reimplemented from grk::Rect< uint32_t >.

References grk::Rect< uint32_t >::print().

◆ tryGetPrecinct()

Precinct * grk::Subband::tryGetPrecinct ( uint64_t precinctIndex)

Gets a #ref Precinct if it has already been created, otherwise returns nullptr.

Parameters
precinctIndexprecinct index
Returns
Precinct* Precinct if it exists, otherwise nullptr

References precinctMap_, and precincts_.

Member Data Documentation

◆ maxBitPlanes_

uint8_t grk::Subband::maxBitPlanes_ = 0

band max number of bit planes

Referenced by Subband().

◆ orientation_

t1::eBandOrientation grk::Subband::orientation_ = t1::BAND_ORIENT_LL

band orientation

Referenced by Subband().

◆ precinctMap_

std::unordered_map<uint64_t, uint64_t> grk::Subband::precinctMap_

maps global precinct index to precincts vector index

Referenced by createPrecinct(), and tryGetPrecinct().

◆ precincts_

std::vector<Precinct*> grk::Subband::precincts_

flat vector of precincts

Referenced by grk::T2Compress::compressHeader(), createPrecinct(), and tryGetPrecinct().

◆ stepsize_

float grk::Subband::stepsize_ = 0

quantization step size

Referenced by grk::compress_synch_with_plugin(), and Subband().


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