diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-05-06 03:14:07 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-05-06 03:14:07 +0000 |
commit | 1c8ef3b3d4165a26b6335b36b6f5ca7106326b9b (patch) | |
tree | 6d9d5f1d1123aacbc31fed5041e4f514f62ca2d7 | |
parent | 3412ce6cf97cf457f515b3b2f2ec77336c8aefc7 (diff) | |
download | gdk-pixbuf-1c8ef3b3d4165a26b6335b36b6f5ca7106326b9b.tar.gz |
New format flag GDK_PIXBUF_FORMAT_SCALABLE to mark scalable formats.
Wed May 5 23:09:48 2004 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-io.h (GdkPixbufFormatFlags): New format flag
GDK_PIXBUF_FORMAT_SCALABLE to mark scalable formats.
* gdk-pixbuf.h:
* gdk-pixbuf-io.c (gdk_pixbuf_format_is_scalable): New function.
(#137995, Dom Lachowicz)
-rw-r--r-- | docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt | 1 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 21 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.h | 1 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf.h | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt b/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt index cd30806ec..690aa7f09 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt @@ -186,6 +186,7 @@ gdk_pixbuf_format_get_description gdk_pixbuf_format_get_mime_types gdk_pixbuf_format_get_extensions gdk_pixbuf_format_is_writable +gdk_pixbuf_format_is_scalable GdkPixbufFormat GdkPixbufFormatFlags GdkPixbufModulePattern diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 37fba20df..b43a75eec 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -1783,6 +1783,27 @@ gdk_pixbuf_format_is_writable (GdkPixbufFormat *format) return (format->flags & GDK_PIXBUF_FORMAT_WRITABLE) != 0; } +/** + * gdk_pixbuf_format_is_scalable: + * @format: a #GdkPixbufFormat + * + * Returns whether this image format is scalable. If a file is in a + * scalable format, it is preferable to load it at the desired size, + * rather than loading it at the default size and scaling the + * resulting pixbuf to the desired size. + * + * Return value: whether this image format is scalable. + * + * Since: 2.6 + */ +gboolean +gdk_pixbuf_format_is_scalable (GdkPixbufFormat *format) +{ + g_return_val_if_fail (format != NULL, FALSE); + + return (format->flags & GDK_PIXBUF_FORMAT_SCALABLE) != 0; +} + GdkPixbufFormat * _gdk_pixbuf_get_format (GdkPixbufModule *module) { diff --git a/gdk-pixbuf/gdk-pixbuf-io.h b/gdk-pixbuf/gdk-pixbuf-io.h index b4fadce99..8c227496a 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.h +++ b/gdk-pixbuf/gdk-pixbuf-io.h @@ -124,6 +124,7 @@ gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf, typedef enum /*< skip >*/ { GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0, + GDK_PIXBUF_FORMAT_SCALABLE = 1 << 1 } GdkPixbufFormatFlags; struct _GdkPixbufFormat { diff --git a/gdk-pixbuf/gdk-pixbuf.h b/gdk-pixbuf/gdk-pixbuf.h index a4054cc07..6edff8bca 100644 --- a/gdk-pixbuf/gdk-pixbuf.h +++ b/gdk-pixbuf/gdk-pixbuf.h @@ -340,6 +340,7 @@ gchar *gdk_pixbuf_format_get_description (GdkPixbufFormat *format); gchar **gdk_pixbuf_format_get_mime_types (GdkPixbufFormat *format); gchar **gdk_pixbuf_format_get_extensions (GdkPixbufFormat *format); gboolean gdk_pixbuf_format_is_writable (GdkPixbufFormat *format); +gboolean gdk_pixbuf_format_is_scalable (GdkPixbufFormat *format); GdkPixbufFormat *gdk_pixbuf_get_file_info (const gchar *filename, gint *width, |