2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1998-01-22 15:02:57 +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
|
1998-01-22 15:02:57 +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
|
1998-01-22 15:02:57 +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/>.
|
1998-01-22 15:02:57 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#ifndef __TILE_MANAGER_H__
|
|
|
|
#define __TILE_MANAGER_H__
|
|
|
|
|
|
|
|
|
2007-12-29 21:46:13 +08:00
|
|
|
#define GIMP_TYPE_TILE_MANAGER (gimp_tile_manager_get_type ())
|
|
|
|
#define GIMP_VALUE_HOLDS_TILE_MANAGER(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_TILE_MANAGER))
|
|
|
|
|
|
|
|
GType gimp_tile_manager_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2010-02-10 19:33:30 +08:00
|
|
|
#ifdef GIMP_UNSTABLE
|
|
|
|
void tile_manager_exit (void);
|
|
|
|
#endif
|
2007-12-29 21:46:13 +08:00
|
|
|
|
2008-08-05 23:10:47 +08:00
|
|
|
/* Creates a new tile manager with the specified size */
|
2006-07-06 20:27:32 +08:00
|
|
|
TileManager * tile_manager_new (gint width,
|
|
|
|
gint height,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint bpp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-05-27 01:02:06 +08:00
|
|
|
/* Ref/Unref a tile manager.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2003-05-27 01:02:06 +08:00
|
|
|
TileManager * tile_manager_ref (TileManager *tm);
|
|
|
|
void tile_manager_unref (TileManager *tm);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2010-03-20 02:16:31 +08:00
|
|
|
/* Make a copy of the tile manager.
|
|
|
|
*/
|
|
|
|
TileManager * tile_manager_duplicate (TileManager *tm);
|
|
|
|
|
2006-07-06 20:27:32 +08:00
|
|
|
/* Set the validate procedure for the tile manager. The validate
|
|
|
|
* procedure is called when an invalid tile is referenced. If the
|
|
|
|
* procedure is NULL, then the tile is set to valid and its memory is
|
|
|
|
* allocated, but not initialized.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
void tile_manager_set_validate_proc (TileManager *tm,
|
2007-06-21 22:36:58 +08:00
|
|
|
TileValidateProc proc,
|
|
|
|
gpointer user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
/* Get a specified tile from a tile manager.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
Tile * tile_manager_get_tile (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint xpixel,
|
|
|
|
gint ypixel,
|
2007-06-21 22:02:14 +08:00
|
|
|
gboolean wantread,
|
|
|
|
gboolean wantwrite);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Get a specified tile from a tile manager.
|
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
Tile * tile_manager_get (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint tile_num,
|
2007-06-21 22:02:14 +08:00
|
|
|
gboolean wantread,
|
|
|
|
gboolean wantwrite);
|
1998-07-10 10:43:12 +08:00
|
|
|
|
2007-06-06 21:45:44 +08:00
|
|
|
Tile * tile_manager_get_at (TileManager *tm,
|
|
|
|
gint tile_col,
|
|
|
|
gint tile_row,
|
2007-06-21 22:02:14 +08:00
|
|
|
gboolean wantread,
|
|
|
|
gboolean wantwrite);
|
2007-06-06 21:45:44 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
void tile_manager_map_tile (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint xpixel,
|
|
|
|
gint ypixel,
|
|
|
|
Tile *srctile);
|
1998-07-10 10:43:12 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
void tile_manager_map (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint tile_num,
|
|
|
|
Tile *srctile);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Validate a tiles memory.
|
|
|
|
*/
|
2007-12-18 21:07:01 +08:00
|
|
|
void tile_manager_validate_tile (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
Tile *tile);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-06-06 21:45:44 +08:00
|
|
|
void tile_manager_invalidate_area (TileManager *tm,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
gint tile_manager_width (const TileManager *tm);
|
|
|
|
gint tile_manager_height (const TileManager *tm);
|
|
|
|
gint tile_manager_bpp (const TileManager *tm);
|
2007-06-06 21:45:44 +08:00
|
|
|
gint tile_manager_tiles_per_col (const TileManager *tm);
|
|
|
|
gint tile_manager_tiles_per_row (const TileManager *tm);
|
2001-01-23 21:01:48 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
void tile_manager_get_offsets (const TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint *x,
|
|
|
|
gint *y);
|
2001-05-15 19:25:25 +08:00
|
|
|
void tile_manager_set_offsets (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
gint x,
|
|
|
|
gint y);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-09-20 03:47:26 +08:00
|
|
|
gint64 tile_manager_get_memsize (const TileManager *tm,
|
|
|
|
gboolean sparse);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
void tile_manager_get_tile_coordinates (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
Tile *tile,
|
|
|
|
gint *x,
|
|
|
|
gint *y);
|
2007-06-06 21:45:44 +08:00
|
|
|
void tile_manager_get_tile_col_row (TileManager *tm,
|
|
|
|
Tile *tile,
|
|
|
|
gint *tile_col,
|
|
|
|
gint *tile_row);
|
1998-08-16 03:17:36 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
void tile_manager_map_over_tile (TileManager *tm,
|
2006-04-12 20:49:29 +08:00
|
|
|
Tile *tile,
|
|
|
|
Tile *srctile);
|
1998-08-16 03:17:36 +08:00
|
|
|
|
2005-05-09 04:24:54 +08:00
|
|
|
void read_pixel_data (TileManager *tm,
|
|
|
|
gint x1,
|
|
|
|
gint y1,
|
|
|
|
gint x2,
|
|
|
|
gint y2,
|
|
|
|
guchar *buffer,
|
|
|
|
guint stride);
|
|
|
|
|
|
|
|
void write_pixel_data (TileManager *tm,
|
|
|
|
gint x1,
|
|
|
|
gint y1,
|
|
|
|
gint x2,
|
|
|
|
gint y2,
|
|
|
|
const guchar *buffer,
|
|
|
|
guint stride);
|
2001-11-29 09:06:44 +08:00
|
|
|
|
2003-04-04 19:19:57 +08:00
|
|
|
/* 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.
|
|
|
|
*/
|
2006-07-06 18:58:44 +08:00
|
|
|
void read_pixel_data_1 (TileManager *tm,
|
2006-07-06 20:27:32 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
2005-05-09 04:24:54 +08:00
|
|
|
guchar *buffer);
|
|
|
|
|
2006-07-06 18:58:44 +08:00
|
|
|
void write_pixel_data_1 (TileManager *tm,
|
2006-07-06 20:27:32 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
2006-04-12 20:49:29 +08:00
|
|
|
const guchar *buffer);
|
2001-05-15 19:25:25 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#endif /* __TILE_MANAGER_H__ */
|