21 template<
typename T,
typename P>
31 virtual T*
create(uint64_t index)
override
50 ceildivpow2<uint32_t>(bounds->
x1, cblk_expn.
x),
51 ceildivpow2<uint32_t>(bounds->
y1, cblk_expn.
y));
68 return cblk_bounds.intersection(&
m_bounds);
88 if(block->non_empty())
110 if(grid_width > 0 && grid_height > 0)
118 catch(std::exception& e)
135 if(grid_width > 0 && grid_height > 0)
143 catch(std::exception& e)
Definition: Precinct.h:23
BlockCache(uint64_t maxChunkSize, P *blockInitializer)
Definition: Precinct.h:25
virtual ~BlockCache()=default
P * m_blockInitializer
Definition: Precinct.h:39
virtual T * create(uint64_t index) override
Definition: Precinct.h:31
Definition: SparseCache.h:25
Tag tree.
Definition: TagTree.h:47
#define GRK_UNUSED(x)
Definition: grk_includes.h:87
Copyright (C) 2016-2021 Grok Image Compression Inc.
Definition: ICacheable.h:20
grkRect< uint32_t > grkRectU32
Definition: util.h:56
static uint32_t floordivpow2(uint32_t a, uint32_t b)
Divide an unsigned integer by a power of 2 and round downwards.
Definition: grk_intmath.h:48
grkPoint< uint32_t > grkPointU32
Definition: util.h:37
void GRK_WARN(const char *fmt,...)
Definition: logger.cpp:49
TagTree< uint16_t > TagTreeU16
Definition: TagTree.h:255
TagTree< uint8_t > TagTreeU8
Definition: TagTree.h:254
Definition: Codeblock.h:123
Definition: Codeblock.h:182
Definition: Precinct.h:165
uint32_t getCblkGridHeight(void)
Definition: Precinct.h:194
TagTreeU16 * getInclTree(void)
Definition: Precinct.h:182
Precinct(const grkRectU32 &bounds, bool isCompressor, grkPointU32 cblk_expn)
Definition: Precinct.h:166
TagTreeU8 * getImsbTree(void)
Definition: Precinct.h:186
uint64_t getNumCblks(void)
Definition: Precinct.h:202
DecompressCodeblock * tryGetDecompressedBlockPtr(uint64_t cblkno)
Definition: Precinct.h:214
CompressCodeblock * getCompressedBlockPtr(uint64_t cblkno)
Definition: Precinct.h:206
PrecinctImpl * impl
Definition: Precinct.h:229
uint32_t getNominalBlockSize(void)
Definition: Precinct.h:198
DecompressCodeblock * getDecompressedBlockPtr(uint64_t cblkno)
Definition: Precinct.h:210
~Precinct()
Definition: Precinct.h:170
uint64_t precinctIndex
Definition: Precinct.h:226
grkRectU32 getCblkGrid(void)
Definition: Precinct.h:222
grkPointU32 getCblkExpn(void)
Definition: Precinct.h:218
grkRectU32 getCodeBlockBounds(uint64_t cblkno)
Definition: Precinct.h:178
void deleteTagTrees()
Definition: Precinct.h:174
grkPointU32 m_cblk_expn
Definition: Precinct.h:230
uint32_t getCblkGridwidth(void)
Definition: Precinct.h:190
PrecinctImpl * getImpl(void)
Definition: Precinct.h:231
Definition: Precinct.h:43
TagTreeU16 * getIncludeTagTree(void)
Definition: Precinct.h:103
grkPointU32 m_cblk_expn
Definition: Precinct.h:157
TagTreeU8 * imsbtree
Definition: Precinct.h:162
grkRectU32 m_bounds
Definition: Precinct.h:156
TagTreeU8 * getIMsbTagTree(void)
Definition: Precinct.h:128
grkRectU32 m_cblk_grid
Definition: Precinct.h:155
~PrecinctImpl()
Definition: Precinct.h:53
bool initCodeBlocks(grkRectU32 *bounds)
Definition: Precinct.h:70
bool m_isCompressor
Definition: Precinct.h:158
BlockCache< CompressCodeblock, PrecinctImpl > * enc
Definition: Precinct.h:153
PrecinctImpl(bool isCompressor, grkRectU32 *bounds, grkPointU32 cblk_expn)
Definition: Precinct.h:44
bool initCodeBlock(T *block, uint64_t cblkno)
Definition: Precinct.h:86
grkRectU32 getCodeBlockBounds(uint64_t cblkno)
Definition: Precinct.h:59
void deleteTagTrees()
Definition: Precinct.h:96
TagTreeU16 * incltree
Definition: Precinct.h:161
BlockCache< DecompressCodeblock, PrecinctImpl > * dec
Definition: Precinct.h:154
T x1
Definition: util.h:96
T y0
Definition: util.h:96
uint64_t area(void) const
Definition: util.h:205
T width() const
Definition: util.h:209
T height() const
Definition: util.h:213
T y1
Definition: util.h:96
T x0
Definition: util.h:96