1 /* GdkPixbuf library - Main header file
3 * Copyright (C) 1999 The Free Software Foundation
5 * Authors: Mark Crichton <crichton@gimp.org>
6 * Miguel de Icaza <miguel@gnu.org>
7 * Federico Mena-Quintero <federico@gimp.org>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
28 #include <libart_lgpl/art_misc.h>
29 #include <libart_lgpl/art_pixbuf.h>
39 /* GdkPixbuf structure */
41 typedef struct _GdkPixbuf GdkPixbuf;
48 ArtPixBuf *art_pixbuf;
53 /* Convenience macros */
55 #define gdk_pixbuf_get_format(pixbuf) ((pixbuf)->art_pixbuf->format)
56 #define gdk_pixbuf_get_n_channels(pixbuf) ((pixbuf)->art_pixbuf->n_channels)
57 #define gdk_pixbuf_get_has_alpha(pixbuf) ((pixbuf)->art_pixbuf->has_alpha)
58 #define gdk_pixbuf_get_bits_per_sample(pixbuf) ((pixbuf)->art_pixbuf->bits_per_sample)
59 #define gdk_pixbuf_get_pixels(pixbuf) ((pixbuf)->art_pixbuf->pixels)
60 #define gdk_pixbuf_get_width(pixbuf) ((pixbuf)->art_pixbuf->width)
61 #define gdk_pixbuf_get_height(pixbuf) ((pixbuf)->art_pixbuf->height)
62 #define gdk_pixbuf_get_rowstride(pixbuf) ((pixbuf)->art_pixbuf->rowstride)
64 /* Reference counting */
66 void gdk_pixbuf_ref (GdkPixbuf *pixbuf);
67 void gdk_pixbuf_unref (GdkPixbuf *pixbuf);
69 /* Wrap a libart pixbuf */
71 GdkPixbuf *gdk_pixbuf_new_from_art_pixbuf (ArtPixBuf *art_pixbuf);
73 /* Create a blank pixbuf with an optimal rowstride and a new buffer */
75 GdkPixbuf *gdk_pixbuf_new (ArtPixFormat format, gboolean has_alpha, int bits_per_sample,
76 int width, int height);
80 GdkPixbuf *gdk_pixbuf_new_from_file (const char *filename);
81 GdkPixbuf *gdk_pixbuf_new_from_data (guchar *data, ArtPixFormat format, gboolean has_alpha,
82 int width, int height, int rowstride,
83 ArtDestroyNotify dfunc, gpointer dfunc_data);
84 GdkPixbuf *gdk_pixbuf_new_from_xpm_data (const gchar **data);
86 /* Rendering to a drawable */
89 GDK_PIXBUF_ALPHA_BILEVEL,
93 void gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, GdkBitmap *bitmap,
95 int dest_x, int dest_y,
96 int width, int height,
99 void gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, GdkDrawable *drawable,
100 int src_x, int src_y,
101 int dest_x, int dest_y,
102 int width, int height,
103 GdkPixbufAlphaMode alpha_mode,
106 int x_dither, int y_dither);
108 /* Transformations */
110 GdkPixbuf *gdk_pixbuf_scale (const GdkPixbuf *pixbuf, gint w, gint h);
111 GdkPixbuf *gdk_pixbuf_rotate (GdkPixbuf *pixbuf, gdouble angle);