[cairo] Loading an image from a C source file, exported from e.g. GIMP

Rafał Jopek rafaljopek at hotmail.com
Thu Oct 13 09:21:55 UTC 2022


Hi,

Below is a sample image code generated in GIMP
What will the function in Cairo that allows drawing directly onto a surface generated source code in C.

```
#define GIMP_IMAGE_WIDTH (4)
#define GIMP_IMAGE_HEIGHT (4)
#define GIMP_IMAGE_BYTES_PER_PIXEL (4) /* 2:RGB16, 3:RGB, 4:RGBA */
#define GIMP_IMAGE_PIXEL_DATA ((unsigned char*) GIMP_IMAGE_pixel_data)
static const unsigned char GIMP_IMAGE_pixel_data[4 * 4 * 4 + 1] =
("\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\377\377\377\377\000\000\000\000\377\377\377\377\000"
 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\377\377\377\377\000\000\000\000\377"
 "\377\377\377");

```

Kind regards,
-- Rafał

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20221013/f60bb27b/attachment.htm>


More information about the cairo mailing list