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>
* 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>

View file

@ -168,18 +168,18 @@ pixel_region_get_row (PixelRegion *PR,
gint boundary;
gint b;
gint npixels;
gint tilebpp;
gint bpp;
end = x + w;
pixel_region_get_async (PR, x, y, end, y);
tilebpp = tile_manager_bpp (PR->tiles);
inc = subsample * tilebpp;
bpp = tile_manager_bpp (PR->tiles);
inc = subsample * bpp;
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
{
@ -195,7 +195,7 @@ pixel_region_get_row (PixelRegion *PR,
boundary = x + npixels;
for ( ; x < boundary; x += subsample)
{
for (b = 0; b < tilebpp; b++)
for (b = 0; b < bpp; b++)
*data++ = tile_data[b];
tile_data += inc;
@ -206,14 +206,14 @@ pixel_region_get_row (PixelRegion *PR,
}
void
pixel_region_set_row (PixelRegion *PR,
gint x,
gint y,
gint w,
guchar *data)
pixel_region_set_row (PixelRegion *PR,
gint x,
gint y,
gint w,
const guchar *data)
{
gint end;
gint bpp;
gint end;
gint bpp;
end = x + w;
bpp = tile_manager_bpp (PR->tiles);
@ -234,7 +234,7 @@ pixel_region_get_col (PixelRegion *PR,
{
Tile *tile;
guchar *tile_data;
gint tilebpp;
gint bpp;
gint inc;
gint end;
gint boundary;
@ -244,7 +244,7 @@ pixel_region_get_col (PixelRegion *PR,
pixel_region_get_async (PR, x, y, x, end);
tilebpp = tile_manager_bpp (PR->tiles);
bpp = tile_manager_bpp (PR->tiles);
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 */
boundary = end;
inc = subsample * tilebpp * tile_ewidth (tile);
inc = subsample * bpp * tile_ewidth (tile);
for ( ; y < boundary; y += subsample)
{
for (b = 0; b < tilebpp; b++)
for (b = 0; b < bpp; b++)
*data++ = tile_data[b];
tile_data += inc;
@ -271,22 +271,22 @@ pixel_region_get_col (PixelRegion *PR,
void
pixel_region_set_col (PixelRegion *PR,
gint x,
gint y,
gint h,
guchar *data)
pixel_region_set_col (PixelRegion *PR,
gint x,
gint y,
gint h,
const guchar *data)
{
gint tilebpp;
gint end;
gint bpp;
gint end;
end = y + h;
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

View file

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

View file

@ -23,9 +23,9 @@ struct _PixelDataHandle
{
guchar *data;
gint width;
gint height;
gint height;
gint stride;
gint bpp;
gint bpp;
};
/* Creates a new tile manager with the specified
@ -137,9 +137,9 @@ void tile_manager_map_over_tile (TileManager *tm,
PixelDataHandle * request_pixel_data (TileManager *tm,
gint x1,
gint y1,
gint x2,
gint y2,
gint y1,
gint x2,
gint y2,
gboolean wantread,
gboolean wantwrite);
@ -164,12 +164,12 @@ void write_pixel_data (TileManager *tm,
/* Fill buffer with the pixeldata for the pixel at coordinates x,y
* if x,y is outside the area of the tilemanger, nothing is done.
*/
void read_pixel_data_1 (TileManager *tm,
void read_pixel_data_1 (TileManager *tm,
gint x,
gint y,
guchar *buffer);
void write_pixel_data_1 (TileManager *tm,
void write_pixel_data_1 (TileManager *tm,
gint x,
gint y,
const guchar *buffer);