-
Notifications
You must be signed in to change notification settings - Fork 72
XPM42
MLX42, like MiniLibX offers built-in support for the XPM format however it implements its own variation of it due to design conflicts regarding the XPM3 variant. XPM overall is a weird format, so much so that it doesn't know if it wants to be written in C or not.
The goal of XPM42 is to introduce a simple to understand format that's not a complete mess.
XPM42 supports up to 255 unique characters for individual pixel colors. It also supports transparency via an RGBA8 format in a hexadecimal representation.
-
!XPM42file type declaration. -
Width,Height,Color count,Mode
Width -> The width of the image.
Height -> The height of the image.
Color count -> The number of colors in the image.
Mode -> A single character specifying the mode, can be `c` for Color or `m` for monochrome.
Monochrome will basically create a black and white equivalent of the image.
The table consistes of a character, followed by a space, finally the color value itself.
E.g:
* #FF0000
For transparent pixels, a value of NULL can be specified. *
*As of writing this, this feature is not available yet.
After the colors come the literal pixel data, each character will be looked up and the appropriate color is inserted in the pixel buffer
!XPM42
16 7 2 c
* #FF0000FF
. #00000000
**..*...........
*.*.*...........
**..*..**.**..**
*.*.*.*.*.*..*.*
**..*..**.*...**
...............*
.............**.