#include <goffice/goffice-config.h>
#include <goffice/utils/go-color.h>
#include <goffice/utils/go-image.h>
#include <goffice/utils/go-cairo.h>
#include <glib/gi18n-lib.h>
#include <string.h>
#include <gsf/gsf-utils.h>
#include <gsf/gsf-impl-utils.h>
Classes | |
struct | _GOImage |
Defines | |
#define | PIXBUF_IMAGE_FORMAT_OFFSET (1+GO_IMAGE_FORMAT_UNKNOWN) |
Functions | |
static void | go_image_build_pixbuf_format_infos (void) |
char * | go_mime_to_image_format (char const *mime_type) |
go_mime_to_image_format: : a mime type string | |
char * | go_image_format_to_mime (char const *format) |
go_image_format_to_mime: : a file extension string | |
GOImageFormatInfo const * | go_image_get_format_info (GOImageFormat format) |
go_image_get_format_info: : a GOImageFormat | |
Variables | |
static GOImageFormatInfo * | pixbuf_image_format_infos = NULL |
static GHashTable * | pixbuf_mimes = NULL |
static unsigned | pixbuf_format_nbr = 0 |
static gboolean | pixbuf_format_done = FALSE |
static GOImageFormatInfo const | image_format_infos [GO_IMAGE_FORMAT_UNKNOWN] |
: a string | |
go_image_get_format_from_name: returns: corresponding GOImageFormat. | |
enum | { IMAGE_PROP_0, IMAGE_PROP_WIDTH, IMAGE_PROP_HEIGHT } |
typedef GObjectClass | GOImageClass |
static GObjectClass * | parent_klass |
GOImageFormat | go_image_get_format_from_name (char const *name) |
GSList * | go_image_get_formats_with_pixbuf_saver (void) |
go_image_get_formats_with_pixbuf_saver: | |
static void | pixbuf_to_cairo (GOImage *image) |
static void | go_image_set_property (GObject *obj, guint param_id, GValue const *value, GParamSpec *pspec) |
static void | go_image_get_property (GObject *obj, guint param_id, GValue *value, GParamSpec *pspec) |
static void | go_image_finalize (GObject *obj) |
static void | go_image_class_init (GOImageClass *klass) |
GSF_CLASS (GOImage, go_image, go_image_class_init, NULL, G_TYPE_OBJECT) | |
static void | cb_surface_destroyed (void *data) |
cairo_pattern_t * | go_image_create_cairo_pattern (GOImage *image) |
go_image_create_cairo_pattern: | |
GOImage * | go_image_new_from_file (const char *filename, GError **error) |
guint8 * | go_image_get_pixels (GOImage *image) |
int | go_image_get_rowstride (GOImage *image) |
void | go_image_fill (GOImage *image, GOColor color) |
void | go_image_set_name (GOImage *image, char const *name) |
char const * | go_image_get_name (GOImage *image) |
gboolean | go_image_same_pixbuf (GOImage *first, GOImage *second) |
void | go_image_save (GOImage *image, GsfXMLOut *output) |
void | go_image_load_attrs (GOImage *image, G_GNUC_UNUSED GsfXMLIn *xin, xmlChar const **attrs) |
void | go_image_load_data (GOImage *image, GsfXMLIn *xin) |
#define PIXBUF_IMAGE_FORMAT_OFFSET (1+GO_IMAGE_FORMAT_UNKNOWN) |
Referenced by go_image_get_formats_with_pixbuf_saver().
typedef GObjectClass GOImageClass |
static void cb_surface_destroyed | ( | void * | data | ) | [static] |
References GO_IMAGE.
Referenced by go_image_create_cairo_pattern().
static void go_image_build_pixbuf_format_infos | ( | void | ) | [static] |
References GOImageFormatInfo::alpha_support, GOImageFormatInfo::desc, GOImageFormatInfo::ext, GOImageFormatInfo::format, gchar, GO_IMAGE_FORMAT_UNKNOWN, GOImageFormatInfo::has_pixbuf_saver, GOImageFormatInfo::is_dpi_useful, GOImageFormatInfo::name, pixbuf_format_done, pixbuf_format_nbr, and pixbuf_mimes.
Referenced by go_image_get_format_from_name(), go_image_get_format_info(), go_image_get_formats_with_pixbuf_saver(), and go_mime_to_image_format().
static void go_image_class_init | ( | GOImageClass * | klass | ) | [static] |
References _, IMAGE_PROP_HEIGHT, and IMAGE_PROP_WIDTH.
cairo_pattern_t* go_image_create_cairo_pattern | ( | GOImage * | image | ) |
go_image_create_cairo_pattern:
a GOImage.
returns: a cairo_pattern usable for cairo_set_source.
Note: this function has lifespan issues. The resulting pattern in only valid until (a) a pixbuf is set for the, or (b) a pixbuf is _read_ from the image. In either of these cases, the pattern must have been destroyed beforehand. In particular, if the pattern has been attached to a surface, that surface must either be finished itself, or have had a new pattern attached. See #632439.
References cb_surface_destroyed(), _GOImage::data, GO_IS_IMAGE, _GOImage::height, _GOImage::pixbuf, pixbuf_to_cairo(), _GOImage::rowstride, _GOImage::target_cairo, and _GOImage::width.
static void go_image_finalize | ( | GObject * | obj | ) | [static] |
References _GOImage::data, GO_IMAGE, _GOImage::name, and _GOImage::pixbuf.
char* go_image_format_to_mime | ( | char const * | format | ) |
go_image_format_to_mime: : a file extension string
returns: corresponding mime type.
GOImageFormat go_image_get_format_from_name | ( | char const * | name | ) |
GOImageFormatInfo const* go_image_get_format_info | ( | GOImageFormat | format | ) |
go_image_get_format_info: : a GOImageFormat
Retrieves infromation associated to .
returns: a GOImageFormatInfo struct.
GSList* go_image_get_formats_with_pixbuf_saver | ( | void | ) |
go_image_get_formats_with_pixbuf_saver:
returns: a list of GOImageFormat that can be created from a pixbuf.
char const* go_image_get_name | ( | GOImage * | image | ) |
References GO_IS_IMAGE, and _GOImage::name.
guint8* go_image_get_pixels | ( | GOImage * | image | ) |
Referenced by go_image_save().
static void go_image_get_property | ( | GObject * | obj, | |
guint | param_id, | |||
GValue * | value, | |||
GParamSpec * | pspec | |||
) | [static] |
References GO_IMAGE, _GOImage::height, IMAGE_PROP_HEIGHT, IMAGE_PROP_WIDTH, _GOImage::pixbuf, _GOImage::target_cairo, and _GOImage::width.
int go_image_get_rowstride | ( | GOImage * | image | ) |
void go_image_load_attrs | ( | GOImage * | image, | |
G_GNUC_UNUSED GsfXMLIn * | xin, | |||
xmlChar const ** | attrs | |||
) |
References _GOImage::height, _GOImage::rowstride, and _GOImage::width.
void go_image_load_data | ( | GOImage * | image, | |
GsfXMLIn * | xin | |||
) |
References _GOImage::data, and _GOImage::target_cairo.
GOImage* go_image_new_from_file | ( | const char * | filename, | |
GError ** | error | |||
) |
References GO_TYPE_IMAGE, and _GOImage::target_cairo.
References GO_IS_IMAGE, _GOImage::pixbuf, and size.
void go_image_save | ( | GOImage * | image, | |
GsfXMLOut * | output | |||
) |
References go_image_get_pixels(), GO_IS_IMAGE, _GOImage::height, _GOImage::name, _GOImage::rowstride, and _GOImage::width.
void go_image_set_name | ( | GOImage * | image, | |
char const * | name | |||
) |
References _GOImage::name.
static void go_image_set_property | ( | GObject * | obj, | |
guint | param_id, | |||
GValue const * | value, | |||
GParamSpec * | pspec | |||
) | [static] |
char* go_mime_to_image_format | ( | char const * | mime_type | ) |
go_mime_to_image_format: : a mime type string
returns: file extension for the given mime type.
GSF_CLASS | ( | GOImage | , | |
go_image | , | |||
go_image_class_init | , | |||
NULL | , | |||
G_TYPE_OBJECT | ||||
) |
References GO_IS_IMAGE, and pixbuf_to_cairo().
static void pixbuf_to_cairo | ( | GOImage * | image | ) | [static] |
References _GOImage::data, go_cairo_convert_data_from_pixbuf(), GO_IS_IMAGE, _GOImage::height, _GOImage::pixbuf, _GOImage::rowstride, and _GOImage::width.
Referenced by go_image_create_cairo_pattern(), and GSF_CLASS().
GOImageFormatInfo const image_format_infos[GO_IMAGE_FORMAT_UNKNOWN] [static] |
{ {GO_IMAGE_FORMAT_SVG, (char *) "svg", (char *) N_("SVG (vector graphics)"), (char *) "svg", FALSE, FALSE, TRUE}, {GO_IMAGE_FORMAT_PNG, (char *) "png", (char *) N_("PNG (raster graphics)"), (char *) "png", TRUE, TRUE, TRUE}, {GO_IMAGE_FORMAT_JPG, (char *) "jpeg", (char *) N_("JPEG (photograph)"), (char *) "jpg", TRUE, TRUE, FALSE}, {GO_IMAGE_FORMAT_PDF, (char *) "pdf", (char *) N_("PDF (portable document format)"), (char *) "pdf", FALSE, FALSE, TRUE}, {GO_IMAGE_FORMAT_PS, (char *) "ps", (char *) N_("PS (postscript)"), (char *) "ps", FALSE, TRUE, TRUE}, {GO_IMAGE_FORMAT_EMF, (char *) "emf", (char *) N_("EMF (extended metafile)"), (char *) "emf", FALSE, FALSE, TRUE}, {GO_IMAGE_FORMAT_WMF, (char *) "wmf", (char *) N_("WMF (windows metafile)"), (char *) "wmf", FALSE, FALSE, TRUE}, {GO_IMAGE_FORMAT_EPS, (char *) "eps", (char *) N_("EPS (encapsulated postscript)"), (char *) "eps", FALSE, TRUE, TRUE}, }
GObjectClass* parent_klass [static] |
gboolean pixbuf_format_done = FALSE [static] |
Referenced by go_image_build_pixbuf_format_infos().
unsigned pixbuf_format_nbr = 0 [static] |
GOImageFormatInfo* pixbuf_image_format_infos = NULL [static] |
GHashTable* pixbuf_mimes = NULL [static] |
Referenced by go_image_build_pixbuf_format_infos(), and go_mime_to_image_format().