Grok 20.3.2
TileBlocks.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{
22
23const uint8_t gain_b[4] = {0, 1, 1, 2};
24
30{
34 ResBlocks(void) = default;
35
39 void clear(void)
40 {
41 blocks_.clear();
42 }
43
47 bool empty(void) const
48 {
49 return blocks_.empty();
50 }
51
55 void release(void)
56 {
57 blocks_.clear();
58 }
59
63 void combine(const ResBlocks& other)
64 {
65 // Append blocks from the other ResBlocks to this one
66 blocks_.insert(blocks_.end(), other.blocks_.begin(), other.blocks_.end());
67 }
68
72 std::vector<std::shared_ptr<t1::DecompressBlockExec>> blocks_;
73};
74
75typedef std::vector<ResBlocks> ComponentBlocks;
76typedef std::vector<ComponentBlocks> TileBlocks;
77
78} // namespace grk
ResWindow.
Definition CompressedChunkCache.h:36
std::vector< ResBlocks > ComponentBlocks
Definition TileBlocks.h:75
std::vector< ComponentBlocks > TileBlocks
Definition TileBlocks.h:76
const uint8_t gain_b[4]
Definition TileBlocks.h:23
void release(void)
unref and clear all blocks
Definition TileBlocks.h:55
void combine(const ResBlocks &other)
Combines another ResBlocks into this one.
Definition TileBlocks.h:63
std::vector< std::shared_ptr< t1::DecompressBlockExec > > blocks_
vector of block arrays, indexed by resolution
Definition TileBlocks.h:72
bool empty(void) const
return true if empty
Definition TileBlocks.h:47
void clear(void)
clear all blocks
Definition TileBlocks.h:39
ResBlocks(void)=default
constructs ResBlocks