3 The basename() function returns a pointer to internal static storage
4 space that will be overwritten by subsequent calls.
6 $ rkpng2c about.png about_png.c rk_about_png
10 * Generated with png2c
11 * File name: about.png
12 * Image size name: 0x0
15 const unsigned char about.png[] = {
19 --- tools/rkpng2c.c.orig 2020-10-25 12:39:57 UTC
22 #define RK_VERSION_STR "1.0.0"
30 #include <cairo/cairo.h>
32 @@ -57,13 +61,23 @@ int main(int argc , char **argv)
35 const unsigned char *buff = cairo_image_surface_get_data(image);
37 + char *b1 = strdup(basename(argv[1]));
38 + char *b3 = strdup(basename(argv[3]));
41 " * Generated with rkpng2c version %s, part of Redkite GUI toolkit.\n"
43 " * Image size: %dx%d\n"
47 + "const unsigned char %s[] = {\n", RK_VERSION_STR, b1, w, h, b3);
51 "const unsigned char %s[] = {\n", RK_VERSION_STR, basename(argv[1]), w, h, basename(argv[3]));
53 for (int i = 0; i < w * h * 4; i++) {
54 if ((i + 1) == 12 || (i + 1) % 12 == 0)
55 fprintf(fptr, "0x%02x,\n", buff[i]);