diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-12-23 12:40:30 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-12-23 12:40:30 +0400 |
commit | 08d21876124b27675518d9554eec672bb706d0da (patch) | |
tree | f6ce0c5a16432b67f4084285304577a804134902 /src/thirdparty/lcms2 | |
parent | 001bef754cead143dad1317fe5ed5021bf68b392 (diff) |
update lcms
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3910 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/thirdparty/lcms2')
-rw-r--r-- | src/thirdparty/lcms2/ChangeLog | 2 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsopt.c | 20 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsvirt.c | 5 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsxform.c | 12 |
4 files changed, 36 insertions, 3 deletions
diff --git a/src/thirdparty/lcms2/ChangeLog b/src/thirdparty/lcms2/ChangeLog index 522db825b..37a6f7c08 100644 --- a/src/thirdparty/lcms2/ChangeLog +++ b/src/thirdparty/lcms2/ChangeLog @@ -56,3 +56,5 @@ Added compatibilty with Argyll's CGATS parser 2.3 Maintenance release
-----------------------
+
+Fixed a bug in the named color devicelink generation
diff --git a/src/thirdparty/lcms2/src/cmsopt.c b/src/thirdparty/lcms2/src/cmsopt.c index 1c808e263..0b30ca6e4 100644 --- a/src/thirdparty/lcms2/src/cmsopt.c +++ b/src/thirdparty/lcms2/src/cmsopt.c @@ -529,6 +529,7 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3 {
cmsPipeline* Src;
cmsPipeline* Dest;
+ cmsStage* mpe;
cmsStage* CLUT;
cmsStage *KeepPreLin = NULL, *KeepPostLin = NULL;
int nGridPoints;
@@ -544,6 +545,9 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3 // This is a loosy optimization! does not apply in floating-point cases
if (_cmsFormatterIsFloat(*InputFormat) || _cmsFormatterIsFloat(*OutputFormat)) return FALSE;
+
+
+
ColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*InputFormat));
OutputColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*OutputFormat));
nGridPoints = _cmsReasonableGridpointsByColorspace(ColorSpace, *dwFlags);
@@ -554,6 +558,13 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3 Src = *Lut;
+ // Named color pipelines cannot be optimized either
+ for (mpe = cmsPipelineGetPtrToFirstStage(Src);
+ mpe != NULL;
+ mpe = cmsStageNext(mpe)) {
+ if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE;
+ }
+
// Allocate an empty LUT
Dest = cmsPipelineAlloc(Src ->ContextID, Src ->InputChannels, Src ->OutputChannels);
if (!Dest) return FALSE;
@@ -912,6 +923,7 @@ cmsBool OptimizeByComputingLinearization(cmsPipeline** Lut, cmsUInt32Number Inte cmsStage* OptimizedCLUTmpe;
cmsColorSpaceSignature ColorSpace, OutputColorSpace;
cmsStage* OptimizedPrelinMpe;
+ cmsStage* mpe;
cmsToneCurve** OptimizedPrelinCurves;
_cmsStageCLutData* OptimizedPrelinCLUT;
@@ -930,6 +942,14 @@ cmsBool OptimizeByComputingLinearization(cmsPipeline** Lut, cmsUInt32Number Inte }
OriginalLut = *Lut;
+
+ // Named color pipelines cannot be optimized either
+ for (mpe = cmsPipelineGetPtrToFirstStage(OriginalLut);
+ mpe != NULL;
+ mpe = cmsStageNext(mpe)) {
+ if (cmsStageType(mpe) == cmsSigNamedColorElemType) return FALSE;
+ }
+
ColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*InputFormat));
OutputColorSpace = _cmsICCcolorSpace(T_COLORSPACE(*OutputFormat));
nGridPoints = _cmsReasonableGridpointsByColorspace(ColorSpace, *dwFlags);
diff --git a/src/thirdparty/lcms2/src/cmsvirt.c b/src/thirdparty/lcms2/src/cmsvirt.c index f23dafade..13de5b249 100644 --- a/src/thirdparty/lcms2/src/cmsvirt.c +++ b/src/thirdparty/lcms2/src/cmsvirt.c @@ -934,6 +934,11 @@ cmsHPROFILE CreateNamedColorDevicelink(cmsHTRANSFORM xform) // Colorant count now depends on the output space
nc2 ->ColorantCount = cmsPipelineOutputChannels(v ->Lut);
+ // 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)));
+
// Apply the transfor to colorants.
for (i=0; i < nColors; i++) {
cmsDoTransform(xform, &i, nc2 ->List[i].DeviceColorant, 1);
diff --git a/src/thirdparty/lcms2/src/cmsxform.c b/src/thirdparty/lcms2/src/cmsxform.c index 673bcde17..36eb91c98 100644 --- a/src/thirdparty/lcms2/src/cmsxform.c +++ b/src/thirdparty/lcms2/src/cmsxform.c @@ -369,6 +369,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsUInt32Number InputFo if (InputFormat == 0 && OutputFormat == 0) {
p ->FromInput = p ->ToOutput = NULL;
+ dwFlags |= cmsFLAGS_CAN_CHANGE_FORMATTER;
}
else {
@@ -509,6 +510,12 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, cmsPipeline* Lut;
cmsUInt32Number LastIntent = Intents[nProfiles-1];
+ // If it is a fake transform
+ if (dwFlags & cmsFLAGS_NULLTRANSFORM)
+ {
+ return AllocEmptyTransform(ContextID, InputFormat, OutputFormat, dwFlags);
+ }
+
// If gamut check is requested, make sure we have a gamut profile
if (dwFlags & cmsFLAGS_GAMUTCHECK) {
if (hGamutProfile == NULL) dwFlags &= ~cmsFLAGS_GAMUTCHECK;
@@ -788,10 +795,9 @@ cmsBool CMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform, _cmsTRANSFORM* xform = (_cmsTRANSFORM*) hTransform;
cmsFormatter16 FromInput, ToOutput;
- cmsUInt32Number BytesPerPixelInput;
+
- // We only can afford to change formatters if previous transform is at least 16 bits
- BytesPerPixelInput = T_BYTES(xform ->InputFormat);
+ // We only can afford to change formatters if previous transform is at least 16 bits
if (!(xform ->dwOriginalFlags & cmsFLAGS_CAN_CHANGE_FORMATTER)) {
cmsSignalError(xform ->ContextID, cmsERROR_NOT_SUITABLE, "cmsChangeBuffersFormat works only on transforms created originally with at least 16 bits of precision");
|