972
edits
[unchecked revision] | [unchecked revision] |
(Don't link to ancient version of stb_image that doesn't even have the functions this references.) |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
||
Line 14:
===Targa===
A much better choice would be Targa format (.tga). It is a very very simple format, used by many game engines (like Quake) too. Essentially you can save uncompressed bitmap images with a 18 bytes header:
<
typedef struct {
unsigned char magic1; // must be zero
Line 28:
unsigned char pixeltype; // must be 40
} __attribute__((packed)) tga_header_t;
</
<
$ convert image.png image.tga
</
If you want to support all TGA options, including palette images and RLE compression, then that's still pretty simple. Just use the following code snippet:
|