Grok  7.6.0
T2Encode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2020 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 
22 #pragma once
23 
24 #include <T2.h>
25 
26 namespace grk {
27 
28 struct TileProcessor;
29 
38 
42 struct T2Encode : public T2 {
43  T2Encode(TileProcessor *tileProc);
44 
45  /*
46  Encode the packets of a tile to a destination buffer
47  @param tileno number of the tile encoded
48  @param maxlayers maximum number of layers
49  @param dest the destination buffer
50  @param p_data_written amount of data written
51  @param tpnum Tile part number of the current tile
52  @param tppos The position of the tile part flag in the progression order
53  @param pino packet iterator number
54  */
55  bool encode_packets(uint16_t tileno, uint32_t maxlayers,
56  BufferedStream *stream, uint32_t *p_data_written,
57  uint32_t tpnum, uint32_t tppos,
58  uint32_t pino);
59 
68  bool encode_packets_simulate(uint16_t tileno, uint32_t maxlayers,
69  uint32_t *p_data_written, uint32_t max_len, uint32_t tppos,
70  PacketLengthMarkers *markers);
71 
72 private:
74 
85  BufferedStream *stream, uint32_t *p_data_written);
86 
96  uint32_t *p_data_written, uint32_t len,
97  PacketLengthMarkers *markers);
98 
99 };
100 
101 }
T2.h
Implementation of a tier-2 coding (packetization of code-block data) (T2)
grk::T2Encode
Tier-2 coding.
Definition: T2Encode.h:42
grk::TileProcessor
Tile coder/decoder.
Definition: TileProcessor.h:211
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:117
grk::BufferedStream
Byte input-output stream.
Definition: BufferedStream.h:38
grk::T2Encode::T2Encode
T2Encode(TileProcessor *tileProc)
grk::T2
Definition: T2.h:23
grk::PacketIter
Packet iterator.
Definition: PacketIter.h:67
grk::T2Encode::encode_packet
bool encode_packet(TileCodingParams *tcp, PacketIter *pi, BufferedStream *stream, uint32_t *p_data_written)
Encode a packet of a tile to a destination buffer.
grk::T2Encode::tileProcessor
TileProcessor * tileProcessor
Definition: T2Encode.h:73
grk::T2Encode::encode_packets_simulate
bool encode_packets_simulate(uint16_t tileno, uint32_t maxlayers, uint32_t *p_data_written, uint32_t max_len, uint32_t tppos, PacketLengthMarkers *markers)
Simulate encoding packets of a tile to a destination buffer.
grk
Copyright (C) 2016-2020 Grok Image Compression Inc.
Definition: BitIO.h:27
grk::T2Encode::encode_packet_simulate
bool encode_packet_simulate(TileCodingParams *tcp, PacketIter *pi, uint32_t *p_data_written, uint32_t len, PacketLengthMarkers *markers)
Encode a packet of a tile to a destination buffer.
grk::PacketLengthMarkers
Definition: LengthMarkers.h:88
grk::T2Encode::encode_packets
bool encode_packets(uint16_t tileno, uint32_t maxlayers, BufferedStream *stream, uint32_t *p_data_written, uint32_t tpnum, uint32_t tppos, uint32_t pino)