From 3278d5079ad2d86a97bb495e3c75f91494ebf690 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 14 Feb 2007 07:19:19 +0000 Subject: pixop-test: adds new enhanced version written by Rob Taylor --- packages/gtk+/pixops-test/pixops-test.c | 51 +++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 9 deletions(-) (limited to 'packages/gtk+/pixops-test/pixops-test.c') diff --git a/packages/gtk+/pixops-test/pixops-test.c b/packages/gtk+/pixops-test/pixops-test.c index 33a11263de..f8906dfc42 100644 --- a/packages/gtk+/pixops-test/pixops-test.c +++ b/packages/gtk+/pixops-test/pixops-test.c @@ -1,35 +1,68 @@ #include #include +#include static gdouble total_seconds = 0.0; +/* randomly colour each pixel */ +static void +fill_pixbuf (GdkPixbuf *buf) +{ + int width, height, rowstride, n_channels; + int x,y,n; + guchar *pixels, *p; + + g_assert (gdk_pixbuf_get_bits_per_sample (buf) == 8); + + n_channels = gdk_pixbuf_get_n_channels (buf); + width = gdk_pixbuf_get_width (buf); + height = gdk_pixbuf_get_height (buf); + rowstride = gdk_pixbuf_get_rowstride (buf); + pixels = gdk_pixbuf_get_pixels (buf); + + for (x=0; x