-
Notifications
You must be signed in to change notification settings - Fork 23
Tgx file
Julian Offenhäuser edited this page Jan 6, 2020
·
3 revisions
- Header (8 bytes)
- Compressed pixel data
struct TgxHeader {
uint32_t width;
uint32_t height;
};
Single uint16 (big-endian). First bit is unused, 5 bits red, 5 bits green, 5 bits blue.
Consists of 1-byte command tokens. The last 5 bits are used to store the length
of the following
pixel stream (add one).
The first 3 bits form the command. Valid commands are:
- 0x00: Raw pixel data,
length
number of pixels follow. - 0x01: Transparent pixels, skip
length
number of pixels (no bytes following) - 0x02: Repeating pixel, read one pixel and add
length
times to the image - 0x04: Line break, increase y and reset x position (no bytes following)