1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (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
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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 __TEMP_BUF_H__
|
|
|
|
#define __TEMP_BUF_H__
|
|
|
|
|
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
struct _TempBuf
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-12-02 22:59:30 +08:00
|
|
|
guint width;
|
|
|
|
guint height;
|
|
|
|
gint x, y; /* origin of data source */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-02 22:59:30 +08:00
|
|
|
guint bytes : 4; /* the necessary info */
|
|
|
|
guint swapped : 1; /* flag indicating whether buf is cached to disk */
|
|
|
|
gchar *filename; /* filename of cached information */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-02 22:59:30 +08:00
|
|
|
guchar *data; /* The data buffer. Do never access this field
|
2001-05-20 00:09:41 +08:00
|
|
|
directly, use temp_buf_data() instead !! */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* The temp buffer functions */
|
|
|
|
|
2001-12-02 22:59:30 +08:00
|
|
|
TempBuf * temp_buf_new (guint width,
|
|
|
|
guint height,
|
|
|
|
guint bytes,
|
2001-05-15 19:25:25 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guchar *col);
|
2001-12-02 22:59:30 +08:00
|
|
|
TempBuf * temp_buf_new_check (guint width,
|
|
|
|
guint height,
|
2001-05-15 19:25:25 +08:00
|
|
|
GimpCheckType check_type,
|
|
|
|
GimpCheckSize check_size);
|
|
|
|
TempBuf * temp_buf_copy (TempBuf *src,
|
|
|
|
TempBuf *dest);
|
|
|
|
TempBuf * temp_buf_resize (TempBuf *buf,
|
2001-12-02 22:59:30 +08:00
|
|
|
guint bytes,
|
2001-05-15 19:25:25 +08:00
|
|
|
gint x,
|
|
|
|
gint y,
|
2001-12-02 22:59:30 +08:00
|
|
|
guint width,
|
|
|
|
guint height);
|
2001-05-15 19:25:25 +08:00
|
|
|
TempBuf * temp_buf_scale (TempBuf *buf,
|
2001-12-02 22:59:30 +08:00
|
|
|
guint width,
|
|
|
|
guint height);
|
2001-05-15 19:25:25 +08:00
|
|
|
TempBuf * temp_buf_copy_area (TempBuf *src,
|
|
|
|
TempBuf *dest,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2001-12-02 22:59:30 +08:00
|
|
|
guint width,
|
|
|
|
guint height,
|
2001-05-15 19:25:25 +08:00
|
|
|
gint dest_x,
|
|
|
|
gint dest_y);
|
|
|
|
void temp_buf_free (TempBuf *buf);
|
|
|
|
guchar * temp_buf_data (TempBuf *buf);
|
|
|
|
guchar * temp_buf_data_clear (TempBuf *buf);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The mask buffer functions */
|
|
|
|
|
2001-12-02 22:59:30 +08:00
|
|
|
MaskBuf * mask_buf_new (guint width,
|
|
|
|
guint height);
|
2001-05-15 19:25:25 +08:00
|
|
|
void mask_buf_free (MaskBuf *mask_buf);
|
|
|
|
guchar * mask_buf_data (MaskBuf *mask_buf);
|
|
|
|
guchar * mask_buf_data_clear (MaskBuf *mask_buf);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The disk caching functions */
|
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
void temp_buf_swap (TempBuf *buf);
|
|
|
|
void temp_buf_unswap (TempBuf *buf);
|
|
|
|
void temp_buf_swap_free (TempBuf *buf);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
/* Called by app_procs:exit() to free up the cached undo buffer */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
void swapping_free (void);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#endif /* __TEMP_BUF_H__ */
|