A bitmap definition consists of:
- a variable length integer representing the width of the bitmap in pixels.
- a variable length integer representing the height of the bitmap in pixels.
- 8 bits representing the number of bits per pixel for this bitmap (values not in the 0-7 range are an error).
Then, if the number of bits per pixel is zero:
- 8 bits representing the type of the bitmap.
For type 0 (paletted bitmap):
- 8 bits for the encoding of this bitmap
For encoding 1 (RLE encoding):
All other encodings are reserved. If one is encountered, the bitmap cannot be decoded.
For type 1 (PNG bitmap):
- 32 bits for the number of bytes used for this bitmap's data.
- That number of bytes, interpreted as a raw PNG stream.
All other types are reserved. If one is encountered, the bitmap cannot be decoded.
If the number of bits per pixel is greater than zero (deprecated):
- a variable length integer representing the index of the default palette to use for this bitmap (-1 for no default palette).
- a stream of bits representing the pixel indices for this bitmap, rows first, packed (eg, N bits for the first pixel, N bits for the second one, etc, N being the number of bits per pixel specified above)
Next, we have a warp.
Bitstream version 0.4 starts making use of this warp:
Kate bitstream 0.6 makes further use of this warp to add:
Next, the data ends.