Commit 1c8ef3b3 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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)
parent 3412ce6c
......@@ -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
......
......@@ -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)
{
......
......@@ -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 {
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment