PGFtypes.h(3)

πŸ“¦
version 7.21.7 Β· 4 versions
, in fedora 43

πŸ’– 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 structure PGFHeader of 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 β€” hSize in PGFPreHeader uses 32 bits instead of 16 bits.
  • #define Version7 64 β€” Codec major and minor version number stored in PGFHeader.
  • #define PGFVersion (Version2 | PGF32 | Version5 | Version6 | Version7) β€” current standard version.
  • #define BufferSize 16384 β€” must be a multiple of WordWidth, 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 of m_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 DataT
  • typedef 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

  • LL
  • HL
  • LH
  • HH

Definition at line 99 of file PGFtypes.h.

99 { LL = 0, HL = 1, LH = 2, HH = 3 };

enum ProgressMode

Enumerator

  • PM_Relative
  • PM_Absolute

Definition at line 100 of file PGFtypes.h.

100 { PM_Relative, PM_Absolute };

enum UserdataPolicy

Enumerator

  • UP_Skip
  • UP_CachePrefix
  • UP_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