From f151fcb72ba587840595bb755d24b89f8bfb937b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Thu, 25 Nov 2021 02:46:36 +0100 Subject: Extract all frames from GIF/APNG animations So far none of the surface userdata is used. --- fastiv-io.h | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'fastiv-io.h') diff --git a/fastiv-io.h b/fastiv-io.h index aa21a33..aed235b 100644 --- a/fastiv-io.h +++ b/fastiv-io.h @@ -25,6 +25,29 @@ extern const char *fastiv_io_supported_media_types[]; char **fastiv_io_all_supported_media_types(void); +// Userdata are typically attached to all Cairo surfaces in an animation. + +/// GBytes with plain Exif data. +extern cairo_user_data_key_t fastiv_io_key_exif; +/// GBytes with plain ICC profile data. +extern cairo_user_data_key_t fastiv_io_key_icc; + +/// The next frame in a sequence, as a surface, in a chain, pre-composited. +/// There is no wrap-around. +extern cairo_user_data_key_t fastiv_io_key_frame_next; +/// Frame duration in milliseconds as an intptr_t. +extern cairo_user_data_key_t fastiv_io_key_frame_duration; +/// How many times to repeat the animation, or zero for +inf, as an uintptr_t. +extern cairo_user_data_key_t fastiv_io_key_loops; + +cairo_surface_t *fastiv_io_open(const gchar *path, GError **error); +cairo_surface_t *fastiv_io_open_from_data( + const char *data, size_t len, const gchar *path, GError **error); + +int fastiv_io_filecmp(GFile *f1, GFile *f2); + +// --- Thumbnails -------------------------------------------------------------- + // And this is how you avoid glib-mkenums. typedef enum _FastivIoThumbnailSize { #define FASTIV_IO_THUMBNAIL_SIZES(XX) \ @@ -52,13 +75,5 @@ typedef struct _FastivIoThumbnailSizeInfo { extern FastivIoThumbnailSizeInfo fastiv_io_thumbnail_sizes[FASTIV_IO_THUMBNAIL_SIZE_COUNT]; -extern cairo_user_data_key_t fastiv_io_key_exif; -extern cairo_user_data_key_t fastiv_io_key_icc; - -cairo_surface_t *fastiv_io_open(const gchar *path, GError **error); -cairo_surface_t *fastiv_io_open_from_data( - const char *data, size_t len, const gchar *path, GError **error); cairo_surface_t *fastiv_io_lookup_thumbnail( const gchar *target, FastivIoThumbnailSize size); - -int fastiv_io_filecmp(GFile *f1, GFile *f2); -- cgit v1.2.3