gegl r1866 - in trunk: . operations/blur



Author: kcozens
Date: Fri Jan 18 18:34:17 2008
New Revision: 1866
URL: http://svn.gnome.org/viewvc/gegl?rev=1866&view=rev

Log:
2008-01-18  Kevin Cozens  <kcozens cvs gnome org>

	* configure.ac: Changed library API version to be based on the
	major/minor number.

	* operations/blur/box-blur.c:
	* operations/blur/gaussian-blur.c: Use gegl_buffer_get_pixel_count()
	instead of getting width/height separately and doing the math.


Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/operations/blur/box-blur.c
   trunk/operations/blur/gaussian-blur.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Jan 18 18:34:17 2008
@@ -24,8 +24,8 @@
 m4_define([gegl_binary_age],
           [m4_eval(100 * gegl_minor_version + gegl_micro_version)])
 
-dnl The X.Y in -lgegl-X.Y line. This is expected to stay 1.0 until Gegl 2.
-m4_define([gegl_api_version], [1.0])
+dnl The X.Y in -lgegl-X.Y line. This is expected to stay 0.0 until Gegl 1.
+m4_define([gegl_api_version], [gegl_major_version.gegl_minor_version])
 
 m4_define([stability_version_number],
           m4_if(m4_eval(gegl_major_version || gegl_minor_version), [0], 

Modified: trunk/operations/blur/box-blur.c
==============================================================================
--- trunk/operations/blur/box-blur.c	(original)
+++ trunk/operations/blur/box-blur.c	Fri Jan 18 18:34:17 2008
@@ -16,7 +16,7 @@
  * Copyright 2006 Ãyvind KolÃs <pippin gimp org>
  */
 #if GEGL_CHANT_PROPERTIES
- 
+
 gegl_chant_double (radius, 0.0, 200.0, 4.0,
   "Radius of square pixel region, (width and height will be radius*2+1.")
 
@@ -179,7 +179,7 @@
                              1 + radius*2,
                              1,
                              components);
-        
+
         for (i=0; i<4; i++)
           dst_buf [offset++] = components[i];
       }
@@ -201,9 +201,9 @@
   gfloat *src_buf;
   gfloat *dst_buf;
 
-  src_buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
-  dst_buf = g_malloc0 (gegl_buffer_get_width (dst) * gegl_buffer_get_height (dst) * 4 * 4);
-  
+  src_buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
+  dst_buf = g_malloc0 (gegl_buffer_get_pixel_count (dst) * 4 * 4);
+
   gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
   offset=0;
@@ -221,7 +221,7 @@
                              1,
                              1 + radius * 2,
                              components);
-        
+
         for (c=0; c<4; c++)
           dst_buf [offset++] = components[c];
       }

Modified: trunk/operations/blur/gaussian-blur.c
==============================================================================
--- trunk/operations/blur/gaussian-blur.c	(original)
+++ trunk/operations/blur/gaussian-blur.c	Fri Jan 18 18:34:17 2008
@@ -123,7 +123,7 @@
       {
         cmatrix_len =
             fir_gen_convolve_matrix (self->std_dev_y, &cmatrix);
-        fir_ver_blur (temp, output, cmatrix, cmatrix_len, 
+        fir_ver_blur (temp, output, cmatrix, cmatrix_len,
          self->std_dev_x * RADIUS_SCALE, self->std_dev_y * RADIUS_SCALE);
         g_free (cmatrix);
       }
@@ -259,7 +259,7 @@
   gfloat *buf;
   gfloat *w;
 
-  buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
+  buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
   w   = g_malloc0 (gegl_buffer_get_height (src) * 4);
 
   gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), buf, GEGL_AUTO_ROWSTRIDE);
@@ -376,8 +376,8 @@
   gfloat *src_buf;
   gfloat *dst_buf;
 
-  src_buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
-  dst_buf = g_malloc0 (gegl_buffer_get_width (dst) * gegl_buffer_get_height (dst) * 4 * 4);
+  src_buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
+  dst_buf = g_malloc0 (gegl_buffer_get_pixel_count (dst) * 4 * 4);
 
   gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 
@@ -418,8 +418,8 @@
   gfloat *src_buf;
   gfloat *dst_buf;
 
-  src_buf = g_malloc0 (gegl_buffer_get_width (src) * gegl_buffer_get_height (src) * 4 * 4);
-  dst_buf = g_malloc0 (gegl_buffer_get_width (dst) * gegl_buffer_get_height (dst) * 4 * 4);
+  src_buf = g_malloc0 (gegl_buffer_get_pixel_count (src) * 4 * 4);
+  dst_buf = g_malloc0 (gegl_buffer_get_pixel_count (dst) * 4 * 4);
 
   gegl_buffer_get (src, 1.0, NULL, babl_format ("RaGaBaA float"), src_buf, GEGL_AUTO_ROWSTRIDE);
 



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