Commit 6f300a57 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

changed "type" parameter into "bytes" because tile managers don't care

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.


svn path=/trunk/; revision=27544
parent 2409d06d
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.
2008-11-04 Sven Neumann <sven@gimp.org>
* app/text/Makefile.am
......
......@@ -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 @@ static void tile_pyramid_write_upper_quarter (Tile *dest,
/**
* 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 @@ static void tile_pyramid_write_upper_quarter (Tile *dest,
* 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 @@ tile_pyramid_new (GimpImageType type,
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;
}
......
......@@ -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,
......
......@@ -372,9 +372,9 @@ gimp_projection_get_tiles_at_level (GimpProjection *proj,
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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment