Grok 10.0.0
Public Member Functions | Private Attributes | List of all members
grk::TagTree< T > Class Template Reference

Tag tree. More...

#include <TagTree.h>

Public Member Functions

 TagTree (uint32_t leavesWidth, uint32_t leavesHeight)
 Create a tag tree. More...
 
 ~TagTree ()
 
constexpr T getUninitializedValue (void)
 
void reset ()
 Reset a tag tree (set all leaves to 0) More...
 
void setvalue (uint64_t leafno, T value)
 Set the value of a leaf of a tag tree. More...
 
bool compress (BitIO *bio, uint64_t leafno, T threshold)
 Encode the value of a leaf of the tag tree up to a given threshold. More...
 
void decodeValue (BitIO *bio, uint64_t leafno, T threshold, T *value)
 Decompress the value of a leaf of the tag tree up to a given threshold. More...
 

Private Attributes

uint32_t leavesWidth_
 
uint32_t leavesHeight_
 
uint64_t nodeCount
 
TagTreeNode< T > * nodes
 

Detailed Description

template<typename T>
class grk::TagTree< T >

Tag tree.

Constructor & Destructor Documentation

◆ TagTree()

template<typename T >
grk::TagTree< T >::TagTree ( uint32_t  leavesWidth,
uint32_t  leavesHeight 
)
inline

Create a tag tree.

Parameters
leavesWidth_Width of the array of leaves of the tree
leavesHeight_Height of the array of leaves of the tree
Returns
a new tag tree if successful, returns nullptr otherwise

References grk::GRK_ERROR(), grk::GRK_WARN(), grk::TagTree< T >::leavesHeight_, grk::TagTree< T >::leavesWidth_, grk::TagTree< T >::nodeCount, grk::TagTree< T >::nodes, and grk::TagTree< T >::reset().

◆ ~TagTree()

template<typename T >
grk::TagTree< T >::~TagTree ( )
inline

Member Function Documentation

◆ compress()

template<typename T >
bool grk::TagTree< T >::compress ( BitIO bio,
uint64_t  leafno,
threshold 
)
inline

Encode the value of a leaf of the tag tree up to a given threshold.

Parameters
bioBIO handle
leafnoleaf to compress
thresholdThreshold to use when compressing value of the leaf
Returns
true if successful, otherwise false

References grk::TagTree< T >::nodes, and grk::BitIO::write().

◆ decodeValue()

template<typename T >
void grk::TagTree< T >::decodeValue ( BitIO bio,
uint64_t  leafno,
threshold,
T *  value 
)
inline

Decompress the value of a leaf of the tag tree up to a given threshold.

Parameters
bioPointer to a BIO handle
leafnoNumber that identifies the leaf to decompress
thresholdThreshold to use when decoding value of the leaf
valuethe node's value

References grk::TagTree< T >::getUninitializedValue(), grk::TagTree< T >::nodes, and grk::BitIO::read().

◆ getUninitializedValue()

template<typename T >
constexpr T grk::TagTree< T >::getUninitializedValue ( void  )
inlineconstexpr

◆ reset()

template<typename T >
void grk::TagTree< T >::reset ( )
inline

◆ setvalue()

template<typename T >
void grk::TagTree< T >::setvalue ( uint64_t  leafno,
value 
)
inline

Set the value of a leaf of a tag tree.

Parameters
leafnoleaf to modify
valuenew value of leaf

References grk::TagTree< T >::nodes.

Member Data Documentation

◆ leavesHeight_

template<typename T >
uint32_t grk::TagTree< T >::leavesHeight_
private

◆ leavesWidth_

template<typename T >
uint32_t grk::TagTree< T >::leavesWidth_
private

◆ nodeCount

template<typename T >
uint64_t grk::TagTree< T >::nodeCount
private

◆ nodes

template<typename T >
TagTreeNode<T>* grk::TagTree< T >::nodes
private

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