Added scaling and compositing pixbufs
authorOlof-Joachim Frahm <Olof.Frahm@web.de>
Tue, 13 Apr 2010 23:43:13 +0000 (01:43 +0200)
committerOlof-Joachim Frahm <Olof.Frahm@web.de>
Tue, 13 Apr 2010 23:43:13 +0000 (01:43 +0200)
gdk/gdk.objects.lisp
gdk/gdk.pixbufs.lisp

index a7e6d65..880c2b1 100644 (file)
   (: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)
 
index 91c7427..1908e96 100644 (file)
   (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)