From 1cff024fdbe91539839a46d830081da78775f419 Mon Sep 17 00:00:00 2001 From: Marti Maria Date: Fri, 28 May 2010 15:53:51 +0200 Subject: Trilinear interpolation --- AUTHORS | 1 + src/cmsio1.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index f442233..7890827 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,3 +18,4 @@ Richard Hughes Special Thanks -------------- Jan Morovic +Jos Vernon (WebSupergoo) diff --git a/src/cmsio1.c b/src/cmsio1.c index c367627..4035a47 100644 --- a/src/cmsio1.c +++ b/src/cmsio1.c @@ -439,12 +439,12 @@ cmsPipeline* _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent) // The profile owns the Lut, so we need to copy it Lut = cmsPipelineDup(Lut); + if (Lut == NULL) return NULL; // Now it is time for a controversial stuff. I found that for 3D LUTS using - // Lab used as indexer space, trilinear interpolation should be used - - if (cmsGetPCS(hProfile) == cmsSigLabData) - ChangeInterpolationToTrilinear(Lut); + // Lab used as indexer space, trilinear interpolation should be used + if (cmsGetPCS(hProfile) == cmsSigLabData) + ChangeInterpolationToTrilinear(Lut); // We need to adjust data only for Lab and Lut16 type if (OriginalType != cmsSigLut16Type || cmsGetPCS(hProfile) != cmsSigLabData) @@ -507,6 +507,12 @@ cmsPipeline* _cmsReadDevicelinkLUT(cmsHPROFILE hProfile, int Intent) // The profile owns the Lut, so we need to copy it Lut = cmsPipelineDup(Lut); + if (Lut == NULL) return NULL; + + // Now it is time for a controversial stuff. I found that for 3D LUTS using + // Lab used as indexer space, trilinear interpolation should be used + if (cmsGetColorSpace(hProfile) == cmsSigLabData) + ChangeInterpolationToTrilinear(Lut); // After reading it, we have info about the original type OriginalType = _cmsGetTagTrueType(hProfile, tag16); -- cgit v1.2.1