gegl r2921 - in trunk/bindings/pygegl: . Gegl



Author: kcozens
Date: Thu Feb 19 18:53:04 2009
New Revision: 2921
URL: http://svn.gnome.org/viewvc/gegl?rev=2921&view=rev

Log:
2009-02-19  Kevin Cozens  <kcozens cvs gnome org>

        Fixes for compile problems due to changes in BABL 390 and GEGL 2851.

        * Gegl/gegl.defs: The gegl_color_(get|set)_rgba functions now use
        gdouble and not gfloat. Added support for gegl_color_get_rgba4f().

        * Gegl/gegl.override: The gegl_color_get_rgba function takes
        gdouble* and not gfloat*. Call babl_format_get_bytes_per_pixel() in
        gegl_node_render() instead of directly accessing member of struct.


Modified:
   trunk/bindings/pygegl/ChangeLog
   trunk/bindings/pygegl/Gegl/gegl.defs
   trunk/bindings/pygegl/Gegl/gegl.override

Modified: trunk/bindings/pygegl/Gegl/gegl.defs
==============================================================================
--- trunk/bindings/pygegl/Gegl/gegl.defs	(original)
+++ trunk/bindings/pygegl/Gegl/gegl.defs	Thu Feb 19 18:53:04 2009
@@ -397,10 +397,19 @@
   (c-name "gegl_color_get_rgba")
   (return-type "none")
   (parameters
-    '("gfloat*" "r")
-    '("gfloat*" "g")
-    '("gfloat*" "b")
-    '("gfloat*" "a")
+    '("gdouble*" "r")
+    '("gdouble*" "g")
+    '("gdouble*" "b")
+    '("gdouble*" "a")
+  )
+)
+
+(define-method get_rgba4f
+  (of-object "GeglColor")
+  (c-name "gegl_color_get_rgba4f")
+  (return-type "none")
+  (parameters
+    '("gfloat*" "buf")
   )
 )
 
@@ -409,10 +418,10 @@
   (c-name "gegl_color_set_rgba")
   (return-type "none")
   (parameters
-    '("gfloat" "r")
-    '("gfloat" "g")
-    '("gfloat" "b")
-    '("gfloat" "a")
+    '("gdouble" "r")
+    '("gdouble" "g")
+    '("gdouble" "b")
+    '("gdouble" "a")
   )
 )
 

Modified: trunk/bindings/pygegl/Gegl/gegl.override
==============================================================================
--- trunk/bindings/pygegl/Gegl/gegl.override	(original)
+++ trunk/bindings/pygegl/Gegl/gegl.override	Thu Feb 19 18:53:04 2009
@@ -128,11 +128,20 @@
 static PyObject *
 _wrap_gegl_color_get_rgba(PyGObject *self)
 {
-    float r, g, b, a;
+    gdouble r, g, b, a;
     gegl_color_get_rgba(GEGL_COLOR(self->obj), &r, &g, &b, &a);
     return Py_BuildValue("ffff", r, g, b, a);
 }
 %%
+override gegl_color_get_rgba4f noargs
+static PyObject *
+_wrap_gegl_color_get_rgba4f(PyGObject *self)
+{
+    gfloat *buf;
+    gegl_color_get_rgba4f(GEGL_COLOR(self->obj), &buf);
+    return Py_BuildValue("O", buf);
+}
+%%
 override gegl_list_operations noargs
 static PyObject *
 _wrap_gegl_list_operations(PyObject *self)
@@ -492,7 +501,7 @@
         return NULL;
     }
 
-    buflen = roi.width * roi.height * format->format.bytes_per_pixel;
+    buflen = roi.width * roi.height * babl_format_get_bytes_per_pixel (format);
     buf = g_try_malloc(buflen);
     if (!buf) {
         PyErr_SetString(PyExc_MemoryError,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]