From 501dc123ada348f18cac7ed05c812b5e633bd2ef Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sun, 28 Jan 2024 01:13:15 +0100 Subject: WIP: Thread-safe colour management --- fiv-io.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fiv-io.c') diff --git a/fiv-io.c b/fiv-io.c index eefc741..f1fcc01 100644 --- a/fiv-io.c +++ b/fiv-io.c @@ -2077,8 +2077,8 @@ load_resvg_destroy(FivIoRenderClosure *closure) } static FivIoImage * -load_resvg_render_internal(FivIoRenderClosureResvg *self, - double scale, FivIoProfile *target, GError **error) +load_resvg_render_internal(FivIoRenderClosureResvg *self, double scale, + FivIoCmm *cmm, FivIoProfile *target, GError **error) { double w = ceil(self->width * scale), h = ceil(self->height * scale); if (w > SHRT_MAX || h > SHRT_MAX) { @@ -2108,15 +2108,15 @@ load_resvg_render_internal(FivIoRenderClosureResvg *self, uint32_t rgba = g_ntohl(pixels[i]); pixels[i] = rgba << 24 | rgba >> 8; } - return fiv_io_profile_finalize(image, target); + return fiv_io_cmm_finish(cmm, image, target); } static FivIoImage * -load_resvg_render( - FivIoRenderClosure *closure, FivIoProfile *target, double scale) +load_resvg_render(FivIoRenderClosure *closure, + FivIoCmm *cmm, FivIoProfile *target, double scale) { FivIoRenderClosureResvg *self = (FivIoRenderClosureResvg *) closure; - return load_resvg_render_internal(self, scale, target, NULL); + return load_resvg_render_internal(self, scale, cmm, target, NULL); } static const char * @@ -2174,8 +2174,8 @@ open_resvg( closure->width = size.width; closure->height = size.height; - FivIoImage *image = - load_resvg_render_internal(closure, 1., ctx->screen_profile, error); + FivIoImage *image = load_resvg_render_internal( + closure, 1., ctx->cmm, ctx->screen_profile, error); if (!image) { load_resvg_destroy(&closure->parent); return NULL; -- cgit v1.2.3-70-g09d2