Grok 20.3.2
Resolution.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
20#include "grk_restrict.h"
21
22namespace grk
23{
24
30struct Resolution : public Rect32
31{
36 Resolution(void) = default;
41 virtual ~Resolution(void);
42
43 virtual void print() const override;
44
53 bool init(grk_plugin_tile* currentPluginTile, bool isCompressor, uint16_t numLayers,
54 ITileProcessor* tileProcessor, TileComponentCodingParams* tccp, uint8_t resno);
55
56 static Rect32 genPrecinctPartition(const Rect32& window, uint8_t precWidthExp,
57 uint8_t precHeightExp);
58
63 bool initialized_ = false;
64
70
71 uint8_t numBands_ = 0; // 1 or 3
79};
80
81/* <summary> */
82/* Determine maximum computed resolution level for inverse wavelet transform */
83/* </summary> */
84inline uint32_t max_resolution(const Resolution* GRK_RESTRICT r, uint32_t i)
85{
86 uint32_t mr = 0;
87 while(--i)
88 {
89 ++r;
90 uint32_t w;
91 if(mr < (w = r->x1 - r->x0))
92 mr = w;
93 if(mr < (w = r->y1 - r->y0))
94 mr = w;
95 }
96 return mr;
97}
98
99} // namespace grk
#define GRK_RESTRICT
Definition CodingParams.cpp:32
@ BAND_NUM_INDICES
Definition t1_common.h:44
ResWindow.
Definition CompressedChunkCache.h:36
uint32_t max_resolution(const Resolution *GRK_RESTRICT r, uint32_t i)
Definition Resolution.h:84
Rect< uint32_t > Rect32
Definition geometry.h:64
Point< uint8_t > Point8
Definition geometry.h:44
Interface for managing tile compression/decompression.
Definition ITileProcessor.h:37
Stores a tile component resolution's dimensions, sub bands and other information.
Definition Resolution.h:31
grk_plugin_tile * current_plugin_tile_
Definition Resolution.h:77
virtual ~Resolution(void)
Destroys the Resolution object.
Definition Resolution.cpp:56
Point8 bandPrecinctExpn_
Definition Resolution.h:75
Point8 cblkExpn_
Definition Resolution.h:76
ResolutionPacketParser * packetParser_
Definition Resolution.h:78
uint8_t numBands_
Definition Resolution.h:71
Rect32 precinctPartition_
Definition Resolution.h:72
virtual void print() const override
Definition Resolution.cpp:60
static Rect32 genPrecinctPartition(const Rect32 &window, uint8_t precWidthExp, uint8_t precHeightExp)
Definition Resolution.cpp:115
Rect32 bandPrecinctPartition_
Definition Resolution.h:74
Subband band[t1::BAND_NUM_INDICES]
unreduced bands (canvas coordinates)
Definition Resolution.h:69
bool init(grk_plugin_tile *currentPluginTile, bool isCompressor, uint16_t numLayers, ITileProcessor *tileProcessor, TileComponentCodingParams *tccp, uint8_t resno)
Initializes a Resolution.
Definition Resolution.cpp:69
Resolution(void)=default
Constructs a new Resolution object.
Rect32 precinctGrid_
Definition Resolution.h:73
bool initialized_
true when Resolution is initialized
Definition Resolution.h:63
Enqueues sequence of AllLayersPrecinctPacketParser for a given resolutions.
Definition PacketParser.h:280
Stores sub band bounds and precincts.
Definition Subband.h:31
Tile-component coding parameters.
Definition CodingParams.h:54
Plugin tile.