gimp r27544 - in trunk: . app/base app/core



Author: mitch
Date: Tue Nov  4 08:50:04 2008
New Revision: 27544
URL: http://svn.gnome.org/viewvc/gimp?rev=27544&view=rev

Log:
2008-11-04  Michael Natterer  <mitch gimp org>

	* app/base/tile-pyramid.[ch] (tile_pyramid_new): changed "type"
	parameter into "bytes" because tile managers don't care about
	the pixel format of their tiles. Reordered parameters to match
	tile_manager_new().

	* app/core/gimpprojection.c (gimp_projection_get_tiles_at_level):
	pass the bytes instead of the image type.



Modified:
   trunk/ChangeLog
   trunk/app/base/tile-pyramid.c
   trunk/app/base/tile-pyramid.h
   trunk/app/core/gimpprojection.c

Modified: trunk/app/base/tile-pyramid.c
==============================================================================
--- trunk/app/base/tile-pyramid.c	(original)
+++ trunk/app/base/tile-pyramid.c	Tue Nov  4 08:50:04 2008
@@ -32,12 +32,11 @@
 
 struct _TilePyramid
 {
-  GimpImageType  type;
-  guint          width;
-  guint          height;
-  gint           bytes;
-  TileManager   *tiles[PYRAMID_MAX_LEVELS];
-  gint           top_level;
+  guint        width;
+  guint        height;
+  gint         bytes;
+  TileManager *tiles[PYRAMID_MAX_LEVELS];
+  gint         top_level;
 };
 
 
@@ -61,9 +60,9 @@
 
 /**
  * tile_pyramid_new:
- * @type:   type of pixel data stored in the pyramid
  * @width:  bottom level width
  * @height: bottom level height
+ * @bytes:  the bpp of the pixel data stored in the pyramid
  *
  * Creates a new #TilePyramid, managing a set of tile-managers where
  * each level is a sized-down version of the level below.
@@ -79,9 +78,9 @@
  * Return value: a newly allocate #TilePyramid
  **/
 TilePyramid *
-tile_pyramid_new (GimpImageType  type,
-                  gint           width,
-                  gint           height)
+tile_pyramid_new (gint width,
+                  gint height,
+                  gint bytes)
 {
   TilePyramid *pyramid;
 
@@ -90,35 +89,11 @@
 
   pyramid = g_slice_new0 (TilePyramid);
 
-  pyramid->type   = type;
   pyramid->width  = width;
   pyramid->height = height;
+  pyramid->bytes  = bytes;
 
-  switch (type)
-    {
-    case GIMP_GRAY_IMAGE:
-      pyramid->bytes = 1;
-      break;
-
-    case GIMP_GRAYA_IMAGE:
-      pyramid->bytes = 2;
-      break;
-
-    case GIMP_RGB_IMAGE:
-      pyramid->bytes = 3;
-      break;
-
-    case GIMP_RGBA_IMAGE:
-      pyramid->bytes = 4;
-      break;
-
-    case GIMP_INDEXED_IMAGE:
-    case GIMP_INDEXEDA_IMAGE:
-      g_assert_not_reached ();
-      break;
-    }
-
-  pyramid->tiles[0] = tile_manager_new (width, height, pyramid->bytes);
+  pyramid->tiles[0] = tile_manager_new (width, height, bytes);
 
   return pyramid;
 }

Modified: trunk/app/base/tile-pyramid.h
==============================================================================
--- trunk/app/base/tile-pyramid.h	(original)
+++ trunk/app/base/tile-pyramid.h	Tue Nov  4 08:50:04 2008
@@ -29,9 +29,9 @@
  *  is "nlevels - 1". That level will be smaller than TILE_WIDTH x
  *  TILE_HEIGHT
  */
-TilePyramid * tile_pyramid_new               (GimpImageType      type,
-                                              gint               width,
-                                              gint               height);
+TilePyramid * tile_pyramid_new               (gint               width,
+                                              gint               height,
+                                              gint               bytes);
 void          tile_pyramid_destroy           (TilePyramid       *pyramid);
 
 gint          tile_pyramid_get_level         (gint               width,

Modified: trunk/app/core/gimpprojection.c
==============================================================================
--- trunk/app/core/gimpprojection.c	(original)
+++ trunk/app/core/gimpprojection.c	Tue Nov  4 08:50:04 2008
@@ -372,9 +372,9 @@
 
   if (! proj->pyramid)
     {
-      proj->pyramid = tile_pyramid_new (gimp_projection_get_image_type (proj),
-                                        gimp_image_get_width  (proj->image),
-                                        gimp_image_get_height (proj->image));
+      proj->pyramid = tile_pyramid_new (gimp_image_get_width  (proj->image),
+                                        gimp_image_get_height (proj->image),
+                                        gimp_projection_get_bytes (proj));
 
       tile_pyramid_set_validate_proc (proj->pyramid,
                                       (TileValidateProc) gimp_projection_validate_tile,



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