diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-01-27 22:22:08 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-01-27 22:22:08 +0100 |
commit | c6d89361a5e2a46818d67ce4a21856ddecc129a4 (patch) | |
tree | 5ca7d95e331bbf00281550da407649ad25cb0407 /fiv-io.h | |
parent | 39f6be3f64a6c5c0a1ec0ee8a1d905160381b71f (diff) | |
download | fiv-c6d89361a5e2a46818d67ce4a21856ddecc129a4.tar.gz fiv-c6d89361a5e2a46818d67ce4a21856ddecc129a4.tar.xz fiv-c6d89361a5e2a46818d67ce4a21856ddecc129a4.zip |
WIP: Thread-safe colour management
Diffstat (limited to 'fiv-io.h')
-rw-r--r-- | fiv-io.h | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -31,13 +31,8 @@ typedef struct _FivIoImage FivIoImage; void fiv_io_cmm_init(void); // TODO(p): Make it also possible to use Skia's skcms. +// TODO(p): Profiles might want to keep references to their CMM contexts. typedef void *FivIoProfile; -FivIoProfile *fiv_io_profile_new(const void *data, size_t len); -FivIoProfile *fiv_io_profile_new_from_bytes(GBytes *bytes); -FivIoProfile *fiv_io_profile_new_sRGB(void); -FivIoProfile *fiv_io_profile_new_sRGB_gamma(double gamma); -FivIoProfile *fiv_io_profile_new_parametric( - double gamma, double whitepoint[2], double primaries[6]); GBytes *fiv_io_profile_to_bytes(FivIoProfile *profile); void fiv_io_profile_free(FivIoProfile *self); @@ -48,7 +43,6 @@ G_DECLARE_FINAL_TYPE(FivIoCmm, fiv_io_cmm, FIV, CMM, GObject) FivIoCmm *fiv_io_cmm_get_default(); -/* FivIoProfile *fiv_io_cmm_get_profile( FivIoCmm *self, const void *data, size_t len); FivIoProfile *fiv_io_cmm_get_profile_from_bytes(FivIoCmm *self, GBytes *bytes); @@ -56,7 +50,6 @@ FivIoProfile *fiv_io_cmm_get_profile_sRGB(FivIoCmm *self); FivIoProfile *fiv_io_cmm_get_profile_sRGB_gamma(FivIoCmm *self, double gamma); FivIoProfile *fiv_io_cmm_get_profile_parametric( FivIoCmm *self, double gamma, double whitepoint[2], double primaries[6]); -*/ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -103,7 +96,8 @@ enum _FivIoOrientation { // then loaders could store it in their closures. struct _FivIoRenderClosure { /// The rendering is allowed to fail, returning NULL. - FivIoImage *(*render)(FivIoRenderClosure *, FivIoProfile *, double scale); + FivIoImage *(*render)( + FivIoRenderClosure *, FivIoCmm *, FivIoProfile *, double scale); void (*destroy)(FivIoRenderClosure *); }; @@ -174,6 +168,7 @@ cairo_surface_t *fiv_io_image_to_surface_noref(const FivIoImage *image); typedef struct { const char *uri; ///< Source URI + FivIoCmm *cmm; ///< Colour management module or NULL FivIoProfile *screen_profile; ///< Target colour space or NULL int screen_dpi; ///< Target DPI gboolean enhance; ///< Enhance JPEG (currently) |