Grok  9.5.0
TileComponent.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2021 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 grkRectU32
28 {
29  TileComponent();
31  bool allocSparseCanvas(uint32_t numres, bool truncatedTile);
32  bool allocWindowBuffer(grkRectU32 unreducedTileCompOrImageCompWindow);
33  void deallocBuffers(void);
34  bool init(bool isCompressor, bool whole_tile, grkRectU32 unreducedTileComp, uint8_t prec,
36  grk_plugin_tile* current_plugin_tile);
37  bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grkRectU32* aoi) const;
38 
40  bool isWholeTileDecoding();
42  bool postProcess(int32_t* srcData, DecompressBlockExec* block);
43  bool postProcessHT(int32_t* srcData, DecompressBlockExec* block, uint16_t stride);
44 
45  Resolution* tileCompResolution; // in canvas coordinates
46  uint8_t numresolutions;
47  uint8_t resolutions_to_decompress; // desired number of resolutions to decompress
48  uint8_t resolutions_decompressed; // actual number of resolutions decompressed
49 #ifdef DEBUG_LOSSLESS_T2
50  Resolution* round_trip_resolutions; /* round trip resolution information */
51 #endif
52  private:
53  template<typename F>
54  bool postDecompressImpl(int32_t* srcData, DecompressBlockExec* block, uint16_t stride);
60 };
61 
62 } // namespace grk
Definition: SparseCanvas.h:61
Copyright (C) 2016-2021 Grok Image Compression Inc.
Definition: ICacheable.h:20
eBandOrientation
Definition: Subband.h:25
Plugin tile.
Definition: grok.h:1096
Coding parameters.
Definition: CodingParams.h:242
Definition: BlockExec.h:45
Definition: Resolution.h:24
Tile-component coding parameters.
Definition: CodingParams.h:53
Definition: TileComponent.h:28
uint8_t resolutions_decompressed
Definition: TileComponent.h:48
uint8_t numresolutions
Definition: TileComponent.h:46
ISparseCanvas * m_sa
Definition: TileComponent.h:55
TileComponentWindowBuffer< int32_t > * getBuffer() const
Definition: TileComponent.cpp:344
Resolution * tileCompResolution
Definition: TileComponent.h:45
bool postProcess(int32_t *srcData, DecompressBlockExec *block)
Definition: TileComponent.cpp:356
bool isWholeTileDecoding()
Definition: TileComponent.cpp:348
bool allocSparseCanvas(uint32_t numres, bool truncatedTile)
Definition: TileComponent.cpp:193
bool allocWindowBuffer(grkRectU32 unreducedTileCompOrImageCompWindow)
Definition: TileComponent.cpp:324
~TileComponent()
Definition: TileComponent.cpp:39
uint8_t resolutions_to_decompress
Definition: TileComponent.h:47
TileComponentCodingParams * m_tccp
Definition: TileComponent.h:59
TileComponent()
Definition: TileComponent.cpp:30
TileComponentWindowBuffer< int32_t > * buf
Definition: TileComponent.h:58
ISparseCanvas * getSparseCanvas()
Definition: TileComponent.cpp:352
bool wholeTileDecompress
Definition: TileComponent.h:56
bool postProcessHT(int32_t *srcData, DecompressBlockExec *block, uint16_t stride)
Definition: TileComponent.cpp:377
bool m_is_encoder
Definition: TileComponent.h:57
bool init(bool isCompressor, bool whole_tile, grkRectU32 unreducedTileComp, uint8_t prec, CodingParams *cp, TileComponentCodingParams *tccp, grk_plugin_tile *current_plugin_tile)
Initialize tile component in unreduced tile component coordinates (tile component coordinates take su...
Definition: TileComponent.cpp:70
bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grkRectU32 *aoi) const
Definition: TileComponent.cpp:188
void deallocBuffers(void)
Definition: TileComponent.cpp:58
bool postDecompressImpl(int32_t *srcData, DecompressBlockExec *block, uint16_t stride)
Definition: TileComponent.cpp:416