Commit 789cc05b authored by Michael Natterer's avatar Michael Natterer 😴

libgimpwidgets: add new macro GIMP_CAIRO_RGB24_GET_PIXEL()

which reads a pixel from a cairo image surface's data.
parent 1e48f161
......@@ -61,6 +61,26 @@ cairo_surface_t * gimp_cairo_surface_create_from_pixbuf (GdkPixbuf *pixbuf);
#endif
/**
* GIMP_CAIRO_RGB24_GET_PIXEL:
* @s: pointer to the source buffer
* @r: red component
* @g: green component
* @b: blue component
*
* Gets a single pixel from a Cairo image surface in %CAIRO_FORMAT_RGB24.
*
* Since: GIMP 2.8
**/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b) \
G_STMT_START { (b) = s[0]; (g) = s[1]; (r) = s[2]; } G_STMT_END
#else
#define GIMP_CAIRO_RGB24_GET_PIXEL(s, r, g, b) \
G_STMT_START { (r) = s[1]; (g) = s[2]; (b) = s[3]; } G_STMT_END
#endif
/**
* GIMP_CAIRO_ARGB32_SET_PIXEL:
* @d: pointer to the destination buffer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment