When using Gimp you may want to export your image to "C source code". You then get an option dialog where you can check "Use 1 byte Run-Length-Encoding" (which is what the data in rle_pixel_data is encoded with as well). Using the "C source code header" exporter doesn't give you that option resulting in way larger image data strings.
customize the logo image dosbox in gui "dosbox_splash.h"
-
26-06-2022 - |
Domanda
i need customize the logo image dosbox in gui "dosbox_splash.h", but the format is .h
like this ---
static const struct {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
unsigned char rle_pixel_data[24875 + 1];
} gimp_image = {
640, 400, 3,
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
"\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
"\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
"\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
"\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
"\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
"\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
"\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
"=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
i use gimp for windows and not create the same format, when compile have the error initializer string for array of chars is too long
my format
static const struct {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
unsigned char pixel_data[640 * 400 * 3 + 1];
} gimp_image = {
640, 400, 3,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
"\1\1\1\1\1\1\1\1\1\1\1\3\1\4\2\0\3\2\2\4\0\0\4\1\4\11\34!%\341\346\352\365"
"\375\377\367\377\377\357\364\367\373\377\377\367\371\370\377\376\374\377"
"\374\371\377\373\367\374\367\363\245\240\234#\40\33\5\1\0\1\0\0\5\3\4\0\0"
"\2\10\10\12\3\4\10\1\2\6\1\2\6\1\2\6\0\1\3\1\1\1\1\1\1\1\1\0\2\1\0\2\0\3"
Soluzione
Altri suggerimenti
or take a look at http://forum.xda-developers.com/showthread.php?t=1140406 it looks like converting tool from images to rle...
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow