TileComponent.h
Go to the documentation of this file.
/*
* Copyright (C) 2016-2023 Grok Image Compression Inc.
*
* This source code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* This source code incorporates work covered by the BSD 2-clause license.
* Please see the LICENSE file in the root directory for details.
*
*/
#pragma once
#include <vector>
#include "TileProcessor.h"
namespace grk
{
struct TileComponent : public grk_rect32
{
TileComponent();
~TileComponent();
bool allocRegionWindow(uint32_t numres, bool truncatedTile);
bool canCreateWindow(grk_rect32 unreducedTileCompOrImageCompWindow);
void createWindow(grk_rect32 unreducedTileCompOrImageCompWindow);
void dealloc(void);
bool init(TileProcessor* tileProcessor, grk_rect32 unreducedTileComp, uint8_t prec,
TileComponentCodingParams* tccp);
bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grk_rect32* aoi) const;
TileComponentWindow<int32_t>* getWindow() const;
bool isWholeTileDecoding();
ISparseCanvas* getRegionWindow();
void postProcess(int32_t* srcData, DecompressBlockExec* block);
void postProcessHT(int32_t* srcData, DecompressBlockExec* block, uint16_t stride);
Resolution* resolutions_; // in canvas coordinates
uint8_t numresolutions;
uint8_t numResolutionsToDecompress; // desired number of resolutions to decompress
std::atomic<uint8_t> highestResolutionDecompressed; // highest resolution actually decompressed
#ifdef DEBUG_LOSSLESS_T2
Resolution* round_trip_resolutions; /* round trip resolution information */
#endif
private:
template<typename F>
void postDecompressImpl(int32_t* srcData, DecompressBlockExec* block, uint16_t stride);
ISparseCanvas* regionWindow_;
bool wholeTileDecompress;
bool isCompressor_;
TileComponentWindow<int32_t>* window_;
TileComponentCodingParams* tccp_;
};
} // namespace grk
TileProcessor.h
grk::ISparseCanvas
Definition SparseCanvas.h:39
grk
Copyright (C) 2016-2023 Grok Image Compression Inc.
Definition ICacheable.h:20
grk::grk_read
void grk_read(const uint8_t *buffer, TYPE *value, uint32_t numBytes)
Definition BufferedStream.h:239
grk::eBandOrientation
eBandOrientation
Definition ResSimple.h:23
grk::DecompressBlockExec
Definition BlockExec.h:45
grk::Resolution
Definition Resolution.h:25
grk::TileComponentCodingParams
Tile-component coding parameters.
Definition CodingParams.h:53
grk::TileComponent
Definition TileComponent.h:28
grk::TileComponent::regionWindow_
ISparseCanvas * regionWindow_
Definition TileComponent.h:55
grk::TileComponent::numresolutions
uint8_t numresolutions
Definition TileComponent.h:46
grk::TileComponent::getWindow
TileComponentWindow< int32_t > * getWindow() const
Definition TileComponent.cpp:340
grk::TileComponent::numResolutionsToDecompress
uint8_t numResolutionsToDecompress
Definition TileComponent.h:47
grk::TileComponent::allocRegionWindow
bool allocRegionWindow(uint32_t numres, bool truncatedTile)
Definition TileComponent.cpp:193
grk::TileComponent::postProcessHT
void postProcessHT(int32_t *srcData, DecompressBlockExec *block, uint16_t stride)
Definition TileComponent.cpp:373
grk::TileComponent::isWholeTileDecoding
bool isWholeTileDecoding()
Definition TileComponent.cpp:344
grk::TileComponent::init
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
grk::TileComponent::~TileComponent
~TileComponent()
Definition TileComponent.cpp:40
grk::TileComponent::resolutions_
Resolution * resolutions_
Definition TileComponent.h:45
grk::TileComponent::window_
TileComponentWindow< int32_t > * window_
Definition TileComponent.h:58
grk::TileComponent::TileComponent
TileComponent()
Definition TileComponent.cpp:30
grk::TileComponent::subbandIntersectsAOI
bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grk_rect32 *aoi) const
Definition TileComponent.cpp:188
grk::TileComponent::tccp_
TileComponentCodingParams * tccp_
Definition TileComponent.h:59
grk::TileComponent::dealloc
void dealloc(void)
Definition TileComponent.cpp:59
grk::TileComponent::highestResolutionDecompressed
std::atomic< uint8_t > highestResolutionDecompressed
Definition TileComponent.h:48
grk::TileComponent::canCreateWindow
bool canCreateWindow(grk_rect32 unreducedTileCompOrImageCompWindow)
Definition TileComponent.cpp:319
grk::TileComponent::wholeTileDecompress
bool wholeTileDecompress
Definition TileComponent.h:56
grk::TileComponent::getRegionWindow
ISparseCanvas * getRegionWindow()
Definition TileComponent.cpp:348
grk::TileComponent::postProcess
void postProcess(int32_t *srcData, DecompressBlockExec *block)
Definition TileComponent.cpp:352
grk::TileComponent::createWindow
void createWindow(grk_rect32 unreducedTileCompOrImageCompWindow)
Definition TileComponent.cpp:332
grk::TileComponent::postDecompressImpl
void postDecompressImpl(int32_t *srcData, DecompressBlockExec *block, uint16_t stride)
Definition TileComponent.cpp:408
grk::TileComponent::isCompressor_
bool isCompressor_
Definition TileComponent.h:57
grk::TileComponentWindow
Definition TileComponentWindow.h:160
grk::TileProcessor
Definition TileProcessor.h:78
grk::grk_rect< uint32_t >