-
Notifications
You must be signed in to change notification settings - Fork 72
XPM42
W2.Wizard edited this page Jan 30, 2022
·
26 revisions
As of writing this, XPM42 is still a bit WIP 🔨
XPM is a weird format, so much so that it doesn't know if it wants to be written in C or not. To introduce a simple to understand format thats not a complete mess, MLX42 has its own slightly modified format for xpm images.
-
!XPM42file type declaration. -
Width,Height,Color count,Mode
Width -> The widht 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
* #FF0000
. #000000
**..*...........
*.*.*...........
**..*..**.**..**
*.*.*.*.*.*..*.*
**..*..**.*...**
...............*
.............**.