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));
55 throw std::exception();
73 return cblk_bounds.intersection(&
bounds_);
115 if(grid_width > 0 && grid_height > 0)
123 catch(std::exception& e)
141 if(grid_width > 0 && grid_height > 0)
149 catch(std::exception& e)
Definition: Precinct.h:23
BlockCache(uint64_t maxChunkSize, P *blockInitializer)
Definition: Precinct.h:25
virtual ~BlockCache()=default
P * 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-2022 Grok Image Compression Inc.
Definition: ICacheable.h:20
grk_pt< uint32_t > grk_pt32
Definition: util.h:37
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
void GRK_ERROR(const char *fmt,...)
Definition: logger.cpp:58
void GRK_WARN(const char *fmt,...)
Definition: logger.cpp:49
grk_rect< uint32_t > grk_rect32
Definition: util.h:57
TagTree< uint16_t > TagTreeU16
Definition: TagTree.h:260
TagTree< uint8_t > TagTreeU8
Definition: TagTree.h:259
Definition: Codeblock.h:123
Definition: Codeblock.h:182
Definition: Precinct.h:172
grk_pt32 cblk_expn_
Definition: Precinct.h:237
uint32_t getCblkGridHeight(void)
Definition: Precinct.h:201
TagTreeU16 * getInclTree(void)
Definition: Precinct.h:189
TagTreeU8 * getImsbTree(void)
Definition: Precinct.h:193
uint64_t getNumCblks(void)
Definition: Precinct.h:209
DecompressCodeblock * tryGetDecompressedBlockPtr(uint64_t cblkno)
Definition: Precinct.h:221
virtual ~Precinct()
Definition: Precinct.h:177
CompressCodeblock * getCompressedBlockPtr(uint64_t cblkno)
Definition: Precinct.h:213
PrecinctImpl * impl
Definition: Precinct.h:236
uint32_t getNominalBlockSize(void)
Definition: Precinct.h:205
DecompressCodeblock * getDecompressedBlockPtr(uint64_t cblkno)
Definition: Precinct.h:217
uint64_t precinctIndex
Definition: Precinct.h:233
grk_rect32 getCblkGrid(void)
Definition: Precinct.h:229
void deleteTagTrees()
Definition: Precinct.h:181
uint32_t getCblkGridwidth(void)
Definition: Precinct.h:197
grk_pt32 getCblkExpn(void)
Definition: Precinct.h:225
grk_rect32 getCodeBlockBounds(uint64_t cblkno)
Definition: Precinct.h:185
Precinct(const grk_rect32 &bounds, bool isCompressor, grk_pt32 cblk_expn)
Definition: Precinct.h:173
PrecinctImpl * getImpl(void)
Definition: Precinct.h:238
Definition: Precinct.h:43
PrecinctImpl(bool isCompressor, grk_rect32 *bounds, grk_pt32 cblk_expn)
Definition: Precinct.h:44
TagTreeU16 * getIncludeTagTree(void)
Definition: Precinct.h:108
grk_rect32 bounds_
Definition: Precinct.h:163
grk_pt32 cblk_expn_
Definition: Precinct.h:164
TagTreeU8 * imsbtree
Definition: Precinct.h:169
TagTreeU8 * getIMsbTagTree(void)
Definition: Precinct.h:134
bool isCompressor_
Definition: Precinct.h:165
grk_rect32 cblk_grid_
Definition: Precinct.h:162
grk_rect32 getCodeBlockBounds(uint64_t cblkno)
Definition: Precinct.h:64
~PrecinctImpl()
Definition: Precinct.h:58
BlockCache< CompressCodeblock, PrecinctImpl > * enc
Definition: Precinct.h:160
bool initCodeBlock(T *block, uint64_t cblkno)
Definition: Precinct.h:91
bool initCodeBlocks(grk_rect32 *bounds)
Definition: Precinct.h:75
void deleteTagTrees()
Definition: Precinct.h:101
TagTreeU16 * incltree
Definition: Precinct.h:168
BlockCache< DecompressCodeblock, PrecinctImpl > * dec
Definition: Precinct.h:161
uint64_t area(void) const
Definition: util.h:242
T width() const
Definition: util.h:246
T y1
Definition: util.h:109
T x0
Definition: util.h:109
T x1
Definition: util.h:109
T height() const
Definition: util.h:250
bool valid(void) const
Definition: util.h:121
T y0
Definition: util.h:109