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-profile.c | |
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-profile.c')
-rw-r--r-- | fiv-io-profile.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fiv-io-profile.c b/fiv-io-profile.c index 4e51848..44eb0bf 100644 --- a/fiv-io-profile.c +++ b/fiv-io-profile.c @@ -51,7 +51,7 @@ fiv_io_cmm_get_default() } FivIoProfile * -fiv_io_profile_new(const void *data, size_t len) +fiv_io_cmm_get_profile(FivIoCmm *self, const void *data, size_t len) { #ifdef HAVE_LCMS2 return cmsOpenProfileFromMemTHR(NULL, data, len); @@ -63,7 +63,7 @@ fiv_io_profile_new(const void *data, size_t len) } FivIoProfile * -fiv_io_profile_new_sRGB(void) +fiv_io_cmm_get_profile_sRGB(FivIoCmm *self) { #ifdef HAVE_LCMS2 return cmsCreate_sRGBProfileTHR(NULL); @@ -73,7 +73,7 @@ fiv_io_profile_new_sRGB(void) } FivIoProfile * -fiv_io_profile_new_parametric( +fiv_io_cmm_get_profile_parametric(FivIoCmm *self, double gamma, double whitepoint[2], double primaries[6]) { #ifdef HAVE_LCMS2 @@ -104,19 +104,19 @@ fiv_io_profile_new_parametric( } FivIoProfile * -fiv_io_profile_new_sRGB_gamma(double gamma) +fiv_io_cmm_get_profile_sRGB_gamma(FivIoCmm *self, double gamma) { - return fiv_io_profile_new_parametric(gamma, + return fiv_io_cmm_get_profile_parametric(self, gamma, (double[2]){0.3127, 0.3290}, (double[6]){0.6400, 0.3300, 0.3000, 0.6000, 0.1500, 0.0600}); } FivIoProfile * -fiv_io_profile_new_from_bytes(GBytes *bytes) +fiv_io_cmm_get_profile_from_bytes(FivIoCmm *self, GBytes *bytes) { gsize len = 0; gconstpointer p = g_bytes_get_data(bytes, &len); - return fiv_io_profile_new(p, len); + return fiv_io_cmm_get_profile(self, p, len); } GBytes * @@ -269,7 +269,7 @@ fiv_io_cmm_page(FivIoCmm *self, FivIoImage *page, FivIoProfile *target, { FivIoProfile *source = NULL; if (page->icc) - source = fiv_io_profile_new_from_bytes(page->icc); + source = fiv_io_cmm_get_profile_from_bytes(self, page->icc); // TODO(p): All animations need to be composited in a linear colour space. for (FivIoImage *frame = page; frame != NULL; frame = frame->frame_next) |