Grok 12.0.1
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.
 
 ~TagTree ()
 
constexprgetUninitializedValue (void)
 
void reset ()
 Reset a tag tree (set all leaves to 0)
 
void setvalue (uint64_t leafno, T value)
 Set the value of a leaf of a tag tree.
 
bool compress (BitIO *bio, uint64_t leafno, T threshold)
 Encode the value of a leaf of the tag tree up to a given threshold.
 
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.
 

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::Logger::error(), grk::grk_read(), grk::TagTree< T >::leavesHeight_, grk::TagTree< T >::leavesWidth_, grk::Logger::logger_, grk::TagTree< T >::nodeCount, grk::TagTree< T >::nodes, grk::TagTreeNode< T >::parent, grk::TagTree< T >::reset(), and grk::Logger::warn().

◆ ~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,
T 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::grk_read(), grk::TagTreeNode< T >::low, grk::TagTree< T >::nodes, and grk::TagTreeNode< T >::parent.

◆ decodeValue()

template<typename T >
void grk::TagTree< T >::decodeValue ( BitIO * bio,
uint64_t leafno,
T 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::grk_read(), and grk::TagTree< T >::nodes.

◆ 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,
T value )
inline

Set the value of a leaf of a tag tree.

Parameters
leafnoleaf to modify
valuenew value of leaf

References grk::grk_read(), and 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: