summaryrefslogtreecommitdiffstats
path: root/app/core/gimptempbuf.h
blob: d5228f5e8b78b417852d50933df8869a97da81d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* GIMP - The GNU 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 3 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, see <https://www.gnu.org/licenses/>.
 */

#ifndef __GIMP_TEMP_BUF_H__
#define __GIMP_TEMP_BUF_H__


GimpTempBuf * gimp_temp_buf_new               (gint               width,
                                               gint               height,
                                               const Babl        *format) G_GNUC_WARN_UNUSED_RESULT;
GimpTempBuf * gimp_temp_buf_new_from_pixbuf   (GdkPixbuf         *pixbuf,
                                               const Babl        *f_or_null) G_GNUC_WARN_UNUSED_RESULT;
GimpTempBuf * gimp_temp_buf_copy              (const GimpTempBuf *src) G_GNUC_WARN_UNUSED_RESULT;

GimpTempBuf * gimp_temp_buf_ref               (const GimpTempBuf *buf);
void          gimp_temp_buf_unref             (const GimpTempBuf *buf);

GimpTempBuf * gimp_temp_buf_scale             (const GimpTempBuf *buf,
                                               gint               width,
                                               gint               height) G_GNUC_WARN_UNUSED_RESULT;

gint          gimp_temp_buf_get_width         (const GimpTempBuf *buf);
gint          gimp_temp_buf_get_height        (const GimpTempBuf *buf);

const Babl  * gimp_temp_buf_get_format        (const GimpTempBuf *buf);
void          gimp_temp_buf_set_format        (GimpTempBuf       *buf,
                                               const Babl        *format);

guchar      * gimp_temp_buf_get_data          (const GimpTempBuf *buf);
gsize         gimp_temp_buf_get_data_size     (const GimpTempBuf *buf);

guchar      * gimp_temp_buf_data_clear        (GimpTempBuf       *buf);

gpointer      gimp_temp_buf_lock              (const GimpTempBuf *buf,
                                               const Babl        *format,
                                               GeglAccessMode     access_mode) G_GNUC_WARN_UNUSED_RESULT;
void          gimp_temp_buf_unlock            (const GimpTempBuf *buf,
                                               gconstpointer      data);

gsize         gimp_temp_buf_get_memsize       (const GimpTempBuf *buf);

GeglBuffer  * gimp_temp_buf_create_buffer     (const GimpTempBuf *temp_buf) G_GNUC_WARN_UNUSED_RESULT;
GdkPixbuf   * gimp_temp_buf_create_pixbuf     (const GimpTempBuf *temp_buf) G_GNUC_WARN_UNUSED_RESULT;

GimpTempBuf * gimp_gegl_buffer_get_temp_buf   (GeglBuffer        *buffer);


/*  stats  */

guint64       gimp_temp_buf_get_total_memsize (void);


#endif  /*  __GIMP_TEMP_BUF_H__  */