aboutsummaryrefslogtreecommitdiff
path: root/fiv-io.h
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-01-24 04:03:19 +0100
committerPřemysl Eric Janouch <p@janouch.name>2022-01-24 05:48:13 +0100
commit788485d81eefcd43f0a66cf4cc664f8bde4423f5 (patch)
tree8c005e62f5ba11c8834e62334d40301515b137b4 /fiv-io.h
parent991e74b99bbf344effe456f71c544a284f7afe14 (diff)
downloadfiv-788485d81eefcd43f0a66cf4cc664f8bde4423f5.tar.gz
fiv-788485d81eefcd43f0a66cf4cc664f8bde4423f5.tar.xz
fiv-788485d81eefcd43f0a66cf4cc664f8bde4423f5.zip
Redirect warnings to the info bar
And speed up thumbnailing of animated images while at it. Also, fix thumbnailing SVGs with external links.
Diffstat (limited to 'fiv-io.h')
-rw-r--r--fiv-io.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/fiv-io.h b/fiv-io.h
index 5379303..2423618 100644
--- a/fiv-io.h
+++ b/fiv-io.h
@@ -74,7 +74,7 @@ extern cairo_user_data_key_t fiv_io_key_page_next;
extern cairo_user_data_key_t fiv_io_key_page_previous;
typedef struct _FivIoRenderClosure {
- /// The rendering is allowed to fail.
+ /// The rendering is allowed to fail, returning NULL.
cairo_surface_t *(*render)(struct _FivIoRenderClosure *, double scale);
} FivIoRenderClosure;
@@ -83,10 +83,18 @@ typedef struct _FivIoRenderClosure {
/// The rendered image will not have this key.
extern cairo_user_data_key_t fiv_io_key_render;
-cairo_surface_t *fiv_io_open(
- const gchar *uri, FivIoProfile profile, gboolean enhance, GError **error);
-cairo_surface_t *fiv_io_open_from_data(const char *data, size_t len,
- const gchar *uri, FivIoProfile profile, gboolean enhance, GError **error);
+typedef struct {
+ const char *uri; ///< Source URI
+ FivIoProfile screen_profile; ///< Target colour space or NULL
+ int screen_dpi; ///< Target DPI
+ gboolean enhance; ///< Enhance JPEG (currently)
+ gboolean first_frame_only; ///< Only interested in the 1st frame
+ GPtrArray *warnings; ///< String vector for non-fatal errors
+} FivIoOpenContext;
+
+cairo_surface_t *fiv_io_open(const FivIoOpenContext *ctx, GError **error);
+cairo_surface_t *fiv_io_open_from_data(
+ const char *data, size_t len, const FivIoOpenContext *ctx, GError **error);
// --- Filesystem --------------------------------------------------------------