grk::SparseCanvas< LBW, LBH > Class Template Reference

`#include <SparseCanvas.h>`

Inheritance diagram for grk::SparseCanvas< LBW, LBH >:

## Public Member Functions

| SparseCanvas (grk_rect32 bds)
| SparseCanvas (uint32_t width, uint32_t height)
| ~SparseCanvas ()
bool | read (uint8_t resno, grk_rect32 window, int32_t *dest, const uint32_t destChunkY, const uint32_t destChunkX)
| Read window of data into dest buffer.
bool | write (uint8_t resno, grk_rect32 window, const int32_t *src, const uint32_t srcChunkY, const uint32_t srcChunkX)
| Write window of data from src buffer.
bool | alloc (grk_rect32 win, bool zeroOutBuffer)
Public Member Functions inherited from grk::ISparseCanvas
virtual | ~ISparseCanvas ()=default

## Private Member Functions

SparseBlock * | getBlock (uint32_t block_x, uint32_t block_y)
bool | isWindowValid (grk_rect32 win)
bool | readWrite (uint8_t resno, grk_rect32 win, int32_t *buf, const uint32_t spacingX, const uint32_t spacingY, bool isReadOperation)

## Private Attributes

const uint32_t | blockWidth
const uint32_t | blockHeight
SparseBlock ** | blocks
grk_rect32 | bounds
grk_rect32 | grid

## Constructor & Destructor Documentation

## SparseCanvas() [1/2]

template<uint32_t LBW, uint32_t LBH>

grk::SparseCanvas< LBW, LBH >::SparseCanvas | ( | grk_rect32 | bds | ) |

inline

References grk::grk_rect< T >::area(), grk::SparseCanvas< LBW, LBH >::blocks, grk::SparseCanvas< LBW, LBH >::bounds, grk::SparseCanvas< LBW, LBH >::grid, grk::grk_read(), grk::grk_rect< T >::height(), grk::grk_rect< T >::scaleDownPow2(), and grk::grk_rect< T >::width().

## SparseCanvas() [2/2]

template<uint32_t LBW, uint32_t LBH>

grk::SparseCanvas< LBW, LBH >::SparseCanvas | ( | uint32_t | width,
|  | uint32_t | height
| ) |  |

inline

## ~SparseCanvas()

template<uint32_t LBW, uint32_t LBH>

grk::SparseCanvas< LBW, LBH >::~SparseCanvas | ( |  | ) |

inline

References grk::SparseCanvas< LBW, LBH >::blocks, grk::SparseCanvas< LBW, LBH >::grid, grk::grk_read(), grk::grk_rect< T >::height(), and grk::grk_rect< T >::width().

## Member Function Documentation

## alloc()

template<uint32_t LBW, uint32_t LBH>

bool grk::SparseCanvas< LBW, LBH >::alloc | ( | grk_rect32 | win,
|  | bool | zeroOutBuffer
| ) |  |

inline virtual

Implements grk::ISparseCanvas.

References grk::SparseCanvas< LBW, LBH >::blockHeight, grk::SparseCanvas< LBW, LBH >::blocks, grk::SparseCanvas< LBW, LBH >::blockWidth, grk::grk_rect< T >::contains(), grk::SparseCanvas< LBW, LBH >::getBlock(), grk::SparseCanvas< LBW, LBH >::grid, grk::grk_read(), grk::GRK_WARN(), grk::SparseCanvas< LBW, LBH >::isWindowValid(), grk::grk_rect< T >::width(), grk::grk_rect< T >::x0, grk::grk_rect< T >::x1, grk::grk_rect< T >::y0, and grk::grk_rect< T >::y1.

## getBlock()

template<uint32_t LBW, uint32_t LBH>

SparseBlock * grk::SparseCanvas< LBW, LBH >::getBlock | ( | uint32_t | block_x,
|  | uint32_t | block_y
| ) |  |

inline private

References grk::SparseCanvas< LBW, LBH >::blocks, grk::SparseCanvas< LBW, LBH >::grid, grk::grk_read(), grk::grk_rect< T >::width(), grk::grk_rect< T >::x0, and grk::grk_rect< T >::y0.

Referenced by grk::SparseCanvas< LBW, LBH >::alloc(), and grk::SparseCanvas< LBW, LBH >::readWrite().

## isWindowValid()

template<uint32_t LBW, uint32_t LBH>

bool grk::SparseCanvas< LBW, LBH >::isWindowValid | ( | grk_rect32 | win | ) |

