Grok 20.3.2
PrecinctImpl.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2026 Grok Image Compression Inc.
3 *
4 * This source code is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License, version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This source code is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Affero General Public License for more details.
12 *
13 * You should have received a copy of the GNU Affero General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#pragma once
19
20namespace grk
21{
22struct Precinct;
23
31{
37 explicit PrecinctImpl(Precinct* prec);
38
43 virtual ~PrecinctImpl(void);
44
45 PrecinctImpl(const PrecinctImpl&) = delete;
47
54 Rect32_16 getCodeBlockBounds(uint32_t cblkno);
55
63 template<typename T>
64 void initCodeBlock(T* block, uint32_t cblkno);
65
70 void deleteTagTrees();
71
78
85
91
97
103
109
110protected:
111 bool genCodeBlockGrid(void);
112
113private:
114 bool hasCodeBlocks(void);
115 TagTreeU16* incltree_; /* inclusion tree */
116 TagTreeU8* imsbtree_; /* IMSB tree */
117};
118
120{
121 PrecinctImplCompress(Precinct* prec, uint16_t numLayers);
122};
123
125{
126 PrecinctImplDecompress(Precinct* prec, uint16_t numLayers);
127};
128
129} // namespace grk
Definition SparseCache.h:101
ResWindow.
Definition CompressedChunkCache.h:36
TagTree< uint8_t > TagTreeU8
Definition TagTree.h:254
TagTree< uint16_t > TagTreeU16
Definition TagTree.h:255
Lightweight precinct struct storing only bounds, some book-keeping variables and a pointer to the Pre...
Definition Precinct.h:32
PrecinctImplCompress(Precinct *prec, uint16_t numLayers)
Definition PrecinctImpl.cpp:123
PrecinctImplDecompress(Precinct *prec, uint16_t numLayers)
Definition PrecinctImpl.cpp:131
TagTreeU16 * getIncludeTagTree(void)
Gets include tag tree.
Definition PrecinctImpl.cpp:83
PrecinctImpl(const PrecinctImpl &)=delete
BlockCache< t1::CodeblockDecompress, PrecinctImpl > * dec_
Cache of CodeblockDecompress.
Definition PrecinctImpl.h:96
TagTreeU8 * imsbtree_
Definition PrecinctImpl.h:116
Rect32_16 getCodeBlockBounds(uint32_t cblkno)
Gets non-nominal bounds for a code block.
Definition PrecinctImpl.cpp:52
Rect32_16 cblk_grid_
code block grid
Definition PrecinctImpl.h:102
BlockCache< t1::CodeblockCompress, PrecinctImpl > * enc_
Cache of CodeblockCompress.
Definition PrecinctImpl.h:90
Precinct * prec_
associated precinct
Definition PrecinctImpl.h:108
void initCodeBlock(T *block, uint32_t cblkno)
Initializes code block.
Definition PrecinctImpl.cpp:65
bool genCodeBlockGrid(void)
Definition PrecinctImpl.cpp:42
PrecinctImpl(Precinct *prec)
Constructs a new PrecinctImpl.
Definition PrecinctImpl.cpp:30
void deleteTagTrees()
Deletes tag trees.
Definition PrecinctImpl.cpp:72
PrecinctImpl & operator=(const PrecinctImpl &)=delete
bool hasCodeBlocks(void)
Definition PrecinctImpl.cpp:79
TagTreeU16 * incltree_
Definition PrecinctImpl.h:115
virtual ~PrecinctImpl(void)
Destroys the PrecinctImpl.
Definition PrecinctImpl.cpp:36
TagTreeU8 * getIMsbTagTree(void)
Gets MSB tag tree.
Definition PrecinctImpl.cpp:102
Definition geometry.h:105