972
edits
[unchecked revision] | [unchecked revision] |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
||
Line 34:
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:
<
/**
* Parse TGA format into pixels. Returns NULL or error, otherwise the returned data looks like
Line 124:
return data;
}
</
===PNG, JPEG and other "professional" formats===
Line 130:
Instead, use [https://github.com/nothings/stb/blob/master/stb_image.h stb_image.h]. This is a single header file (no library linking needed, just libc), which is easy to use, for example the code to load PNG images looks like this:
<
#define STBI_IMPLEMENTATION
#define STBI_ONLYPNG
Line 166:
return data;
}
</
==See Also==
|