#include "pixbuf_ops.h" #include "colors.h" /* In general, for 0 <= i < width and 0 <= j < height, the pixel (x + i, y + j) is colored with red value rgb_buf[j * rowstride + i * 3], green value rgb_buf[j * rowstride + i * 3 + 1], and blue value rgb_buf[j * rowstride + i * 3 + 2]. */ GdkPixbuf * select_rgb_composant( GdkPixbuf *original_pixbuf, float red, float green, float blue) { GdkPixbuf *red_pixbuf; guchar *pixels; int rowstride = gdk_pixbuf_get_rowstride (original_pixbuf); int width = gdk_pixbuf_get_width (original_pixbuf); int height = gdk_pixbuf_get_height (original_pixbuf); int i, j; /* copy the pixbuf */ red_pixbuf = gdk_pixbuf_copy (original_pixbuf); pixels = gdk_pixbuf_get_pixels (red_pixbuf); for (i=0; i