diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-01-27 21:42:24 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-01-27 21:42:24 +0100 |
commit | 39f6be3f64a6c5c0a1ec0ee8a1d905160381b71f (patch) | |
tree | aa5c4fef4fcc44bbb742c7b5a356e80f43f1a548 /fiv-io.h | |
parent | 9dcba6ee6e9f58bb21f64926b2e50492ba11fcf7 (diff) | |
download | fiv-39f6be3f64a6c5c0a1ec0ee8a1d905160381b71f.tar.gz fiv-39f6be3f64a6c5c0a1ec0ee8a1d905160381b71f.tar.xz fiv-39f6be3f64a6c5c0a1ec0ee8a1d905160381b71f.zip |
WIP: Thread-safe colour management
Diffstat (limited to 'fiv-io.h')
-rw-r--r-- | fiv-io.h | 39 |
1 files changed, 29 insertions, 10 deletions
@@ -28,7 +28,7 @@ typedef struct _FivIoImage FivIoImage; // --- Colour management ------------------------------------------------------- -void fiv_io_profile_init(void); +void fiv_io_cmm_init(void); // TODO(p): Make it also possible to use Skia's skcms. typedef void *FivIoProfile; @@ -43,23 +43,42 @@ void fiv_io_profile_free(FivIoProfile *self); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +#define FIV_TYPE_IO_CMM (fiv_io_cmm_get_type()) +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); +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]); +*/ + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + void fiv_io_premultiply_argb32(FivIoImage *image); -void fiv_io_profile_cmyk( +void fiv_io_cmm_cmyk(FivIoCmm *self, FivIoImage *image, FivIoProfile *source, FivIoProfile *target); -void fiv_io_profile_4x16le_direct(unsigned char *data, +void fiv_io_cmm_4x16le_direct(FivIoCmm *self, unsigned char *data, int w, int h, FivIoProfile *source, FivIoProfile *target); -void fiv_io_profile_argb32_premultiply( +void fiv_io_cmm_argb32_premultiply(FivIoCmm *self, FivIoImage *image, FivIoProfile *source, FivIoProfile *target); -void fiv_io_profile_page(FivIoImage *page, FivIoProfile *target, - void (*frame_cb) (FivIoImage *, FivIoProfile *, FivIoProfile *)); -#define fiv_io_profile_argb32_premultiply_page(page, target) \ - fiv_io_profile_page((page), (target), fiv_io_profile_argb32_premultiply) +void fiv_io_cmm_page(FivIoCmm *self, FivIoImage *page, FivIoProfile *target, + void (*frame_cb) (FivIoCmm *, + FivIoImage *, FivIoProfile *, FivIoProfile *)); +#define fiv_io_cmm_argb32_premultiply_page(cmm, page, target) \ + fiv_io_cmm_page((cmm), (page), (target), fiv_io_cmm_argb32_premultiply) -void fiv_io_profile_any( +void fiv_io_cmm_any(FivIoCmm *self, FivIoImage *image, FivIoProfile *source, FivIoProfile *target); -FivIoImage *fiv_io_profile_finalize(FivIoImage *image, FivIoProfile *target); +FivIoImage *fiv_io_cmm_finalize( + FivIoCmm *self, FivIoImage *image, FivIoProfile *target); // --- Loading ----------------------------------------------------------------- |