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 __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
|
|
|
{
|
2007-12-14 01:27:07 +08:00
|
|
|
gint bytes; /* number of bytes per pixel (1,2,3 or 4) */
|
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
gint x, y; /* origin of data source */
|
|
|
|
guchar *data; /* The data buffer. Do never access this field
|
2008-12-13 18:35:53 +08:00
|
|
|
directly, use temp_buf_get_data() instead !! */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* The temp buffer functions */
|
|
|
|
|
2008-12-13 18:51:16 +08:00
|
|
|
TempBuf * temp_buf_new (gint width,
|
|
|
|
gint height,
|
|
|
|
gint bytes,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const guchar *color);
|
|
|
|
TempBuf * temp_buf_new_check (gint width,
|
|
|
|
gint height,
|
|
|
|
GimpCheckType check_type,
|
|
|
|
GimpCheckSize check_size);
|
|
|
|
TempBuf * temp_buf_copy (TempBuf *src,
|
|
|
|
TempBuf *dest);
|
|
|
|
TempBuf * temp_buf_resize (TempBuf *buf,
|
|
|
|
gint bytes,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
TempBuf * temp_buf_scale (TempBuf *buf,
|
|
|
|
gint width,
|
|
|
|
gint height) G_GNUC_WARN_UNUSED_RESULT;
|
|
|
|
TempBuf * temp_buf_copy_area (TempBuf *src,
|
|
|
|
TempBuf *dest,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gint dest_x,
|
|
|
|
gint dest_y);
|
2007-12-14 01:27:07 +08:00
|
|
|
|
2008-12-13 18:51:16 +08:00
|
|
|
void temp_buf_demultiply (TempBuf *buf);
|
2007-12-14 01:27:07 +08:00
|
|
|
|
2008-12-13 18:51:16 +08:00
|
|
|
void temp_buf_free (TempBuf *buf);
|
|
|
|
guchar * temp_buf_get_data (TempBuf *buf);
|
|
|
|
gsize temp_buf_get_data_size (TempBuf *buf);
|
|
|
|
guchar * temp_buf_data_clear (TempBuf *buf);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2008-12-13 18:51:16 +08:00
|
|
|
gsize temp_buf_get_memsize (TempBuf *buf);
|
2009-08-15 01:18:56 +08:00
|
|
|
void temp_buf_dump (TempBuf *buf,
|
|
|
|
const gchar *filename);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
#endif /* __TEMP_BUF_H__ */
|