diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-05 13:19:19 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-05 13:19:19 +0400 |
commit | e736ccc10964dfcd571d1b0f07327819c31a63a9 (patch) | |
tree | dfdfb25b4dddfa64cfe8ae35d27175bf9d42b090 /src/thirdparty/lcms2 | |
parent | c433422e67526b00c73156789f7650fe5cce31b9 (diff) |
update lcms
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4038 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/thirdparty/lcms2')
-rw-r--r-- | src/thirdparty/lcms2/AUTHORS | 2 | ||||
-rw-r--r-- | src/thirdparty/lcms2/ChangeLog | 1 | ||||
-rw-r--r-- | src/thirdparty/lcms2/include/lcms2.h | 10 | ||||
-rw-r--r-- | src/thirdparty/lcms2/include/lcms2_plugin.h | 4 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmscnvrt.c | 4 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsintrp.c | 138 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsio0.c | 10 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsopt.c | 5 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmspack.c | 1 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmsplugin.c | 10 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/cmstypes.c | 4 | ||||
-rw-r--r-- | src/thirdparty/lcms2/src/lcms2_internal.h | 2 |
12 files changed, 171 insertions, 20 deletions
diff --git a/src/thirdparty/lcms2/AUTHORS b/src/thirdparty/lcms2/AUTHORS index ff58c4c2f..73951b5ed 100644 --- a/src/thirdparty/lcms2/AUTHORS +++ b/src/thirdparty/lcms2/AUTHORS @@ -20,6 +20,8 @@ Andrew Brygin Samuli Suominen
Florian Höch
Aurelien Jarno
+Claudiu Cebuc
+Michael Vhrel (Artifex)
Special Thanks
--------------
diff --git a/src/thirdparty/lcms2/ChangeLog b/src/thirdparty/lcms2/ChangeLog index 37a6f7c08..78d229c28 100644 --- a/src/thirdparty/lcms2/ChangeLog +++ b/src/thirdparty/lcms2/ChangeLog @@ -58,3 +58,4 @@ Added compatibilty with Argyll's CGATS parser -----------------------
Fixed a bug in the named color devicelink generation
+Fixed uint64 to work in systems without long long native type
\ No newline at end of file diff --git a/src/thirdparty/lcms2/include/lcms2.h b/src/thirdparty/lcms2/include/lcms2.h index fcf431760..8f40efdf1 100644 --- a/src/thirdparty/lcms2/include/lcms2.h +++ b/src/thirdparty/lcms2/include/lcms2.h @@ -182,8 +182,10 @@ typedef int cmsBool; # define CMS_USE_BIG_ENDIAN 1
#endif
-#if TARGET_CPU_PPC
+#ifdef TARGET_CPU_PPC
+# if TARGET_CPU_PPC
# define CMS_USE_BIG_ENDIAN 1
+# endif
#endif
#ifdef macintosh
@@ -1694,12 +1696,15 @@ CMSAPI cmsBool CMSEXPORT cmsIT8SetComment(cmsHANDLE hIT8, const char* c CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyStr(cmsHANDLE hIT8, const char* cProp, const char *Str);
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyDbl(cmsHANDLE hIT8, const char* cProp, cmsFloat64Number Val);
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyHex(cmsHANDLE hIT8, const char* cProp, cmsUInt32Number Val);
+CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char* SubKey, const char *Buffer);
CMSAPI cmsBool CMSEXPORT cmsIT8SetPropertyUncooked(cmsHANDLE hIT8, const char* Key, const char* Buffer);
CMSAPI const char* CMSEXPORT cmsIT8GetProperty(cmsHANDLE hIT8, const char* cProp);
CMSAPI cmsFloat64Number CMSEXPORT cmsIT8GetPropertyDbl(cmsHANDLE hIT8, const char* cProp);
+CMSAPI const char* CMSEXPORT cmsIT8GetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char *SubKey);
CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumProperties(cmsHANDLE hIT8, char ***PropertyNames);
+CMSAPI cmsUInt32Number CMSEXPORT cmsIT8EnumPropertyMulti(cmsHANDLE hIT8, const char* cProp, const char ***SubpropertyNames);
// Datasets
CMSAPI const char* CMSEXPORT cmsIT8GetDataRowCol(cmsHANDLE hIT8, int row, int col);
@@ -1729,10 +1734,13 @@ CMSAPI cmsBool CMSEXPORT cmsIT8SetDataFormat(cmsHANDLE hIT8, int n, con CMSAPI int CMSEXPORT cmsIT8EnumDataFormat(cmsHANDLE hIT8, char ***SampleNames);
CMSAPI const char* CMSEXPORT cmsIT8GetPatchName(cmsHANDLE hIT8, int nPatch, char* buffer);
+CMSAPI int CMSEXPORT cmsIT8GetPatchByName(cmsHANDLE hIT8, const char *cPatch);
// The LABEL extension
CMSAPI int CMSEXPORT cmsIT8SetTableByLabel(cmsHANDLE hIT8, const char* cSet, const char* cField, const char* ExpectedType);
+CMSAPI cmsBool CMSEXPORT cmsIT8SetIndexColumn(cmsHANDLE hIT8, const char* cSample);
+
// Formatter for double
CMSAPI void CMSEXPORT cmsIT8DefineDblFormat(cmsHANDLE hIT8, const char* Formatter);
diff --git a/src/thirdparty/lcms2/include/lcms2_plugin.h b/src/thirdparty/lcms2/include/lcms2_plugin.h index 26338c228..8ce9e7b7c 100644 --- a/src/thirdparty/lcms2/include/lcms2_plugin.h +++ b/src/thirdparty/lcms2/include/lcms2_plugin.h @@ -131,7 +131,7 @@ struct _cms_io_handler { // Endianess adjust functions
CMSAPI cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsUInt16Number Word);
CMSAPI cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number Value);
-CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number QWord);
+CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord);
// Helper IO functions
CMSAPI cmsBool CMSEXPORT _cmsReadUInt8Number(cmsIOHANDLER* io, cmsUInt8Number* n);
@@ -147,7 +147,7 @@ CMSAPI cmsBool CMSEXPORT _cmsWriteUInt8Number(cmsIOHANDLER* io, cmsUI CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Number(cmsIOHANDLER* io, cmsUInt16Number n);
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt32Number(cmsIOHANDLER* io, cmsUInt32Number n);
CMSAPI cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsIOHANDLER* io, cmsFloat32Number n);
-CMSAPI cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number n);
+CMSAPI cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n);
CMSAPI cmsBool CMSEXPORT _cmsWrite15Fixed16Number(cmsIOHANDLER* io, cmsFloat64Number n);
CMSAPI cmsBool CMSEXPORT _cmsWriteXYZNumber(cmsIOHANDLER* io, const cmsCIEXYZ* XYZ);
CMSAPI cmsBool CMSEXPORT _cmsWriteUInt16Array(cmsIOHANDLER* io, cmsUInt32Number n, const cmsUInt16Number* Array);
diff --git a/src/thirdparty/lcms2/src/cmscnvrt.c b/src/thirdparty/lcms2/src/cmscnvrt.c index 91e716d11..90552a1f7 100644 --- a/src/thirdparty/lcms2/src/cmscnvrt.c +++ b/src/thirdparty/lcms2/src/cmscnvrt.c @@ -446,6 +446,10 @@ cmsBool ColorSpaceIsCompatible(cmsColorSpaceSignature a, cmsColorSpaceSignature // If they are same, they are compatible.
if (a == b) return TRUE;
+ // Check for MCH4 substitution of CMYK
+ if ((a == cmsSig4colorData) && (b == cmsSigCmykData)) return TRUE;
+ if ((a == cmsSigCmykData) && (b == cmsSig4colorData)) return TRUE;
+
// Check for XYZ/Lab. Those spaces are interchangeable as they can be computed one from other.
if ((a == cmsSigXYZData) && (b == cmsSigLabData)) return TRUE;
if ((a == cmsSigLabData) && (b == cmsSigXYZData)) return TRUE;
diff --git a/src/thirdparty/lcms2/src/cmsintrp.c b/src/thirdparty/lcms2/src/cmsintrp.c index a2a5f2209..710d2b420 100644 --- a/src/thirdparty/lcms2/src/cmsintrp.c +++ b/src/thirdparty/lcms2/src/cmsintrp.c @@ -675,6 +675,8 @@ void TetrahedralInterpFloat(const cmsFloat32Number Input[], +#if 0
+
#define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan])
static
@@ -777,6 +779,142 @@ void TetrahedralInterp16(register const cmsUInt16Number Input[], }
#undef DENS
+#else
+
+static
+void TetrahedralInterp16(register const cmsUInt16Number Input[],
+ register cmsUInt16Number Output[],
+ register const cmsInterpParams* p)
+{
+ const cmsUInt16Number* LutTable = (cmsUInt16Number*) p -> Table;
+ cmsS15Fixed16Number fx, fy, fz;
+ cmsS15Fixed16Number rx, ry, rz;
+ int x0, y0, z0;
+ cmsS15Fixed16Number c0, c1, c2, c3, Rest;
+ cmsS15Fixed16Number X0, X1, Y0, Y1, Z0, Z1;
+ cmsUInt32Number TotalOut = p -> nOutputs;
+
+ fx = _cmsToFixedDomain((int) Input[0] * p -> Domain[0]);
+ fy = _cmsToFixedDomain((int) Input[1] * p -> Domain[1]);
+ fz = _cmsToFixedDomain((int) Input[2] * p -> Domain[2]);
+
+ x0 = FIXED_TO_INT(fx);
+ y0 = FIXED_TO_INT(fy);
+ z0 = FIXED_TO_INT(fz);
+
+ rx = FIXED_REST_TO_INT(fx);
+ ry = FIXED_REST_TO_INT(fy);
+ rz = FIXED_REST_TO_INT(fz);
+
+ X0 = p -> opta[2] * x0;
+ X1 = (Input[0] == 0xFFFFU ? 0 : p->opta[2]);
+
+ Y0 = p -> opta[1] * y0;
+ Y1 = (Input[1] == 0xFFFFU ? 0 : p->opta[1]);
+
+ Z0 = p -> opta[0] * z0;
+ Z1 = (Input[2] == 0xFFFFU ? 0 : p->opta[0]);
+
+ LutTable = &LutTable[X0+Y0+Z0];
+
+ // The old code used: x = ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest))
+ // which expands as: x = (Rest + ((Rest+0x7fff)/0xFFFF) + 0x8000)>>16
+ // This can be replaced by: t = Rest+0x8001, x = (t + (t>>16))>>16
+ // at the cost of being off by one at 7fff and 17ffe.
+
+ if (rx >= ry) {
+ if (ry >= rz) {
+ Y1 += X1;
+ Z1 += Y1;
+ for (; TotalOut; TotalOut--) {
+ c1 = LutTable[X1];
+ c2 = LutTable[Y1];
+ c3 = LutTable[Z1];
+ c0 = *LutTable++;
+ c3 -= c2;
+ c2 -= c1;
+ c1 -= c0;
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16);
+ }
+ } else if (rz >= rx) {
+ X1 += Z1;
+ Y1 += X1;
+ for (; TotalOut; TotalOut--) {
+ c1 = LutTable[X1];
+ c2 = LutTable[Y1];
+ c3 = LutTable[Z1];
+ c0 = *LutTable++;
+ c2 -= c1;
+ c1 -= c3;
+ c3 -= c0;
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16);
+ }
+ } else {
+ Z1 += X1;
+ Y1 += Z1;
+ for (; TotalOut; TotalOut--) {
+ c1 = LutTable[X1];
+ c2 = LutTable[Y1];
+ c3 = LutTable[Z1];
+ c0 = *LutTable++;
+ c2 -= c3;
+ c3 -= c1;
+ c1 -= c0;
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16);
+ }
+ }
+ } else {
+ if (rx >= rz) {
+ X1 += Y1;
+ Z1 += X1;
+ for (; TotalOut; TotalOut--) {
+ c1 = LutTable[X1];
+ c2 = LutTable[Y1];
+ c3 = LutTable[Z1];
+ c0 = *LutTable++;
+ c3 -= c1;
+ c1 -= c2;
+ c2 -= c0;
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16);
+ }
+ } else if (ry >= rz) {
+ Z1 += Y1;
+ X1 += Z1;
+ for (; TotalOut; TotalOut--) {
+ c1 = LutTable[X1];
+ c2 = LutTable[Y1];
+ c3 = LutTable[Z1];
+ c0 = *LutTable++;
+ c1 -= c3;
+ c3 -= c2;
+ c2 -= c0;
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16);
+ }
+ } else {
+ Y1 += Z1;
+ X1 += Y1;
+ for (; TotalOut; TotalOut--) {
+ c1 = LutTable[X1];
+ c2 = LutTable[Y1];
+ c3 = LutTable[Z1];
+ c0 = *LutTable++;
+ c1 -= c2;
+ c2 -= c3;
+ c3 -= c0;
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ *Output++ = (cmsUInt16Number) c0 + ((Rest + (Rest>>16))>>16);
+ }
+ }
+ }
+}
+
+
+#endif
#define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan])
static
diff --git a/src/thirdparty/lcms2/src/cmsio0.c b/src/thirdparty/lcms2/src/cmsio0.c index 2080c96d7..4ca63cf1e 100644 --- a/src/thirdparty/lcms2/src/cmsio0.c +++ b/src/thirdparty/lcms2/src/cmsio0.c @@ -204,12 +204,10 @@ cmsBool MemoryWrite(struct _cms_io_handler* iohandler, cmsUInt32Number size, co memmove(ResData ->Block + ResData ->Pointer, Ptr, size);
ResData ->Pointer += size;
+ iohandler->UsedSpace += size;
if (ResData ->Pointer > iohandler->UsedSpace)
- iohandler->UsedSpace = ResData ->Pointer;
-
-
- iohandler->UsedSpace += size;
+ iohandler->UsedSpace = ResData ->Pointer;
return TRUE;
}
@@ -620,7 +618,7 @@ cmsBool _cmsReadHeader(_cmsICCPROFILE* Icc) Icc -> flags = _cmsAdjustEndianess32(Header.flags);
Icc -> manufacturer = _cmsAdjustEndianess32(Header.manufacturer);
Icc -> model = _cmsAdjustEndianess32(Header.model);
- _cmsAdjustEndianess64(&Icc -> attributes, Header.attributes);
+ _cmsAdjustEndianess64(&Icc -> attributes, &Header.attributes);
Icc -> Version = _cmsAdjustEndianess32(Header.version);
// Get size as reported in header
@@ -712,7 +710,7 @@ cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace) Header.manufacturer = _cmsAdjustEndianess32(Icc -> manufacturer);
Header.model = _cmsAdjustEndianess32(Icc -> model);
- _cmsAdjustEndianess64(&Header.attributes, Icc -> attributes);
+ _cmsAdjustEndianess64(&Header.attributes, &Icc -> attributes);
// Rendering intent in the header (for embedded profiles)
Header.renderingIntent = _cmsAdjustEndianess32(Icc -> RenderingIntent);
diff --git a/src/thirdparty/lcms2/src/cmsopt.c b/src/thirdparty/lcms2/src/cmsopt.c index 0b30ca6e4..f3a1418e4 100644 --- a/src/thirdparty/lcms2/src/cmsopt.c +++ b/src/thirdparty/lcms2/src/cmsopt.c @@ -877,9 +877,8 @@ void PrelinEval8(register const cmsUInt16Number Input[], }
- Rest = c1 * rx + c2 * ry + c3 * rz;
-
- Output[OutChan] = (cmsUInt16Number)c0 + ROUND_FIXED_TO_INT(_cmsToFixedDomain(Rest));
+ Rest = c1 * rx + c2 * ry + c3 * rz + 0x8001;
+ Output[OutChan] = (cmsUInt16Number)c0 + ((Rest + (Rest>>16))>>16);
}
}
diff --git a/src/thirdparty/lcms2/src/cmspack.c b/src/thirdparty/lcms2/src/cmspack.c index 3b8f9c380..cdbd7fa4b 100644 --- a/src/thirdparty/lcms2/src/cmspack.c +++ b/src/thirdparty/lcms2/src/cmspack.c @@ -2682,6 +2682,7 @@ static cmsFormattersFloat OutputFormattersFloat[] = { // Bit fields set to one in the mask are not compared
+static
cmsFormatter _cmsGetStockOutputFormatter(cmsUInt32Number dwInput, cmsUInt32Number dwFlags)
{
cmsUInt32Number i;
diff --git a/src/thirdparty/lcms2/src/cmsplugin.c b/src/thirdparty/lcms2/src/cmsplugin.c index 4537fad61..b46c7593b 100644 --- a/src/thirdparty/lcms2/src/cmsplugin.c +++ b/src/thirdparty/lcms2/src/cmsplugin.c @@ -76,12 +76,12 @@ cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number DWord) // 1 2 3 4 5 6 7 8
// 8 7 6 5 4 3 2 1
-void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number QWord)
+void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord)
{
#ifndef CMS_USE_BIG_ENDIAN
- cmsUInt8Number* pIn = (cmsUInt8Number*) &QWord;
+ cmsUInt8Number* pIn = (cmsUInt8Number*) QWord;
cmsUInt8Number* pOut = (cmsUInt8Number*) Result;
_cmsAssert(Result != NULL);
@@ -99,7 +99,7 @@ void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number Q _cmsAssert(Result != NULL);
- *Result = QWord;
+ *Result = *QWord;
#endif
}
@@ -189,7 +189,7 @@ cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n) if (io -> Read(io, &tmp, sizeof(cmsUInt64Number), 1) != 1)
return FALSE;
- if (n != NULL) _cmsAdjustEndianess64(n, tmp);
+ if (n != NULL) _cmsAdjustEndianess64(n, &tmp);
return TRUE;
}
@@ -311,7 +311,7 @@ cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsIOHANDLER* io, cmsFloat32Number n) return TRUE;
}
-cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number n)
+cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n)
{
cmsUInt64Number tmp;
diff --git a/src/thirdparty/lcms2/src/cmstypes.c b/src/thirdparty/lcms2/src/cmstypes.c index 24f597453..d578dc939 100644 --- a/src/thirdparty/lcms2/src/cmstypes.c +++ b/src/thirdparty/lcms2/src/cmstypes.c @@ -2535,7 +2535,7 @@ cmsBool WriteSetOfCurves(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, // If this is a table-based curve, use curve type even on V4
CurrentType = Type;
- if ((Curves[i] ->nSegments == 0)||(Curves[i]->nSegments == 2) && (Curves[i] ->Segments[1].Type == 0))
+ if ((Curves[i] ->nSegments == 0)||((Curves[i]->nSegments == 2) && (Curves[i] ->Segments[1].Type == 0)))
CurrentType = cmsSigCurveType;
else
if (Curves[i] ->Segments[0].Type < 0)
@@ -3273,7 +3273,7 @@ cmsBool Type_ProfileSequenceDesc_Write(struct _cms_typehandler_struct* self, cm if (!_cmsWriteUInt32Number(io, sec ->deviceMfg)) return FALSE;
if (!_cmsWriteUInt32Number(io, sec ->deviceModel)) return FALSE;
- if (!_cmsWriteUInt64Number(io, sec ->attributes)) return FALSE;
+ if (!_cmsWriteUInt64Number(io, &sec ->attributes)) return FALSE;
if (!_cmsWriteUInt32Number(io, sec ->technology)) return FALSE;
if (!SaveDescription(self, io, sec ->Manufacturer)) return FALSE;
diff --git a/src/thirdparty/lcms2/src/lcms2_internal.h b/src/thirdparty/lcms2/src/lcms2_internal.h index e7066c00b..6e98ca3c5 100644 --- a/src/thirdparty/lcms2/src/lcms2_internal.h +++ b/src/thirdparty/lcms2/src/lcms2_internal.h @@ -47,7 +47,7 @@ #endif
// BorlandC 5.5, VC2003 are broken on that
-#if defined(__BORLANDC__) || (_MSC_VER <= 1400) // 1400 == VC++ 8.0
+#if defined(__BORLANDC__) || (_MSC_VER < 1400) // 1400 == VC++ 8.0
#define sinf(x) (float)sin((float)x)
#define sqrtf(x) (float)sqrt((float)x)
#endif
|