app/base/pixel-region.[ch] code cleanup.

2006-07-06  Sven Neumann  <sven@gimp.org>

	* app/base/pixel-region.[ch]
	* app/base/tile-manager.h: code cleanup.
This commit is contained in:
Sven Neumann 2006-07-06 10:58:44 +00:00 committed by Sven Neumann
parent dc4517cd78
commit edcd73e9f0
4 changed files with 39 additions and 37 deletions

View File

@ -1,6 +1,8 @@
2006-07-06 Sven Neumann <sven@gimp.org> 2006-07-06 Sven Neumann <sven@gimp.org>
* app/base/temp-buf.[ch]: code cleanup. * app/base/pixel-region.[ch]
* app/base/temp-buf.[ch]
* app/base/tile-manager.h: code cleanup.
2006-07-05 Sven Neumann <sven@gimp.org> 2006-07-05 Sven Neumann <sven@gimp.org>

View File

@ -168,18 +168,18 @@ pixel_region_get_row (PixelRegion *PR,
gint boundary; gint boundary;
gint b; gint b;
gint npixels; gint npixels;
gint tilebpp; gint bpp;
end = x + w; end = x + w;
pixel_region_get_async (PR, x, y, end, y); pixel_region_get_async (PR, x, y, end, y);
tilebpp = tile_manager_bpp (PR->tiles); bpp = tile_manager_bpp (PR->tiles);
inc = subsample * tilebpp; inc = subsample * bpp;
if (subsample == 1) if (subsample == 1)
{ {
read_pixel_data (PR->tiles, x, y, end-1, y, data, tilebpp); read_pixel_data (PR->tiles, x, y, end-1, y, data, bpp);
} }
else else
{ {
@ -195,7 +195,7 @@ pixel_region_get_row (PixelRegion *PR,
boundary = x + npixels; boundary = x + npixels;
for ( ; x < boundary; x += subsample) for ( ; x < boundary; x += subsample)
{ {
for (b = 0; b < tilebpp; b++) for (b = 0; b < bpp; b++)
*data++ = tile_data[b]; *data++ = tile_data[b];
tile_data += inc; tile_data += inc;
@ -210,7 +210,7 @@ pixel_region_set_row (PixelRegion *PR,
gint x, gint x,
gint y, gint y,
gint w, gint w,
guchar *data) const guchar *data)
{ {
gint end; gint end;
gint bpp; gint bpp;
@ -234,7 +234,7 @@ pixel_region_get_col (PixelRegion *PR,
{ {
Tile *tile; Tile *tile;
guchar *tile_data; guchar *tile_data;
gint tilebpp; gint bpp;
gint inc; gint inc;
gint end; gint end;
gint boundary; gint boundary;
@ -244,7 +244,7 @@ pixel_region_get_col (PixelRegion *PR,
pixel_region_get_async (PR, x, y, x, end); pixel_region_get_async (PR, x, y, x, end);
tilebpp = tile_manager_bpp (PR->tiles); bpp = tile_manager_bpp (PR->tiles);
while (y < end) while (y < end)
{ {
@ -255,11 +255,11 @@ pixel_region_get_col (PixelRegion *PR,
if (boundary > end) /* make sure we don't write past the end */ if (boundary > end) /* make sure we don't write past the end */
boundary = end; boundary = end;
inc = subsample * tilebpp * tile_ewidth (tile); inc = subsample * bpp * tile_ewidth (tile);
for ( ; y < boundary; y += subsample) for ( ; y < boundary; y += subsample)
{ {
for (b = 0; b < tilebpp; b++) for (b = 0; b < bpp; b++)
*data++ = tile_data[b]; *data++ = tile_data[b];
tile_data += inc; tile_data += inc;
@ -275,18 +275,18 @@ pixel_region_set_col (PixelRegion *PR,
gint x, gint x,
gint y, gint y,
gint h, gint h,
guchar *data) const guchar *data)
{ {
gint tilebpp; gint bpp;
gint end; gint end;
end = y + h; end = y + h;
pixel_region_get_async (PR, x, y, x, end); pixel_region_get_async (PR, x, y, x, end);
tilebpp = tile_manager_bpp (PR->tiles); bpp = tile_manager_bpp (PR->tiles);
write_pixel_data (PR->tiles, x, y, x, end-1, data, tilebpp); write_pixel_data (PR->tiles, x, y, x, end-1, data, bpp);
} }
gboolean gboolean

View File

@ -101,7 +101,7 @@ void pixel_region_set_row (PixelRegion *PR,
gint x, gint x,
gint y, gint y,
gint w, gint w,
guchar *data); const guchar *data);
void pixel_region_get_col (PixelRegion *PR, void pixel_region_get_col (PixelRegion *PR,
gint x, gint x,
gint y, gint y,
@ -112,7 +112,7 @@ void pixel_region_set_col (PixelRegion *PR,
gint x, gint x,
gint y, gint y,
gint h, gint h,
guchar *data); const guchar *data);
gboolean pixel_region_has_alpha (PixelRegion *PR); gboolean pixel_region_has_alpha (PixelRegion *PR);
PixelRegionIterator * pixel_regions_register (gint num_regions, PixelRegionIterator * pixel_regions_register (gint num_regions,