PPMMarker.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>
namespace grk
{
struct grk_ppx
{
uint8_t* data_; /* data_ == nullptr => Zppx not read yet */
uint32_t data_size_;
};
class PPMMarker
{
public:
PPMMarker();
~PPMMarker();
bool read(uint8_t* headerData, uint16_t header_size);
bool merge(void);
std::vector<grk_buf8> packetHeaders;
private:
uint32_t markers_count;
grk_ppx* markers;
uint8_t* buffer;
};
} /* namespace grk */
grk::PPMMarker
Definition PPMMarker.h:35
grk::PPMMarker::markers
grk_ppx * markers
ppm markers data (table indexed by Zppm)
Definition PPMMarker.h:61
grk::PPMMarker::packetHeaders
std::vector< grk_buf8 > packetHeaders
Definition PPMMarker.h:55
grk::PPMMarker::PPMMarker
PPMMarker()
Definition PPMMarker.cpp:26
grk::PPMMarker::buffer
uint8_t * buffer
packet header storage original buffer
Definition PPMMarker.h:64
grk::PPMMarker::merge
bool merge(void)
Merges all PPM markers read (Packed headers, main header)
Definition PPMMarker.cpp:108
grk::PPMMarker::markers_count
uint32_t markers_count
number of ppm markers (reserved size)
Definition PPMMarker.h:59
grk::PPMMarker::read
bool read(uint8_t *headerData, uint16_t header_size)
Read a PPM marker (Packed headers, main header)
Definition PPMMarker.cpp:43
grk::PPMMarker::~PPMMarker
~PPMMarker()
Definition PPMMarker.cpp:28
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::grk_ppx
Definition PPMMarker.h:29
grk::grk_ppx::data_size_
uint32_t data_size_
Definition PPMMarker.h:31
grk::grk_ppx::data_
uint8_t * data_
Definition PPMMarker.h:30