Grok 10.0.5
TileComponent.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2023 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 * This source code incorporates work covered by the BSD 2-clause license.
18 * Please see the LICENSE file in the root directory for details.
19 *
20 */
21#pragma once
22#include <vector>
23#include "TileProcessor.h"
24
25namespace grk
26{
27struct TileComponent : public grk_rect32
28{
29 TileComponent();
30 ~TileComponent();
31 bool allocRegionWindow(uint32_t numres, bool truncatedTile);
32 bool canCreateWindow(grk_rect32 unreducedTileCompOrImageCompWindow);
33 void createWindow(grk_rect32 unreducedTileCompOrImageCompWindow);
34 void dealloc(void);
35 bool init(TileProcessor* tileProcessor, grk_rect32 unreducedTileComp, uint8_t prec,
36 TileComponentCodingParams* tccp);
37 bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grk_rect32* aoi) const;
38
39 TileComponentWindow<int32_t>* getWindow() const;
40 bool isWholeTileDecoding();
41 ISparseCanvas* getRegionWindow();
42 void postProcess(int32_t* srcData, DecompressBlockExec* block);
43 void postProcessHT(int32_t* srcData, DecompressBlockExec* block, uint16_t stride);
44
45 Resolution* resolutions_; // in canvas coordinates
47 uint8_t numResolutionsToDecompress; // desired number of resolutions to decompress
48 std::atomic<uint8_t> highestResolutionDecompressed; // highest resolution actually decompressed
49#ifdef DEBUG_LOSSLESS_T2
50 Resolution* round_trip_resolutions; /* round trip resolution information */
51#endif
52 private:
53 template<typename F>
54 void postDecompressImpl(int32_t* srcData, DecompressBlockExec* block, uint16_t stride);
55 ISparseCanvas* regionWindow_;
58 TileComponentWindow<int32_t>* window_;
59 TileComponentCodingParams* tccp_;
60};
61
62} // namespace grk
uint8_t resno
Definition BlockExec.h:53
uint8_t numresolutions
number of resolutions
Definition CodingParams.h:58
TileProcessor * tileProcessor
Definition PacketManager.h:100
bool isCompressor_
Definition Precinct.h:59
bool wholeTileDecompress
Definition TileComponent.h:56
ISparseCanvas * regionWindow_
Definition TileComponent.h:55
Resolution * resolutions_
Definition TileComponent.h:45
TileComponentCodingParams * tccp_
Definition TileComponent.h:59
uint8_t numResolutionsToDecompress
Definition TileComponent.h:47
std::atomic< uint8_t > highestResolutionDecompressed
Definition TileComponent.h:48
TileComponentWindow< int32_t > * window_
Definition TileComponent.h:58
Copyright (C) 2016-2023 Grok Image Compression Inc.
Definition ICacheable.h:20
grk_rect< uint32_t > grk_rect32
Definition geometry.h:61