2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#ifndef __PIXEL_REGION_H__
|
|
|
|
#define __PIXEL_REGION_H__
|
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
struct _PixelRegion
|
|
|
|
{
|
2000-06-08 02:43:22 +08:00
|
|
|
guchar *data; /* pointer to region data */
|
|
|
|
TileManager *tiles; /* pointer to tiles */
|
|
|
|
Tile *curtile; /* current tile */
|
|
|
|
gint offx; /* tile offsets */
|
|
|
|
gint offy; /* tile offsets */
|
2001-12-03 21:44:59 +08:00
|
|
|
gint rowstride; /* bytes per pixel row */
|
2000-06-08 02:43:22 +08:00
|
|
|
gint x; /* origin */
|
|
|
|
gint y; /* origin */
|
2001-12-03 21:44:59 +08:00
|
|
|
gint w; /* width of region */
|
|
|
|
gint h; /* height of region */
|
|
|
|
gint bytes; /* bytes per pixel */
|
|
|
|
gboolean dirty; /* will this region be dirtied? */
|
|
|
|
gint process_count; /* used internally */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2000-12-28 10:01:16 +08:00
|
|
|
struct _PixelRegionHolder
|
|
|
|
{
|
|
|
|
PixelRegion *PR;
|
|
|
|
guchar *original_data;
|
|
|
|
gint startx;
|
|
|
|
gint starty;
|
2001-12-03 21:44:59 +08:00
|
|
|
gint count;
|
2000-12-28 10:01:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _PixelRegionIterator
|
|
|
|
{
|
|
|
|
GSList *pixel_regions;
|
2001-12-03 21:44:59 +08:00
|
|
|
gint dirty_tiles;
|
|
|
|
gint region_width;
|
|
|
|
gint region_height;
|
|
|
|
gint portion_width;
|
|
|
|
gint portion_height;
|
|
|
|
gint process_count;
|
2000-12-28 10:01:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* PixelRegion functions */
|
2000-06-08 02:43:22 +08:00
|
|
|
|
2005-09-04 01:16:58 +08:00
|
|
|
void pixel_region_init (PixelRegion *PR,
|
2006-04-12 20:49:29 +08:00
|
|
|
TileManager *tiles,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h,
|
|
|
|
gboolean dirty);
|
2005-09-04 01:16:58 +08:00
|
|
|
void pixel_region_init_temp_buf (PixelRegion *PR,
|
|
|
|
TempBuf *temp_buf,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
|
|
|
void pixel_region_init_data (PixelRegion *PR,
|
|
|
|
guchar *data,
|
|
|
|
gint bytes,
|
|
|
|
gint rowstride,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
|
|
|
void pixel_region_resize (PixelRegion *PR,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
2005-09-04 01:16:58 +08:00
|
|
|
void pixel_region_get_row (PixelRegion *PR,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
guchar *data,
|
|
|
|
gint subsample);
|
2005-09-04 01:16:58 +08:00
|
|
|
void pixel_region_set_row (PixelRegion *PR,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
2006-07-06 18:58:44 +08:00
|
|
|
const guchar *data);
|
2005-09-04 01:16:58 +08:00
|
|
|
void pixel_region_get_col (PixelRegion *PR,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint h,
|
|
|
|
guchar *data,
|
|
|
|
gint subsample);
|
2005-09-04 01:16:58 +08:00
|
|
|
void pixel_region_set_col (PixelRegion *PR,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint h,
|
2006-07-06 18:58:44 +08:00
|
|
|
const guchar *data);
|
2001-08-17 22:27:31 +08:00
|
|
|
gboolean pixel_region_has_alpha (PixelRegion *PR);
|
|
|
|
|
2006-07-06 18:58:44 +08:00
|
|
|
PixelRegionIterator * pixel_regions_register (gint num_regions,
|
|
|
|
...);
|
2002-08-22 17:48:56 +08:00
|
|
|
PixelRegionIterator * pixel_regions_process (PixelRegionIterator *PRI);
|
|
|
|
void pixel_regions_process_stop (PixelRegionIterator *PRI);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-20 18:06:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#endif /* __PIXEL_REGION_H__ */
|