2006-12-03 Dimitris Glezos <dimitris@glezos.com>
[dia.git] / lib / dia_image.h
blobb5de9e444cd046ae6df9608fdeaf7e9c106001f9
1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1999 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #ifndef DIA_IMAGE_H
19 #define DIA_IMAGE_H
21 #include "diatypes.h"
22 #include <gdk/gdktypes.h>
24 #include "geometry.h"
26 void dia_image_init(void);
28 DiaImage dia_image_get_broken(void);
30 DiaImage dia_image_load(gchar *filename);
31 void dia_image_add_ref(DiaImage image);
32 void dia_image_release(DiaImage image);
33 void dia_image_draw(DiaImage image, GdkWindow *window,
34 int x, int y, int width, int height);
36 int dia_image_width(DiaImage image);
37 int dia_image_rowstride(DiaImage image);
38 int dia_image_height(DiaImage image);
39 /** Returns a copy of the RGB data in this image with any alpha stripped
40 * The returned buffer must be freed after use.
41 * The buffer is laid out as dia_image_width*dia_image_rowstride*3 bytes.
43 guint8 *dia_image_rgb_data(DiaImage image);
44 /** Returns a copy of the alpha data in this image, or NULL if none
45 * The returned buffer must be freed after use.
46 * The buffer is laid out as dia_image_width*dia_image_height bytes.
48 guint8 *dia_image_mask_data(DiaImage image);
49 /** Returns the RGBA data in this image, or NULL if there's no alpha.
50 * Note that this is the raw data, not a copy.
52 const guint8 *dia_image_rgba_data(DiaImage image);
53 const char *dia_image_filename(DiaImage image);
55 #endif /* DIA_IMAGE_H */