Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmscnvrt.c2
-rw-r--r--src/cmsgmt.c6
-rw-r--r--src/cmspack.c2
-rw-r--r--src/cmspcs.c14
-rw-r--r--src/cmsvirt.c17
-rw-r--r--src/cmsxform.c4
-rw-r--r--src/lcms2.def1
7 files changed, 29 insertions, 17 deletions
diff --git a/src/cmscnvrt.c b/src/cmscnvrt.c
index abac021..50e5a1e 100644
--- a/src/cmscnvrt.c
+++ b/src/cmscnvrt.c
@@ -630,7 +630,7 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID,
ColorSpaceOut == cmsSigRgbData ||
ColorSpaceOut == cmsSigCmykData) {
- cmsStage* clip = _cmsStageClipNegatives(Result->ContextID, cmsChannelsOf(ColorSpaceOut));
+ cmsStage* clip = _cmsStageClipNegatives(Result->ContextID, cmsChannelsOfColorSpace(ColorSpaceOut));
if (clip == NULL) goto Error;
if (!cmsPipelineInsertStage(Result, cmsAT_END, clip))
diff --git a/src/cmsgmt.c b/src/cmsgmt.c
index ddcfb52..e6c27c1 100644
--- a/src/cmsgmt.c
+++ b/src/cmsgmt.c
@@ -297,7 +297,8 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
cmsStage* CLUT;
cmsUInt32Number dwFormat;
GAMUTCHAIN Chain;
- cmsUInt32Number nChannels, nGridpoints;
+ cmsUInt32Number nGridpoints;
+ cmsInt32Number nChannels;
cmsColorSpaceSignature ColorSpace;
cmsUInt32Number i;
cmsHPROFILE ProfileList[256];
@@ -346,8 +347,7 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
ColorSpace = cmsGetColorSpace(hGamut);
-
- nChannels = cmsChannelsOf(ColorSpace);
+ nChannels = cmsChannelsOfColorSpace(ColorSpace);
nGridpoints = _cmsReasonableGridpointsByColorspace(ColorSpace, cmsFLAGS_HIGHRESPRECALC);
dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2));
diff --git a/src/cmspack.c b/src/cmspack.c
index 955687c..5ab4525 100644
--- a/src/cmspack.c
+++ b/src/cmspack.c
@@ -3833,7 +3833,7 @@ cmsUInt32Number CMSEXPORT cmsFormatterForColorspaceOfProfile(cmsHPROFILE hProfil
cmsColorSpaceSignature ColorSpace = cmsGetColorSpace(hProfile);
cmsUInt32Number ColorSpaceBits = (cmsUInt32Number) _cmsLCMScolorSpace(ColorSpace);
- cmsUInt32Number nOutputChans = cmsChannelsOf(ColorSpace);
+ cmsInt32Number nOutputChans = cmsChannelsOfColorSpace(ColorSpace);
cmsUInt32Number Float = lIsFloat ? 1U : 0;
// Create a fake formatter for result
diff --git a/src/cmspcs.c b/src/cmspcs.c
index 3d6323a..a0f1952 100644
--- a/src/cmspcs.c
+++ b/src/cmspcs.c
@@ -874,7 +874,7 @@ int CMSEXPORT _cmsLCMScolorSpace(cmsColorSpaceSignature ProfileSpace)
}
-cmsUInt32Number CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace)
+cmsInt32Number CMSEXPORT cmsChannelsOfColorSpace(cmsColorSpaceSignature ColorSpace)
{
switch (ColorSpace) {
@@ -935,6 +935,16 @@ cmsUInt32Number CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace)
case cmsSigMCHFData:
case cmsSig15colorData: return 15;
- default: return 3;
+ default: return -1;
}
}
+
+/**
+* DEPRECATED: Provided for compatibility only
+*/
+cmsUInt32Number CMSEXPORT cmsChannelsOf(cmsColorSpaceSignature ColorSpace)
+{
+ int n = cmsChannelsOfColorSpace(ColorSpace);
+ if (n < 0) return 3;
+ return (cmsUInt32Number)n;
+} \ No newline at end of file
diff --git a/src/cmsvirt.c b/src/cmsvirt.c
index 4900a83..b8ef607 100644
--- a/src/cmsvirt.c
+++ b/src/cmsvirt.c
@@ -291,7 +291,7 @@ cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID,
{
cmsHPROFILE hICC;
cmsPipeline* Pipeline;
- cmsUInt32Number nChannels;
+ cmsInt32Number nChannels;
hICC = cmsCreateProfilePlaceholder(ContextID);
if (!hICC)
@@ -306,7 +306,7 @@ cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID,
cmsSetHeaderRenderingIntent(hICC, INTENT_PERCEPTUAL);
// Set up channels
- nChannels = cmsChannelsOf(ColorSpace);
+ nChannels = cmsChannelsOfColorSpace(ColorSpace);
// Creates a Pipeline with prelinearization step only
Pipeline = cmsPipelineAlloc(ContextID, nChannels, nChannels);
@@ -397,7 +397,7 @@ cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLinkTHR(cmsContext ContextID,
cmsHPROFILE hICC;
cmsPipeline* LUT;
cmsStage* CLUT;
- cmsUInt32Number nChannels;
+ cmsInt32Number nChannels;
if (ColorSpace != cmsSigCmykData) {
cmsSignalError(ContextID, cmsERROR_COLORSPACE_CHECK, "InkLimiting: Only CMYK currently supported");
@@ -974,7 +974,7 @@ cmsHPROFILE CreateNamedColorDevicelink(cmsHTRANSFORM xform)
// Make sure we have proper formatters
cmsChangeBuffersFormat(xform, TYPE_NAMED_COLOR_INDEX,
FLOAT_SH(0) | COLORSPACE_SH(_cmsLCMScolorSpace(v ->ExitColorSpace))
- | BYTES_SH(2) | CHANNELS_SH(cmsChannelsOf(v ->ExitColorSpace)));
+ | BYTES_SH(2) | CHANNELS_SH(cmsChannelsOfColorSpace(v ->ExitColorSpace)));
// Apply the transfor to colorants.
for (i=0; i < nColors; i++) {
@@ -1062,8 +1062,9 @@ const cmsAllowedLUT* FindCombination(const cmsPipeline* Lut, cmsBool IsV4, cmsTa
cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, cmsFloat64Number Version, cmsUInt32Number dwFlags)
{
cmsHPROFILE hProfile = NULL;
- cmsUInt32Number FrmIn, FrmOut, ChansIn, ChansOut;
- int ColorSpaceBitsIn, ColorSpaceBitsOut;
+ cmsUInt32Number FrmIn, FrmOut;
+ cmsInt32Number ChansIn, ChansOut;
+ int ColorSpaceBitsIn, ColorSpaceBitsOut;
_cmsTRANSFORM* xform = (_cmsTRANSFORM*) hTransform;
cmsPipeline* LUT = NULL;
cmsStage* mpe;
@@ -1114,8 +1115,8 @@ cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, cmsFloat
// Optimize the LUT and precalculate a devicelink
- ChansIn = cmsChannelsOf(xform -> EntryColorSpace);
- ChansOut = cmsChannelsOf(xform -> ExitColorSpace);
+ ChansIn = cmsChannelsOfColorSpace(xform -> EntryColorSpace);
+ ChansOut = cmsChannelsOfColorSpace(xform -> ExitColorSpace);
ColorSpaceBitsIn = _cmsLCMScolorSpace(xform -> EntryColorSpace);
ColorSpaceBitsOut = _cmsLCMScolorSpace(xform -> ExitColorSpace);
diff --git a/src/cmsxform.c b/src/cmsxform.c
index 7f6636e..b790388 100644
--- a/src/cmsxform.c
+++ b/src/cmsxform.c
@@ -1137,8 +1137,8 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID,
}
// Check channel count
- if ((cmsChannelsOf(EntryColorSpace) != cmsPipelineInputChannels(Lut)) ||
- (cmsChannelsOf(ExitColorSpace) != cmsPipelineOutputChannels(Lut))) {
+ if ((cmsChannelsOfColorSpace(EntryColorSpace) != (cmsInt32Number) cmsPipelineInputChannels(Lut)) ||
+ (cmsChannelsOfColorSpace(ExitColorSpace) != (cmsInt32Number) cmsPipelineOutputChannels(Lut))) {
cmsPipelineFree(Lut);
cmsSignalError(ContextID, cmsERROR_NOT_SUITABLE, "Channel count doesn't match. Profile is corrupted");
return NULL;
diff --git a/src/lcms2.def b/src/lcms2.def
index b03943c..f3e4779 100644
--- a/src/lcms2.def
+++ b/src/lcms2.def
@@ -19,6 +19,7 @@ cmsBuildTabulatedToneCurve16 = cmsBuildTabulatedToneCurve16
cmsBuildTabulatedToneCurveFloat = cmsBuildTabulatedToneCurveFloat
_cmsCalloc = _cmsCalloc
cmsChannelsOf = cmsChannelsOf
+cmsChannelsOfColorSpace = cmsChannelsOfColorSpace
cmsCIE2000DeltaE = cmsCIE2000DeltaE
cmsCIE94DeltaE = cmsCIE94DeltaE
cmsCIECAM02Done = cmsCIECAM02Done