Gaffer Docs

GAB - Bitmap Image File Format

GAB files contain bitmapped image data. Each file has a fixed header, followed by pixel data, followed by a CRC32 for the entire file up to the CRC.

Pixel data is oriented such that (0, 0) is the lower left corner of image and (1, 1) is the upper right corer of image. This is how OpenGL expects pixel data to be oriented, but is contrary to most image formats.

File Sections

Fixed Header 16 bytes
Pixel Data Variable size. Width * Height * pixel size.
CRC32 4 bytes. CRC32 is computed for entire file except for this 4 byte section.

Fixed Header Details

Size (bytes) Purpose
4 LE Signature: 0x1a42414d ("GAB\x1a")
1 File format version number. Currently should always be 1.
1 Pixel type:
  • 'A' = 32 bit (rbga)
  • 'B' = 24 bit (rgb)
  • 'C' = 16 bit (rgba: 4, 4, 4, 4)
  • 'D' = 16 bit (rgba: 5, 5, 5, 1)
  • 'E' = 16 bit (rgb: 5, 6, 5)
  • 'F' = 8 bit (gray scale)
2 Width in pixels (unsigned short)
2 Height in pixels (unsigned short)
6 Reserved for future use