From 8ecf0d7c4ceca635eb01235923e71d7b0657d698 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Wed, 14 Apr 2010 01:43:13 +0200 Subject: [PATCH] Added scaling and compositing pixbufs --- gdk/gdk.objects.lisp | 16 ++++++++++ gdk/gdk.pixbufs.lisp | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/gdk/gdk.objects.lisp b/gdk/gdk.objects.lisp index a7e6d65..880c2b1 100644 --- a/gdk/gdk.objects.lisp +++ b/gdk/gdk.objects.lisp @@ -435,6 +435,22 @@ (:bilevel 0) (:full 1)) +(define-g-enum "GdkInterpType" + gdk-interp-type + (:export t :type-initializer "gdk_interp_type_get_type") + (:nearest 0) + (:tiles 1) + (:bilinear 2) + (:hyper 3)) + +(define-g-enum "GdkPixbufRotation" + gdk-pixbuf-rotation + (:export t :type-initializer "gdk_pixbuf_rotation_get_type") + (:none 0) + (:counterclockwise 90) + (:upsidedown 180) + (:clockwise 270)) + (define-g-enum "GdkColorspace" colorspace () :rgb) diff --git a/gdk/gdk.pixbufs.lisp b/gdk/gdk.pixbufs.lisp index 91c7427..1908e96 100644 --- a/gdk/gdk.pixbufs.lisp +++ b/gdk/gdk.pixbufs.lisp @@ -106,3 +106,90 @@ (gdk-pixbuf-get-from-image pixbuf image (null-pointer) src-x src-y dest-x dest-y width height)) (export 'pixbuf-get-from-image) + +(defcfun gdk-pixbuf-scale-simple (g-object pixbuf :already-referenced) + (src (g-object pixbuf)) + (dest-width :int) + (dest-height :int) + (interp-type gdk-interp-type)) + +(defun pixbuf-scale-simple (pixbuf dest-width dest-height &key (interp-type :bilinear)) + (gdk-pixbuf-scale-simple pixbuf dest-width dest-height interp-type)) + +(export 'pixbuf-scale-simple) + +(defcfun (pixbuf-scale "gdk_pixbuf_scale") :void + (src (g-object pixbuf)) + (dest (g-object pixbuf)) + (dest-x :int) + (dest-y :int) + (dest-width :int) + (dest-height :int) + (offset-x :double) + (offset-y :double) + (scale-x :double) + (scale-y :double) + (interp-type gdk-interp-type)) + +(export 'pixbuf-scale) + +(defcfun (pixbuf-composite-color-simple "gdk_pixbuf_composite_color_simple") (g-object pixbuf :already-referenced) + (src (g-object pixbuf)) + (dest-width :int) + (dest-height :int) + (interp-type gdk-interp-type) + (overall-alpha :int) + (check-size :int) + (color-1 :uint32) + (color-2 :uint32)) + +(export 'pixbuf-composite-color-simple) + +(defcfun (pixbuf-composite "gdk_pixbuf_composite") :void + (src (g-object pixbuf)) + (dest (g-object pixbuf)) + (dest-x :int) + (dest-y :int) + (dest-width :int) + (dest-height :int) + (offset-x :double) + (offset-y :double) + (scale-x :double) + (scale-y :double) + (interp-type gdk-interp-type) + (overall-alpha :int)) + +(export 'pixbuf-composite) + +(defcfun (pixbuf-composite-color "gdk_pixbuf_composite_color") :void + (src (g-object pixbuf)) + (dest (g-object pixbuf)) + (dest-x :int) + (dest-y :int) + (dest-width :int) + (dest-height :int) + (offset-x :double) + (offset-y :double) + (scale-x :double) + (scale-y :double) + (interp-type gdk-interp-type) + (overall-alpha :int) + (check-x :int) + (check-y :int) + (check-size :int) + (color-1 :uint32) + (color-2 :uint32)) + +(export 'pixbuf-composite-color) + +(defcfun (pixbuf-rotate-simple "gdk_pixbuf_rotate_simple") (g-object pixbuf :already-referenced) + (src (g-object pixbuf)) + (angle gdk-pixbuf-rotation)) + +(export 'pixbuf-rotate-simple) + +(defcfun (pixbuf-flip "gdk_pixbuf_flip") (g-object pixbuf :already-referenced) + (src (g-object pixbuf)) + (horizontal :boolean)) + +(export 'pixbuf-flip) -- 1.7.10.4