inline private

References grk::SparseCanvas< LBW, LBH >::bounds, grk::grk_read(), grk::grk_rect< T >::x1, and grk::grk_rect< T >::y1.

Referenced by grk::SparseCanvas< LBW, LBH >::alloc(), and grk::SparseCanvas< LBW, LBH >::readWrite().

## read()

template<uint32_t LBW, uint32_t LBH>

bool grk::SparseCanvas< LBW, LBH >::read | ( | uint8_t | resno,
|  | grk_rect32 | window,
|  | int32_t * | dest,
|  | const uint32_t | destChunkY,
|  | const uint32_t | destChunkX
| ) |  |

inline virtual

Read window of data into dest buffer.

Implements grk::ISparseCanvas.

References grk::grk_read(), and grk::SparseCanvas< LBW, LBH >::readWrite().

## readWrite()

template<uint32_t LBW, uint32_t LBH>

bool grk::SparseCanvas< LBW, LBH >::readWrite | ( | uint8_t | resno,
|  | grk_rect32 | win,
|  | int32_t * | buf,
|  | const uint32_t | spacingX,
|  | const uint32_t | spacingY,
|  | bool | isReadOperation
| ) |  |

inline private

References grk::SparseCanvas< LBW, LBH >::blockHeight, grk::SparseCanvas< LBW, LBH >::blockWidth, grk::SparseCanvas< LBW, LBH >::bounds, grk::grk_rect< T >::contains(), grk::SparseCanvas< LBW, LBH >::getBlock(), grk::SparseCanvas< LBW, LBH >::grid, grk::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), grk::SparseCanvas< LBW, LBH >::isWindowValid(), grk::grk_rect< T >::x0, grk::grk_rect< T >::x1, grk::grk_rect< T >::y0, and grk::grk_rect< T >::y1.

Referenced by grk::SparseCanvas< LBW, LBH >::read(), and grk::SparseCanvas< LBW, LBH >::write().

## write()

template<uint32_t LBW, uint32_t LBH>

bool grk::SparseCanvas< LBW, LBH >::write | ( | uint8_t | resno,
|  | grk_rect32 | window,
|  | const int32_t * | src,
|  | const uint32_t | srcChunkY,
|  | const uint32_t | srcChunkX
| ) |  |

inline virtual

Write window of data from src buffer.

Implements grk::ISparseCanvas.

References grk::grk_read(), and grk::SparseCanvas< LBW, LBH >::readWrite().

## Member Data Documentation

## blockHeight

template<uint32_t LBW, uint32_t LBH>

const uint32_t grk::SparseCanvas< LBW, LBH >::blockHeight

private

Referenced by grk::SparseCanvas< LBW, LBH >::alloc(), and grk::SparseCanvas< LBW, LBH >::readWrite().

## blocks

template<uint32_t LBW, uint32_t LBH>

SparseBlock** grk::SparseCanvas< LBW, LBH >::blocks

private

Referenced by grk::SparseCanvas< LBW, LBH >::alloc(), grk::SparseCanvas< LBW, LBH >::getBlock(), grk::SparseCanvas< LBW, LBH >::SparseCanvas(), and grk::SparseCanvas< LBW, LBH >::~SparseCanvas().

## blockWidth

template<uint32_t LBW, uint32_t LBH>

const uint32_t grk::SparseCanvas< LBW, LBH >::blockWidth

private

Referenced by grk::SparseCanvas< LBW, LBH >::alloc(), and grk::SparseCanvas< LBW, LBH >::readWrite().

## bounds

template<uint32_t LBW, uint32_t LBH>

grk_rect32 grk::SparseCanvas< LBW, LBH >::bounds

private

Referenced by grk::SparseCanvas< LBW, LBH >::isWindowValid(), grk::SparseCanvas< LBW, LBH >::readWrite(), and grk::SparseCanvas< LBW, LBH >::SparseCanvas().

## grid

template<uint32_t LBW, uint32_t LBH>

grk_rect32 grk::SparseCanvas< LBW, LBH >::grid

private

Referenced by grk::SparseCanvas< LBW, LBH >::alloc(), grk::SparseCanvas< LBW, LBH >::getBlock(), grk::SparseCanvas< LBW, LBH >::readWrite(), grk::SparseCanvas< LBW, LBH >::SparseCanvas(), and grk::SparseCanvas< LBW, LBH >::~SparseCanvas().

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

- SparseCanvas.h