summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lcms2mt/src/cmscnvrt.c')
-rw-r--r--lcms2mt/src/cmscnvrt.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/lcms2mt/src/cmscnvrt.c b/lcms2mt/src/cmscnvrt.c
index f29ab5ba..e3a2ddbc 100644
--- a/lcms2mt/src/cmscnvrt.c
+++ b/lcms2mt/src/cmscnvrt.c
@@ -1,7 +1,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2017 Marti Maria Saguer
+// Copyright (c) 1998-2020 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -27,19 +27,6 @@
#include "lcms2_internal.h"
-// Link several profiles to obtain a single LUT modelling the whole color transform. Intents, Black point
-// compensation and Adaptation parameters may vary across profiles. BPC and Adaptation refers to the PCS
-// after the profile. I.e, BPC[0] refers to connexion between profile(0) and profile(1)
-cmsPipeline* _cmsLinkProfiles(cmsContext ContextID,
- cmsUInt32Number nProfiles,
- cmsUInt32Number Intents[],
- cmsHPROFILE hProfiles[],
- cmsBool BPC[],
- cmsFloat64Number AdaptationStates[],
- cmsUInt32Number dwFlags);
-
-//---------------------------------------------------------------------------------
-
// This is the default routine for ICC-style intents. A user may decide to override it by using a plugin.
// Supported intents are perceptual, relative colorimetric, saturation and ICC-absolute colorimetric
static
@@ -546,8 +533,6 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID,
Result = cmsPipelineAlloc(ContextID, 0, 0);
if (Result == NULL) return NULL;
- ContextID->dwFlags = dwFlags;
-
CurrentColorSpace = cmsGetColorSpace(ContextID, hProfiles[0]);
for (i=0; i < nProfiles; i++) {
@@ -655,14 +640,10 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID,
}
- ContextID->dwFlags = 0;
-
return Result;
Error:
- ContextID->dwFlags = 0;
-
if (Lut != NULL) cmsPipelineFree(ContextID, Lut);
if (Result != NULL) cmsPipelineFree(ContextID, Result);
return NULL;
@@ -717,7 +698,7 @@ typedef struct {
// Preserve black only if that is the only ink used
static
-int BlackPreservingGrayOnlySampler(cmsContext ContextID, register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
+int BlackPreservingGrayOnlySampler(cmsContext ContextID, CMSREGISTER const cmsUInt16Number In[], CMSREGISTER cmsUInt16Number Out[], CMSREGISTER void* Cargo)
{
GrayOnlyParams* bp = (GrayOnlyParams*) Cargo;
@@ -844,7 +825,7 @@ typedef struct {
// The CLUT will be stored at 16 bits, but calculations are performed at cmsFloat32Number precision
static
-int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
+int BlackPreservingSampler(cmsContext ContextID, CMSREGISTER const cmsUInt16Number In[], CMSREGISTER cmsUInt16Number Out[], CMSREGISTER void* Cargo)
{
int i;
cmsFloat32Number Inf[4], Outf[4];
@@ -869,14 +850,14 @@ int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number
}
// Try the original transform,
- cmsPipelineEvalFloat(ContextID, Inf, Outf, bp ->cmyk2cmyk);
+ cmsPipelineEvalFloat(ContextID, Inf, Outf, bp ->cmyk2cmyk);
// Store a copy of the floating point result into 16-bit
for (i=0; i < 4; i++)
Out[i] = _cmsQuickSaturateWord(Outf[i] * 65535.0);
// Maybe K is already ok (mostly on K=0)
- if ( fabs(Outf[3] - LabK[3]) < (3.0 / 65535.0) ) {
+ if (fabsf(Outf[3] - LabK[3]) < (3.0 / 65535.0)) {
return TRUE;
}
@@ -901,7 +882,7 @@ int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number
Outf[3] = LabK[3];
// Apply TAC if needed
- SumCMY = Outf[0] + Outf[1] + Outf[2];
+ SumCMY = (cmsFloat64Number) Outf[0] + Outf[1] + Outf[2];
SumCMYK = SumCMY + Outf[3];
if (SumCMYK > bp ->MaxTAC) {