PGFtypes.h(3)
π PGFtypes.h β the libpgf definition dump π
okay so bestie, you opened PGFtypes.h(3) from libpgf and honestly? this is the lore file. every magic number, every struct, every "why is this 16384" β it's all here. no cap, this is the backbone of the whole codec and it's lowkey iconic. grab a strawberry π and let's go.
β¨ NAME β¨
PGFtypes.h β PGF definitions. that's it, that's the vibe. π
π SYNOPSIS π
#include 'PGFplatform.h'
π Classes π
struct PGFMagicVersionβ the PGF identification + version, like a little name tag at the party.struct PGFPreHeaderβ the PGF pre-header. the appetizer before the header.struct PGFVersionNumberβ the version number stored in the header since major version 7. she got an upgrade.struct PGFHeaderβ the PGF header. the main character.struct PGFPostHeaderβ the optional PGF post-header. shows up only if she feels like it πunion ROIBlockHeaderβ block header used with the ROI coding scheme.struct ROIBlockHeader::RBHβ the named ROI block header (it's a part of the union, iykyk).struct IOExceptionβ the PGF exception. the "uh oh" struct πstruct PGFRectβ a rectangle. geometry slay.
π¦ Macros π¦
here's the full roster, no skips:
#define PGFMajorNumber 7
#define PGFYear 21
#define PGFWeek 07
#define PPCAT_NX(A, B)
#define PPCAT(A, B)
#define STRINGIZE_NX(A)
#define STRINGIZE(A)
#define PGFCodecVersionID PPCAT(PPCAT(PPCAT(0x0, PGFMajorNumber), PGFYear), PGFWeek)
#define PGFCodecVersion STRINGIZE(PPCAT(PPCAT(PPCAT(PPCAT(PGFMajorNumber, .), PGFYear), .), PGFWeek))
and the annotated ones, because they actually mean stuff:
#define PGFMagic 'PGF'β PGF identification. the signature scent β¨#define MaxLevel 30β maximum number of transform levels.#define NSubbands 4β number of subbands per level.#define MaxChannels 8β maximum number of (color) channels.#define DownsampleThreshold 3β if quality is larger than this threshold than downsampling is used.#define ColorTableLen 256β size of the color lookup table (clut).#define Version2 2β data structurePGFHeaderof major version 2.#define PGF32 4β 32 bit values are used -> allows at maximum 30 input bits, otherwise 16 bit values are used -> allows at maximum 14 input bits.#define PGFROI 8β supports Regions Of Interest. π#define Version5 16β new coding scheme since major version 5.#define Version6 32βhSizeinPGFPreHeaderuses 32 bits instead of 16 bits.#define Version7 64β Codec major and minor version number stored inPGFHeader.#define PGFVersion (Version2 | PGF32 | Version5 | Version6 | Version7)β current standard version.#define BufferSize 16384β must be a multiple ofWordWidth,BufferSize <= UINT16_MAX.#define RLblockSizeLen 15β block size length (< 16):ld(BufferSize) < RLblockSizeLen <= 2*ld(BufferSize).#define LinBlockSize 8β side length of a coefficient block in a HH or LL subband.#define InterBlockSize 4β side length of a coefficient block in a HL or LH subband.#define MaxBitPlanes 31β maximum number of bit planes ofm_value: 32 minus sign bit.#define MaxBitPlanesLog 5β number of bits to code the maximum number of bit planes (in 32 or 16 bit mode).#define MaxQuality MaxBitPlanesβ maximum quality.#define MagicVersionSize sizeof(PGFMagicVersion)#define PreHeaderSize sizeof(PGFPreHeader)#define HeaderSize sizeof(PGFHeader)#define ColorTableSize (ColorTableLen*sizeof(RGBQUAD))#define DataTSize sizeof(DataT)#define MaxUserDataSize 0x7FFFFFFF
π«Ά Typedefs π«Ά
typedef INT32 DataTtypedef void(* RefreshCB) (void *p)
π Enumerations π
enum Orientation { LL = 0, HL = 1, LH = 2, HH = 3 }enum ProgressMode { PM_Relative, PM_Absolute }enum UserdataPolicy { UP_Skip = 0, UP_CachePrefix = 1, UP_CacheAll = 2 }
π Detailed Description π
PGF definitions.
Author: C. Stamm
Definition in file PGFtypes.h.
π₯ Macro Definition Documentation π₯
#define BufferSize 16384
must be a multiple of WordWidth, BufferSize <= UINT16_MAX
Definition at line 84 of file PGFtypes.h.
#define ColorTableLen 256
size of color lookup table (clut)
Definition at line 66 of file PGFtypes.h.
#define ColorTableSize (ColorTableLen*sizeof(RGBQUAD))
Definition at line 282 of file PGFtypes.h.
#define DataTSize sizeof(DataT)
Definition at line 283 of file PGFtypes.h.
#define DownsampleThreshold 3
if quality is larger than this threshold than downsampling is used
Definition at line 65 of file PGFtypes.h.
#define HeaderSize sizeof(PGFHeader)
Definition at line 281 of file PGFtypes.h.
#define InterBlockSize 4
side length of a coefficient block in a HL or LH subband
Definition at line 87 of file PGFtypes.h.
#define LinBlockSize 8
side length of a coefficient block in a HH or LL subband
Definition at line 86 of file PGFtypes.h.
#define MagicVersionSize sizeof(PGFMagicVersion)
Definition at line 279 of file PGFtypes.h.
#define MaxBitPlanes 31
maximum number of bit planes of m_value: 32 minus sign bit
Definition at line 89 of file PGFtypes.h.
#define MaxBitPlanesLog 5
number of bits to code the maximum number of bit planes (in 32 or 16 bit mode)
Definition at line 93 of file PGFtypes.h.
#define MaxChannels 8
maximum number of (color) channels
Definition at line 64 of file PGFtypes.h.
#define MaxLevel 30
maximum number of transform levels
Definition at line 62 of file PGFtypes.h.
#define MaxQuality MaxBitPlanes
maximum quality
Definition at line 94 of file PGFtypes.h.
#define MaxUserDataSize 0x7FFFFFFF
Definition at line 284 of file PGFtypes.h.
#define NSubbands 4
number of subbands per level
Definition at line 63 of file PGFtypes.h.
#define PGF32 4
32 bit values are used -> allows at maximum 30 input bits, otherwise 16 bit values are used -> allows at maximum 14 input bits
Definition at line 69 of file PGFtypes.h.
#define PGFCodecVersion STRINGIZE(PPCAT(PPCAT(PPCAT(PPCAT(PGFMajorNumber, .), PGFYear), .), PGFWeek))
Definition at line 56 of file PGFtypes.h.
#define PGFCodecVersionID PPCAT(PPCAT(PPCAT(0x0, PGFMajorNumber), PGFYear), PGFWeek)
Definition at line 54 of file PGFtypes.h.
#define PGFMagic 'PGF'
PGF identification.
Definition at line 61 of file PGFtypes.h.
#define PGFMajorNumber 7
Definition at line 44 of file PGFtypes.h.
#define PGFROI 8
supports Regions Of Interest
Definition at line 70 of file PGFtypes.h.
#define PGFVersion (Version2 | PGF32 | Version5 | Version6 | Version7)
current standard version
Definition at line 76 of file PGFtypes.h.
#define PGFWeek 07
Definition at line 46 of file PGFtypes.h.
#define PGFYear 21
Definition at line 45 of file PGFtypes.h.
#define PPCAT( A, B)
Value:
PPCAT_NX(A, B)
Definition at line 49 of file PGFtypes.h.
#define PPCAT_NX( A, B)
Value:
A ## B
Definition at line 48 of file PGFtypes.h.
#define PreHeaderSize sizeof(PGFPreHeader)
Definition at line 280 of file PGFtypes.h.
#define RLblockSizeLen 15
block size length (< 16): ld(BufferSize) < RLblockSizeLen <= 2*ld(BufferSize)
Definition at line 85 of file PGFtypes.h.
#define STRINGIZE( A)
Value:
STRINGIZE_NX(A)
Definition at line 51 of file PGFtypes.h.
#define STRINGIZE_NX( A)
Value:
#A
Definition at line 50 of file PGFtypes.h.
#define Version2 2
data structure PGFHeader of major version 2
Definition at line 68 of file PGFtypes.h.
#define Version5 16
new coding scheme since major version 5
Definition at line 71 of file PGFtypes.h.
#define Version6 32
hSize in PGFPreHeader uses 32 bits instead of 16 bits
Definition at line 72 of file PGFtypes.h.
#define Version7 64
Codec major and minor version number stored in PGFHeader.
Definition at line 73 of file PGFtypes.h.
πΈ Typedef Documentation πΈ
typedef INT32 DataT
Definition at line 269 of file PGFtypes.h.
typedef void(* RefreshCB) (void *p)
Definition at line 274 of file PGFtypes.h.
π§ Enumeration Type Documentation π§
enum Orientation
Enumerator
LLHLLHHH
Definition at line 99 of file PGFtypes.h.
99 { LL = 0, HL = 1, LH = 2, HH = 3 };
enum ProgressMode
Enumerator
PM_RelativePM_Absolute
Definition at line 100 of file PGFtypes.h.
100 { PM_Relative, PM_Absolute };
enum UserdataPolicy
Enumerator
UP_SkipUP_CachePrefixUP_CacheAll
Definition at line 101 of file PGFtypes.h.
101 { UP_Skip = 0, UP_CachePrefix = 1, UP_CacheAll = 2 };
β Author β
Generated automatically by Doxygen for libpgf from the source code.
and that's the whole page bestie, you ate it up π
β¨ this was Version 7.21.2, dated Thu Jul 24 2025 00:00:00, and yeah β Doxygen really said "no thoughts, just output." go forth and #include responsibly, ily π«Άπ
π¦ where this page comes from
- fedora 43: libpgf-devel 7.21.7-8.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: libpgf-devel 7.21.7-8.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms