Grok 20.3.2
ITileProcessorCompress.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2026 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
18#pragma once
19
20#include "ITileProcessor.h"
21#include "PacketTracker.h" // For PacketTracker forward declaration
22
23namespace grk
24{
25
31{
35 virtual ~ITileProcessorCompress() = default;
36
41 virtual PacketTracker* getPacketTracker(void) = 0;
42
48 virtual bool preCompressTile(size_t thread_id) = 0;
49
54 virtual bool canWritePocMarker(void) = 0;
55
61 virtual bool writeTilePartT2(uint32_t* tileBytesWritten) = 0;
62
67 virtual bool doCompress(void) = 0;
68
75 virtual bool ingestUncompressedData(uint8_t* p_src, uint64_t src_length) = 0;
76
81 virtual bool needsRateControl(void) = 0;
82
87 virtual uint32_t getPreCalculatedTileLen(void) = 0;
88
93 virtual bool canPreCalculateTileLen(void) = 0;
94
99 virtual void setFirstPocTilePart(bool res) = 0;
100
105 virtual void setProgIterNum(uint32_t num) = 0;
106
111 virtual uint8_t getTilePartCounter(void) const = 0;
112
116 virtual void incTilePartCounter(void) = 0;
117};
118
119} // namespace grk
Definition PacketTracker.h:28
ResWindow.
Definition CompressedChunkCache.h:36
Interface for managing tile compression.
Definition ITileProcessorCompress.h:31
virtual bool preCompressTile(size_t thread_id)=0
Pre-compresses the tile (compression-only preparation).
virtual bool needsRateControl(void)=0
Checks whether rate control is required for this tile.
virtual bool canPreCalculateTileLen(void)=0
Checks whether the tile length can be pre-calculated.
virtual void setFirstPocTilePart(bool res)=0
Sets whether this tile part is the first POC tile part.
virtual void setProgIterNum(uint32_t num)=0
Sets the current progression iterator number.
virtual bool ingestUncompressedData(uint8_t *p_src, uint64_t src_length)=0
Ingests uncompressed image data into the tile.
virtual uint8_t getTilePartCounter(void) const =0
Gets the current tile-part counter.
virtual bool writeTilePartT2(uint32_t *tileBytesWritten)=0
Writes the T2 part of the current tile part.
virtual bool doCompress(void)=0
Performs the full tile compression (T1 + T2 + rate allocation).
virtual void incTilePartCounter(void)=0
Increments the tile-part counter.
virtual bool canWritePocMarker(void)=0
Checks whether a POC marker can be written for this tile.
virtual PacketTracker * getPacketTracker(void)=0
Gets the packet tracker.
virtual uint32_t getPreCalculatedTileLen(void)=0
Gets the pre-calculated tile length (for rate control optimization).
virtual ~ITileProcessorCompress()=default
Destroys the TileProcessorCompress.
Interface for managing tile compression/decompression.
Definition ITileProcessor.h:37