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 <goffice/goffice.h>
00023 #include <gsf/gsf-libxml.h>
00024 #include <cairo.h>
00025
00026 #ifdef GOFFICE_WITH_GTK
00027 # include <gdk-pixbuf/gdk-pixbuf.h>
00028 #endif
00029
00030 G_BEGIN_DECLS
00031
00032 typedef enum {
00033 GO_IMAGE_FORMAT_SVG,
00034 GO_IMAGE_FORMAT_PNG,
00035 GO_IMAGE_FORMAT_JPG,
00036 GO_IMAGE_FORMAT_PDF,
00037 GO_IMAGE_FORMAT_PS,
00038 GO_IMAGE_FORMAT_EMF,
00039 GO_IMAGE_FORMAT_WMF,
00040 GO_IMAGE_FORMAT_EPS,
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_TYPE_IMAGE (go_image_get_type ())
00066 #define GO_IMAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_TYPE_IMAGE, GOImage))
00067 #define GO_IS_IMAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_TYPE_IMAGE))
00068
00069 GType go_image_get_type (void);
00070
00071 cairo_t *go_image_get_cairo (GOImage *image);
00072 cairo_pattern_t *go_image_create_cairo_pattern (GOImage *image);
00073
00074 #ifdef GOFFICE_WITH_GTK
00075 GOImage *go_image_new_from_pixbuf (GdkPixbuf *pixbuf);
00076 GdkPixbuf *go_image_get_pixbuf (GOImage *image);
00077 GdkPixbuf *go_image_get_thumbnail (GOImage *image);
00078 #endif
00079
00080 GOImage *go_image_new_from_file (const char *filename, GError **error);
00081 guint8 *go_image_get_pixels (GOImage *image);
00082 int go_image_get_rowstride (GOImage *image);
00083 void go_image_fill (GOImage *image, GOColor color);
00084
00085 void go_image_set_name (GOImage *image, char const *name);
00086 char const *go_image_get_name (GOImage *image);
00087
00088 gboolean go_image_same_pixbuf (GOImage *first, GOImage *second);
00089
00090 void go_image_save (GOImage *image, GsfXMLOut *output);
00091 void go_image_load_attrs (GOImage *image, GsfXMLIn *xin, xmlChar const **attrs);
00092 void go_image_load_data (GOImage *image, GsfXMLIn *xin);
00093
00094 G_END_DECLS
00095
00096 #endif