Grok 12.0.1
PLMarkerMgr.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2024 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#pragma once
18#include <vector>
19#include <map>
20
21// #define DEBUG_PLT
22
23namespace grk
24{
25// raw markers - PL is stored using comma code
26typedef std::vector<grk_buf8*> PL_MARKER;
27typedef std::map<uint32_t, PL_MARKER*> PL_MARKERS;
28
30{
31 PLMarkerMgr(void);
32 ~PLMarkerMgr(void);
33
34 void disable(void);
35 bool isEnabled(void);
36
38 // compress
39 void pushInit(bool isFinal);
40 bool pushPL(uint32_t len);
41 bool write(void);
44
46 // decompress
48 void rewind(void);
49 uint32_t pop(void);
52 private:
53 void clearMarkers(void);
54 bool findMarker(uint32_t index, bool compress);
57 PL_MARKERS::iterator currMarkerIter_;
58
60 // compress
65
67 // decompress
68 bool readNextByte(uint8_t Iplm, uint32_t* packetLength);
74
76};
77
78} // namespace grk
Copyright (C) 2016-2024 Grok Image Compression Inc.
Definition ICacheable.h:20
void grk_read(const uint8_t *buffer, TYPE *value, uint32_t numBytes)
Definition BufferedStream.h:239
std::map< uint32_t, PL_MARKER * > PL_MARKERS
Definition PLMarkerMgr.h:27
std::vector< grk_buf8 * > PL_MARKER
Definition PLMarkerMgr.h:26
Definition BufferedStream.h:35
Definition PLMarkerMgr.h:30
uint32_t getTotalBytesWritten(void)
Definition PLMarkerMgr.cpp:134
bool write(void)
Definition PLMarkerMgr.cpp:138
grk_buf8 * addNewMarker(uint8_t *data, uint16_t len)
Definition PLMarkerMgr.cpp:160
uint32_t pop(void)
Definition PLMarkerMgr.cpp:249
PL_MARKERS * rawMarkers_
Definition PLMarkerMgr.h:56
uint32_t totalBytesWritten_
Definition PLMarkerMgr.h:61
void pushInit(bool isFinal)
Definition PLMarkerMgr.cpp:59
void disable(void)
Definition PLMarkerMgr.cpp:38
bool pushPL(uint32_t len)
Definition PLMarkerMgr.cpp:65
PLMarkerMgr(void)
Definition PLMarkerMgr.cpp:23
bool readNextByte(uint8_t Iplm, uint32_t *packetLength)
Definition PLMarkerMgr.cpp:222
void clearMarkers(void)
Definition PLMarkerMgr.cpp:46
bool sequential_
Definition PLMarkerMgr.h:69
bool findMarker(uint32_t index, bool compress)
Definition PLMarkerMgr.cpp:171
bool isEnabled(void)
Definition PLMarkerMgr.cpp:42
~PLMarkerMgr(void)
Definition PLMarkerMgr.cpp:33
bool enabled_
Definition PLMarkerMgr.h:75
PL_MARKERS::iterator currMarkerIter_
Definition PLMarkerMgr.h:57
grk_buf8 * currMarkerBuf_
Definition PLMarkerMgr.h:72
BufferedStream * stream_
Definition PLMarkerMgr.h:63
void rewind(void)
Definition PLMarkerMgr.cpp:293
uint32_t currMarkerBufIndex_
Definition PLMarkerMgr.h:71
uint32_t packetLen_
Definition PLMarkerMgr.h:70
bool isFinal_
Definition PLMarkerMgr.h:62