gegl r1859 - in trunk: . gegl/buffer



Author: neo
Date: Fri Jan 18 11:05:56 2008
New Revision: 1859
URL: http://svn.gnome.org/viewvc/gegl?rev=1859&view=rev

Log:
2008-01-18  Sven Neumann  <sven gimp org>

	* gegl/buffer/gegl-storage.c
	* gegl/buffer/gegl-buffer.c: minor cleanups, mainly formatting.


Modified:
   trunk/ChangeLog
   trunk/gegl/buffer/gegl-buffer.c
   trunk/gegl/buffer/gegl-storage.c

Modified: trunk/gegl/buffer/gegl-buffer.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer.c	(original)
+++ trunk/gegl/buffer/gegl-buffer.c	Fri Jan 18 11:05:56 2008
@@ -217,11 +217,8 @@
 static void
 gegl_buffer_dispose (GObject *object)
 {
-  GeglBuffer    *buffer;
-  GeglHandler *handler;
-
-  buffer = (GeglBuffer *) object;
-  handler  = GEGL_HANDLER (object);
+  GeglBuffer  *buffer  = GEGL_BUFFER (object);
+  GeglHandler *handler = GEGL_HANDLER (object);
 
   gegl_buffer_sample_cleanup (buffer);
 
@@ -242,7 +239,8 @@
 
   de_allocated_buffers++; /* XXX: is it correct to count that, shouldn't that
                              only be counted in finalize? */
-  (*G_OBJECT_CLASS (parent_class)->dispose)(object);
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
 static GeglTileBackend *
@@ -385,7 +383,7 @@
   else if (buffer->abyss.width == -1 ||
            buffer->abyss.height == -1)
     {
-      buffer->abyss.x      = GEGL_BUFFER (provider)->abyss.x - buffer->shift_x; 
+      buffer->abyss.x      = GEGL_BUFFER (provider)->abyss.x - buffer->shift_x;
       buffer->abyss.y      = GEGL_BUFFER (provider)->abyss.y - buffer->shift_y;
       buffer->abyss.width  = GEGL_BUFFER (provider)->abyss.width;
       buffer->abyss.height = GEGL_BUFFER (provider)->abyss.height;
@@ -506,11 +504,8 @@
 static void
 gegl_buffer_class_init (GeglBufferClass *class)
 {
-  GObjectClass       *gobject_class;
-  GeglProviderClass *tile_provider_class;
-
-  gobject_class    = (GObjectClass *) class;
-  tile_provider_class = (GeglProviderClass *) class;
+  GObjectClass      *gobject_class       = G_OBJECT_CLASS (class);
+  GeglProviderClass *tile_provider_class = GEGL_PROVIDER_CLASS (class);
 
   parent_class                = g_type_class_peek_parent (class);
   gobject_class->dispose      = gegl_buffer_dispose;
@@ -586,10 +581,11 @@
 static void
 gegl_buffer_init (GeglBuffer *buffer)
 {
-  buffer->extent.x            = 0;
-  buffer->extent.y            = 0;
-  buffer->extent.width        = 0;
-  buffer->extent.height       = 0;
+  buffer->extent.x      = 0;
+  buffer->extent.y      = 0;
+  buffer->extent.width  = 0;
+  buffer->extent.height = 0;
+
   buffer->shift_x      = 0;
   buffer->shift_y      = 0;
   buffer->abyss.x      = 0;
@@ -1025,7 +1021,7 @@
       gint tiledy  = buffer_y + bufy;
       gint offsety = gegl_tile_offset (tiledy, tile_height);
 
-      
+
 
       gint bufx    = 0;
 
@@ -1133,7 +1129,7 @@
                             if (buffer_y + y >= buffer_abyss_y &&
                                 buffer_y + y < abyss_y_total)
                               {
-                                babl_process (fish, bp + lskip * bpx_size, tp + lskip * px_size, 
+                                babl_process (fish, bp + lskip * bpx_size, tp + lskip * px_size,
                                  pixels - lskip - rskip);
                               }
 
@@ -1319,7 +1315,7 @@
 }
 #endif
 
-/* Optimized|obfuscated version of the nearest neighbour resampler 
+/* Optimized|obfuscated version of the nearest neighbour resampler
  * XXX: seems to contains some very slight inprecision in the rendering.
  */
 static void resample_nearest (void   *dest_buf,
@@ -1351,7 +1347,7 @@
       guchar *src_base;
       guint sx;
       guint px = 0;
-      guchar *src;      
+      guchar *src;
 
       if (sy >= source_h << 16)
         sy = (source_h - 1) << 16;
@@ -1442,8 +1438,8 @@
   guint         middle_weight;
   guint         bottom_weight;
 
-  footprint_y = (1.0 / scale) * 256; 
-  footprint_x = (1.0 / scale) * 256; 
+  footprint_y = (1.0 / scale) * 256;
+  footprint_x = (1.0 / scale) * 256;
   foosum = footprint_x * footprint_y;
 
   if (rowstride != GEGL_AUTO_ROWSTRIDE)
@@ -1635,7 +1631,7 @@
       sample_buf = g_malloc (buf_width * buf_height * bpp);
       gegl_buffer_get_scaled (buffer, &sample_rect, sample_buf, GEGL_AUTO_ROWSTRIDE, format, level);
 
-      if (BABL (format)->format.type[0] == (BablType *) babl_type ("u8") 
+      if (BABL (format)->format.type[0] == (BablType *) babl_type ("u8")
           && !(level == 0 && scale > 1.99))
         { /* do box-filter resampling if we're 8bit (which projections are) */
 
@@ -1769,7 +1765,7 @@
                        NULL);
 }
 
-GeglBuffer* 
+GeglBuffer*
 gegl_buffer_create_sub_buffer (GeglBuffer          *buffer,
                                const GeglRectangle *extent)
 {

Modified: trunk/gegl/buffer/gegl-storage.c
==============================================================================
--- trunk/gegl/buffer/gegl-storage.c	(original)
+++ trunk/gegl/buffer/gegl-storage.c	Fri Jan 18 11:05:56 2008
@@ -149,18 +149,6 @@
     }
 }
 
-static void
-gegl_storage_dispose (GObject *object)
-{
-  GeglStorage   *storage;
-  GeglHandler *handler;
-
-  storage = (GeglStorage *) object;
-  handler   = GEGL_HANDLER (object);
-
-  (*G_OBJECT_CLASS (parent_class)->dispose)(object);
-}
-
 static gboolean
 storage_idle (gpointer data)
 {
@@ -173,7 +161,7 @@
     }
 
   gegl_provider_message (GEGL_PROVIDER (storage),
-                           GEGL_TILE_IDLE, 0, 0, 0, NULL);
+                         GEGL_TILE_IDLE, 0, 0, 0, NULL);
 
   return TRUE;
 }
@@ -189,10 +177,11 @@
   GeglHandlers   *handlers;
   GeglHandler    *handler;
 
-  object  = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
-  storage = GEGL_STORAGE (object);
-  handlers  = GEGL_HANDLERS (storage);
-  handler   = GEGL_HANDLER (storage);
+  object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
+
+  storage  = GEGL_STORAGE (object);
+  handlers = GEGL_HANDLERS (storage);
+  handler  = GEGL_HANDLER (storage);
 
   if (storage->path != NULL)
     {
@@ -215,19 +204,11 @@
                                             NULL),
                     NULL);
     }
-  {
-    gint tile_size;
-    gint px_size;
-
-    g_object_get (handler->provider,
-                  "tile-size", &tile_size,
-                  "px-size", &px_size,
-                  NULL);
-    g_object_set (object,
-                  "tile-size", tile_size,
-                  "px-size", px_size,
-                  NULL);
-  }
+
+  g_object_get (handler->provider,
+                "tile-size", &storage->tile_size,
+                "px-size",   &storage->px_size,
+                NULL);
 
   if (1) gegl_handlers_add (handlers, g_object_new (GEGL_TYPE_HANDLER_CACHE,
                                                   "size", 256,
@@ -265,14 +246,9 @@
 static void
 gegl_storage_class_init (GeglStorageClass *class)
 {
-  GObjectClass       *gobject_class;
-  GeglProviderClass *tile_store_class;
-
-  gobject_class    = (GObjectClass *) class;
-  tile_store_class = (GeglProviderClass *) class;
+  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
 
   parent_class                = g_type_class_peek_parent (class);
-  gobject_class->dispose      = gegl_storage_dispose;
   gobject_class->constructor  = gegl_storage_constructor;
   gobject_class->set_property = set_property;
   gobject_class->get_property = get_property;



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