Grok  10.0.3
TileComponent.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2022 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 
25 namespace grk
26 {
27 struct TileComponent : public grk_rect32
28 {
29  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,
37  bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grk_rect32* aoi) const;
38 
40  bool isWholeTileDecoding();
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
46  uint8_t numresolutions;
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);
60 };
61 
62 } // namespace grk
Definition: SparseCanvas.h:39
Copyright (C) 2016-2022 Grok Image Compression Inc.
Definition: ICacheable.h:20
eBandOrientation
Definition: ResSimple.h:23
Definition: BlockExec.h:45
Definition: Resolution.h:25
Tile-component coding parameters.
Definition: CodingParams.h:53
Definition: TileComponent.h:28
ISparseCanvas * regionWindow_
Definition: TileComponent.h:55
uint8_t numresolutions
Definition: TileComponent.h:46
TileComponentWindow< int32_t > * getWindow() const
Definition: TileComponent.cpp:340
uint8_t numResolutionsToDecompress
Definition: TileComponent.h:47
bool allocRegionWindow(uint32_t numres, bool truncatedTile)
Definition: TileComponent.cpp:193
void postProcessHT(int32_t *srcData, DecompressBlockExec *block, uint16_t stride)
Definition: TileComponent.cpp:373
bool isWholeTileDecoding()
Definition: TileComponent.cpp:344
bool init(TileProcessor *tileProcessor, grk_rect32 unreducedTileComp, uint8_t prec, TileComponentCodingParams *tccp)
Initialize tile component in unreduced tile component coordinates (tile component coordinates take su...
Definition: TileComponent.cpp:71
~TileComponent()
Definition: TileComponent.cpp:40
Resolution * resolutions_
Definition: TileComponent.h:45
TileComponentWindow< int32_t > * window_
Definition: TileComponent.h:58
TileComponent()
Definition: TileComponent.cpp:30
bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grk_rect32 *aoi) const
Definition: TileComponent.cpp:188
TileComponentCodingParams * tccp_
Definition: TileComponent.h:59
void dealloc(void)
Definition: TileComponent.cpp:59
std::atomic< uint8_t > highestResolutionDecompressed
Definition: TileComponent.h:48
bool canCreateWindow(grk_rect32 unreducedTileCompOrImageCompWindow)
Definition: TileComponent.cpp:319
bool wholeTileDecompress
Definition: TileComponent.h:56
ISparseCanvas * getRegionWindow()
Definition: TileComponent.cpp:348
void postProcess(int32_t *srcData, DecompressBlockExec *block)
Definition: TileComponent.cpp:352
void createWindow(grk_rect32 unreducedTileCompOrImageCompWindow)
Definition: TileComponent.cpp:332
void postDecompressImpl(int32_t *srcData, DecompressBlockExec *block, uint16_t stride)
Definition: TileComponent.cpp:408
bool isCompressor_
Definition: TileComponent.h:57
Definition: TileProcessor.h:78