ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/CV.xs
(Generate patch)

Comparing CV/CV.xs (file contents):
Revision 1.42 by root, Sun Sep 14 12:47:59 2008 UTC vs.
Revision 1.44 by root, Sun Dec 30 16:23:23 2012 UTC

13#include <gtk/gtk.h> 13#include <gtk/gtk.h>
14#include <gdk-pixbuf/gdk-pixbuf.h> 14#include <gdk-pixbuf/gdk-pixbuf.h>
15 15
16#include <gperl.h> 16#include <gperl.h>
17#include <gtk2perl.h> 17#include <gtk2perl.h>
18
19#include <assert.h>
18 20
19#define IW 80 /* MUST match Schnauzer.pm! */ 21#define IW 80 /* MUST match Schnauzer.pm! */
20#define IH 60 /* MUST match Schnauzer.pm! */ 22#define IH 60 /* MUST match Schnauzer.pm! */
21 23
22#define RAND (seed = (seed + 7141) * 54773 % 134456) 24#define RAND (seed = (seed + 7141) * 54773 % 134456)
290 RETVAL 292 RETVAL
291 293
292GdkPixbuf_noinc * 294GdkPixbuf_noinc *
293rotate (GdkPixbuf *pb, int angle) 295rotate (GdkPixbuf *pb, int angle)
294 CODE: 296 CODE:
297 if (angle < 0)
298 angle += 360;
295 RETVAL = gdk_pixbuf_rotate_simple (pb, angle == 0 ? GDK_PIXBUF_ROTATE_NONE 299 RETVAL = gdk_pixbuf_rotate_simple (pb, angle == 0 ? GDK_PIXBUF_ROTATE_NONE
296 : angle == 90 ? GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE 300 : angle == 90 ? GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE
297 : angle == 180 ? GDK_PIXBUF_ROTATE_UPSIDEDOWN 301 : angle == 180 ? GDK_PIXBUF_ROTATE_UPSIDEDOWN
298 : angle == 270 ? GDK_PIXBUF_ROTATE_CLOCKWISE 302 : angle == 270 ? GDK_PIXBUF_ROTATE_CLOCKWISE
299 : angle); 303 : angle);
400compare (GdkPixbuf *a, GdkPixbuf *b) 404compare (GdkPixbuf *a, GdkPixbuf *b)
401 PPCODE: 405 PPCODE:
402{ 406{
403 int w = gdk_pixbuf_get_width (a); 407 int w = gdk_pixbuf_get_width (a);
404 int h = gdk_pixbuf_get_height (a); 408 int h = gdk_pixbuf_get_height (a);
409
405 int sa = gdk_pixbuf_get_rowstride (a); 410 int sa = gdk_pixbuf_get_rowstride (a);
406 int sb = gdk_pixbuf_get_rowstride (b); 411 int sb = gdk_pixbuf_get_rowstride (b);
407 412
408 guchar *pa = gdk_pixbuf_get_pixels (a); 413 guchar *pa = gdk_pixbuf_get_pixels (a);
409 guchar *pb = gdk_pixbuf_get_pixels (b); 414 guchar *pb = gdk_pixbuf_get_pixels (b);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines