summaryrefslogtreecommitdiff
path: root/packages/gtk+/pixops-test/pixops-test.c
blob: 33a11263defec5f8f1692c3fd043212ba01ffa76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

static gdouble total_seconds = 0.0;


int
main (int argc, char **argv)
{
        GTimer *timer;

        gtk_init (&argc, &argv);


	GdkPixbuf *pixbuf, *ret;
	pixbuf = gdk_pixbuf_new_from_file("/usr/share/pixop-test/gtk-logo-rgb.gif", NULL);

	timer = g_timer_new ();
	g_timer_start (timer);

	int i;

	for (i = 1; i <= 100 ; i++) {
		ret = gdk_pixbuf_scale_simple (pixbuf, 800, 600, GDK_INTERP_BILINEAR);
		ret = gdk_pixbuf_scale_simple (pixbuf, 300, 400, GDK_INTERP_BILINEAR);
	}
	g_timer_stop (timer);

	total_seconds += g_timer_elapsed (timer, NULL);
        
        gtk_main ();

        g_print ("time spent scaling (in seconds): %lf\n",  total_seconds );

        return 0;
}