PTF

Table of contents


Format

  • Current version is 0.0
  • File extension is .ptf
  • Data is little endian
  • LZ4F is used for compression
TypeDescription
HeaderFile header
DataImage data

TypeValueDescription
char[3]{'P', 'T', 'F'}Header magic
u80Major version
u8InfoInfo
u8ResolutionResolution
Info
Bits (LSB to MSB)ValueDescription
0..1Pixel formatPixel data format
2..30Reserved
4..7FlagsFlags
Flags
Bits (LSB to MSB)ValueDescription
0..30Reserved
Pixel format
NameValue
PTF_FRMT_I0
PTF_FRMT_IA1
PTF_FRMT_RGB2
PTF_FRMT_RGBA3
Resolution
Bits (LSB to MSB)Description
0..3Width (2^n)
4..7Height (2^n)

Data

TypeValueDescription
u8[]Compressed ‘I pixel × 1…’, ‘IA pixel × 1…’, ‘RGB pixel × 1…’, or ‘RGBA pixel × 1…’Pixel data

I pixel

TypeDescription
u8Intensity

IA pixel

TypeDescription
u8[2]Intensity and alpha

RGB pixel

TypeDescription
u8[3]Red, green, and blue

RGBA pixel

TypeDescription
u8[4]Red, green, blue, and alpha