Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GO_IMAGE_H
00020 #define GO_IMAGE_H
00021
00022 #include <glib-object.h>
00023 #include <goffice/utils/goffice-utils.h>
00024 #ifdef GOFFICE_WITH_CAIRO
00025 # include <cairo.h>
00026 #endif
00027 #ifdef GOFFICE_WITH_GTK
00028 # include <gdk-pixbuf/gdk-pixbuf.h>
00029 #endif
00030
00031 G_BEGIN_DECLS
00032
00033 typedef enum {
00034 GO_IMAGE_FORMAT_SVG,
00035 GO_IMAGE_FORMAT_PNG,
00036 GO_IMAGE_FORMAT_JPG,
00037 GO_IMAGE_FORMAT_PDF,
00038 GO_IMAGE_FORMAT_PS,
00039 GO_IMAGE_FORMAT_EMF,
00040 GO_IMAGE_FORMAT_WMF,
00041 GO_IMAGE_FORMAT_UNKNOWN
00042 } GOImageFormat;
00043
00044 typedef struct {
00045 GOImageFormat format;
00046 char *name;
00047 char *desc;
00048 char *ext;
00049 gboolean has_pixbuf_saver;
00050 gboolean is_dpi_useful;
00051 gboolean alpha_support;
00052 } GOImageFormatInfo;
00053
00054 char *go_mime_to_image_format (char const *mime_type);
00055 char *go_image_format_to_mime (char const *format);
00056
00057 GOImageFormatInfo const *go_image_get_format_info (GOImageFormat format);
00058 GOImageFormat go_image_get_format_from_name (char const *name);
00059 GSList *go_image_get_formats_with_pixbuf_saver (void);
00060
00061
00062
00063
00064
00065 #define GO_IMAGE_TYPE (go_image_get_type ())
00066 #define GO_IMAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_IMAGE_TYPE, GOImage))
00067 #define IS_GO_IMAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_IMAGE_TYPE))
00068
00069 GType go_image_get_type (void);
00070
00071 #ifdef GOFFICE_WITH_CAIRO
00072 cairo_t *go_image_get_cairo (GOImage *image);
00073 cairo_pattern_t *go_image_create_cairo_pattern (GOImage *image);
00074 #endif
00075
00076 #ifdef GOFFICE_WITH_GTK
00077 GOImage *go_image_new_from_pixbuf (GdkPixbuf *pixbuf);
00078 GdkPixbuf *go_image_get_pixbuf (GOImage *image);
00079 #endif
00080
00081 GOImage *go_image_new_from_file (const char *filename, GError **error);
00082 guint8 *go_image_get_pixels (GOImage *image);
00083 int go_image_get_rowstride (GOImage *image);
00084 void go_image_fill (GOImage *image, GOColor color);
00085
00086 G_END_DECLS
00087
00088 #endif