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 ()
constexpr T | getUninitializedValue (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::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), grk::TagTree< T >::leavesHeight_, grk::TagTree< T >::leavesWidth_, grk::TagTree< T >::nodeCount, grk::TagTree< T >::nodes, grk::TagTreeNode< T >::parent, and grk::TagTree< T >::reset().

## ~TagTree()

template<typename T >

grk::TagTree< T >::~TagTree | ( |  | ) |

inline

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

## 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

  bio | BIO handle
  leafno | leaf to compress
  threshold | Threshold 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

  bio | Pointer to a BIO handle
  leafno | Number that identifies the leaf to decompress
  threshold | Threshold to use when decoding value of the leaf
  value | the 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 |  | ) |

inline constexpr

Referenced by grk::TagTree< T >::decodeValue(), and grk::TagTree< T >::reset().

## reset()

template<typename T >

void grk::TagTree< T >::reset | ( |  | ) |

inline

Reset a tag tree (set all leaves to 0)

References grk::TagTree< T >::getUninitializedValue(), grk::grk_read(), grk::TagTree< T >::nodeCount, and grk::TagTree< T >::nodes.

Referenced by grk::TagTree< T >::TagTree().

## 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

  leafno | leaf to modify
  value | new 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

Referenced by grk::TagTree< T >::TagTree().

## leavesWidth_

template<typename T >

uint32_t grk::TagTree< T >::leavesWidth_

private

Referenced by grk::TagTree< T >::TagTree().

## nodeCount

template<typename T >

uint64_t grk::TagTree< T >::nodeCount

private

Referenced by grk::TagTree< T >::reset(), and grk::TagTree< T >::TagTree().

## nodes

template<typename T >

TagTreeNode<T>* grk::TagTree< T >::nodes

private

Referenced by grk::TagTree< T >::compress(), grk::TagTree< T >::decodeValue(), grk::TagTree< T >::reset(), grk::TagTree< T >::setvalue(), grk::TagTree< T >::TagTree(), and grk::TagTree< T >::~TagTree().

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

- TagTree.h