PacketManager.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/>.
*
*/
#pragma once
namespace grk
{
class PacketManager
{
public:
PacketManager(bool compression, GrkImage* img, CodingParams* cparams, uint16_t tilenumber,
J2K_T2_MODE t2_mode, TileProcessor* tileProc);
virtual ~PacketManager();
PacketIter* getPacketIter(uint32_t poc) const;
void enableTilePartGeneration(uint32_t pino, bool first_poc_tile_part, uint32_t tppos);
static void updateCompressParams(const GrkImage* p_image, CodingParams* p_cp, uint16_t tile_no);
IncludeTracker* getIncludeTracker(void);
uint32_t getNumProgressions(void);
TileProcessor* getTileProcessor(void);
GrkImage* getImage();
grk_rect32 getTileBounds(void);
CodingParams* getCodingParams(void);
J2K_T2_MODE getT2Mode(void);
private:
static void updateCompressTcpProgressions(CodingParams* p_cp, uint16_t num_comps,
uint16_t tileno, grk_rect32 tileBounds,
uint64_t max_precincts, uint8_t max_res,
uint32_t dx_min, uint32_t dy_min, bool poc);
static void getParams(const GrkImage* image, const CodingParams* p_cp, uint16_t tileno,
grk_rect32* tileBounds, uint32_t* dx_min, uint32_t* dy_min,
uint64_t* precincts, uint64_t* max_precincts, uint8_t* max_res,
uint32_t** precinctByComponent);
GrkImage* image;
CodingParams* cp;
uint16_t tileno;
IncludeTracker* includeTracker;
PacketIter* pi_;
J2K_T2_MODE t2Mode;
TileProcessor* tileProcessor;
grk_rect32 tileBounds_;
};
} // namespace grk
grk::GrkImage
Definition GrkImage.h:25
grk::PacketManager
Definition PacketManager.h:23
grk::PacketManager::getT2Mode
J2K_T2_MODE getT2Mode(void)
Definition PacketManager.cpp:77
grk::PacketManager::includeTracker
IncludeTracker * includeTracker
Definition PacketManager.h:97
grk::PacketManager::tileno
uint16_t tileno
Definition PacketManager.h:96
grk::PacketManager::getCodingParams
CodingParams * getCodingParams(void)
Definition PacketManager.cpp:73
grk::PacketManager::enableTilePartGeneration
void enableTilePartGeneration(uint32_t pino, bool first_poc_tile_part, uint32_t tppos)
Modify the packet iterator for enabling tile part generation.
Definition PacketManager.cpp:102
grk::PacketManager::tileBounds_
grk_rect32 tileBounds_
Definition PacketManager.h:101
grk::PacketManager::updateCompressTcpProgressions
static void updateCompressTcpProgressions(CodingParams *p_cp, uint16_t num_comps, uint16_t tileno, grk_rect32 tileBounds, uint64_t max_precincts, uint8_t max_res, uint32_t dx_min, uint32_t dy_min, bool poc)
Updates the coding parameters.
Definition PacketManager.cpp:191
grk::PacketManager::getParams
static void getParams(const GrkImage *image, const CodingParams *p_cp, uint16_t tileno, grk_rect32 *tileBounds, uint32_t *dx_min, uint32_t *dy_min, uint64_t *precincts, uint64_t *max_precincts, uint8_t *max_res, uint32_t **precinctByComponent)
Get the compression parameters needed to update the coding parameters and all the pocs.
Definition PacketManager.cpp:108
grk::PacketManager::getImage
GrkImage * getImage()
Definition PacketManager.cpp:65
grk::PacketManager::getTileProcessor
TileProcessor * getTileProcessor(void)
Definition PacketManager.cpp:98
grk::PacketManager::t2Mode
J2K_T2_MODE t2Mode
Definition PacketManager.h:99
grk::PacketManager::getTileBounds
grk_rect32 getTileBounds(void)
Definition PacketManager.cpp:69
grk::PacketManager::updateCompressParams
static void updateCompressParams(const GrkImage *p_image, CodingParams *p_cp, uint16_t tile_no)
Updates the compressing parameters of the codec.
Definition PacketManager.cpp:217
grk::PacketManager::tileProcessor
TileProcessor * tileProcessor
Definition PacketManager.h:100
grk::PacketManager::getIncludeTracker
IncludeTracker * getIncludeTracker(void)
Definition PacketManager.cpp:234
grk::PacketManager::~PacketManager
virtual ~PacketManager()
Definition PacketManager.cpp:81
grk::PacketManager::image
GrkImage * image
Definition PacketManager.h:94
grk::PacketManager::getNumProgressions
uint32_t getNumProgressions(void)
Definition PacketManager.cpp:90
grk::PacketManager::getPacketIter
PacketIter * getPacketIter(uint32_t poc) const
Definition PacketManager.cpp:94
grk::PacketManager::pi_
PacketIter * pi_
Definition PacketManager.h:98
grk::PacketManager::cp
CodingParams * cp
Definition PacketManager.h:95
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::J2K_T2_MODE
J2K_T2_MODE
Definition PacketIter.h:36
grk::CodingParams
Coding parameters.
Definition CodingParams.h:245
grk::IncludeTracker
Definition PacketIter.h:56
grk::PacketIter
Packet iterator.
Definition PacketIter.h:217
grk::TileProcessor
Definition TileProcessor.h:78
grk::grk_rect< uint32_t >