• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

go-image.h

Go to the documentation of this file.
00001 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
00002 /*
00003  * go-image.h - Image formats
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License, version 2, as published by the Free Software Foundation.
00008  *
00009  * This library is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00017  * USA.
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  * GOImage object *
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 /* GO_IMAGE_H */

Generated on Wed Mar 5 2014 for AbiWord by  doxygen 1.7.1