43#define PGFMajorNumber 7
47#define PPCAT_NX(A, B) A ## B
48#define PPCAT(A, B) PPCAT_NX(A, B)
49#define STRINGIZE_NX(A) #A
50#define STRINGIZE(A) STRINGIZE_NX(A)
53#define PGFCodecVersionID PPCAT(PPCAT(PPCAT(0x0, PGFMajorNumber), PGFYear), PGFWeek)
55#define PGFCodecVersion STRINGIZE(PPCAT(PPCAT(PPCAT(PPCAT(PGFMajorNumber, .), PGFYear), .), PGFWeek))
75 #ifdef __PGF32SUPPORT__
90 #ifdef __PGF32SUPPORT__
130 static_assert(
sizeof(PGFMagicVersion) == 4,
"wrong number of bytes");
139 static_assert(
sizeof(PGFPreHeader) == 8,
"wrong number of bytes");
146#ifdef PGF_USE_BIG_ENDIAN
163 static_assert(
sizeof(PGFVersionNumber) == 2,
"wrong number of bytes");
193 static_assert(
sizeof(PGFHeader) == 16,
"wrong number of bytes");
205 static_assert(
sizeof(PGFPostHeader) == 1040,
"wrong number of bytes");
215#ifdef PGF_USE_BIG_ENDIAN
234 static_assert(
sizeof(ROIBlockHeader::RBH) == 2,
"wrong number of bytes");
235 static_assert(
sizeof(ROIBlockHeader) == 2,
"wrong number of bytes");
274 PGFRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
288 ASSERT(rect.left >= 0 && rect.right >= 0 && rect.left <= rect.right);
289 ASSERT(rect.top >= 0 && rect.bottom >= 0 && rect.top <= rect.bottom);
292 PGFRect& operator=(
const RECT& rect) {
321 void Offset(int32_t shiftH, int32_t shiftV) {
361 return !(*
this == rect2);
366#ifdef __PGF32SUPPORT__
369 typedef int16_t
DataT;
constexpr Policy CachePrefix
constexpr Policy CacheAll
constexpr int MaxBitPlanes
maximum number of bit planes of m_value: 32 minus sign bit
constexpr int PGFVersion
current standard version
constexpr size_t HeaderSize
constexpr int LinBlockSize
side length of a coefficient block in a HH or LL subband
constexpr size_t MagicVersionSize
constexpr int PGF32
32 bit values are used -> allows at maximum 30 input bits, otherwise 16 bit values are used -> allows...
constexpr size_t MaxUserDataSize
constexpr size_t PreHeaderSize
constexpr int MaxChannels
maximum number of (color) channels
void(*) RefreshCB(void *p)
constexpr const char * PGFMagic
PGF identification.
constexpr int MaxLevel
maximum number of transform levels
constexpr int InterBlockSize
side length of a coefficient block in a HL or LH subband
constexpr int MaxQuality
maximum quality
constexpr int ColorTableLen
size of color lookup table (clut)
constexpr int RLblockSizeLen
block size length (< 16): ld(BufferSize) < RLblockSizeLen <= 2*ld(BufferSize)
constexpr int NSubbands
number of subbands per level
constexpr uint32_t CodeBufferLen
number of words in code buffer (CodeBufferLen > BufferLen)
constexpr int Version5
new coding scheme since major version 5
constexpr int Version7
Codec major and minor version number stored in PGFHeader.
constexpr size_t DataTSize
constexpr int Version6
hSize in PGFPreHeader uses 32 bits instead of 16 bits
constexpr int MaxBitPlanesLog
number of bits to code the maximum number of bit planes (in 32 or 16 bit mode)
constexpr int Version2
data structure PGFHeader of major version 2
constexpr uint32_t BufferLen
number of words per buffer
constexpr int DownsampleThreshold
if quality is larger than this threshold than downsampling is used
constexpr size_t ColorTableSize
constexpr uint32_t BufferSize
must be a multiple of WordWidth, BufferSize <= UINT16_MAX
constexpr int PGFROI
supports Regions Of Interest
OSError error
operating system error code
IOException()
Standard constructor.
PGF identification and version.
char magic[3]
PGF identification = "PGF".
uint8_t version
PGF version.
bool operator!=(const PGFRect &rect2) const
friend bool Intersect(const PGFRect &rect1, const PGFRect &rect2, PGFRect &resultRect)
PGFRect(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
bool operator==(const PGFRect &rect2) const
void Offset(int32_t shiftH, int32_t shiftV)
bool IsInside(uint32_t x, uint32_t y) const
PGFRect()
Standard constructor.
version number stored in header since major version 7
PGFVersionNumber(uint8_t _major, uint8_t _year, uint8_t _week)
uint16_t week
week number in a year
uint16_t major
major version number
uint16_t year
year since 2000 (year 2001 = 1)