+static void gr_pixel_info(const gchar *text, GIOChannel *channel, gpointer data)
+{
+ gchar *pixel_info;
+ gint x_pixel, y_pixel;
+ gint width, height;
+ gint r_mouse, g_mouse, b_mouse;
+ PixbufRenderer *pr;
+ LayoutWindow *lw = NULL;
+
+ if (!layout_valid(&lw)) return;
+
+ pr = (PixbufRenderer*)lw->image->pr;
+
+ if (pr)
+ {
+ pixbuf_renderer_get_image_size(pr, &width, &height);
+ if (width < 1 || height < 1) return;
+
+ pixbuf_renderer_get_mouse_position(pr, &x_pixel, &y_pixel);
+
+ if (x_pixel >= 0 && y_pixel >= 0)
+ {
+ pixbuf_renderer_get_pixel_colors(pr, x_pixel, y_pixel,
+ &r_mouse, &g_mouse, &b_mouse);
+
+ pixel_info = g_strdup_printf(_("[%d,%d]: RGB(%3d,%3d,%3d)"),
+ x_pixel, y_pixel,
+ r_mouse, g_mouse, b_mouse);
+
+ g_io_channel_write_chars(channel, pixel_info, -1, NULL, NULL);
+ g_io_channel_write_chars(channel, "\n", -1, NULL, NULL);
+
+ g_free(pixel_info);
+ }
+ else
+ {
+ return;
+ }
+ }
+ else
+ {
+ return;
+ }
+}
+