summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2010-07-09 18:20:59 +0200
committerMarti Maria <info@littlecms.com>2010-07-09 18:20:59 +0200
commit9670543888556ccfae1edade70bcc8756783332d (patch)
treeef1dfa2fa1b9e916aa0595b0e49a43ffbb2532d5
parent82d38fd5554605c6ac821801c90b598fa9bc14c3 (diff)
downloadlcms2-9670543888556ccfae1edade70bcc8756783332d.tar.gz
Adding cmsChangeBuffersFormat, fixing VC2010 project
-rw-r--r--Projects/VC2010/jpegicc/jpegicc.vcxproj8
-rw-r--r--Projects/VC2010/lcms2_DLL/lcms2_DLL.vcxproj6
-rw-r--r--Projects/VC2010/lcms2_static/lcms2_static.vcxproj4
-rw-r--r--Projects/VC2010/linkicc/linkicc.vcxproj4
-rw-r--r--Projects/VC2010/psicc/psicc.vcxproj4
-rw-r--r--Projects/VC2010/testbed/testbed.vcxproj3
-rw-r--r--Projects/VC2010/tiffdiff/tiffdiff.vcxproj9
-rw-r--r--Projects/VC2010/tifficc/tifficc.vcxproj8
-rw-r--r--Projects/VC2010/transicc/transicc.vcxproj4
-rw-r--r--include/lcms2.h2
-rw-r--r--src/cmsxform.c35
-rw-r--r--testbed/testcms2.c160
-rw-r--r--utils/common/utils.h4
-rw-r--r--utils/common/vprf.c3
-rw-r--r--utils/jpgicc/jpgicc.c2
-rw-r--r--utils/tificc/tificc.c6
16 files changed, 199 insertions, 63 deletions
diff --git a/Projects/VC2010/jpegicc/jpegicc.vcxproj b/Projects/VC2010/jpegicc/jpegicc.vcxproj
index 653bd81..f6d8578 100644
--- a/Projects/VC2010/jpegicc/jpegicc.vcxproj
+++ b/Projects/VC2010/jpegicc/jpegicc.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -49,6 +49,10 @@
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);;C:\jpeg-8b</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);;C:\jpeg-8b</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);;C:\jpeg-8b</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);;C:\jpeg-8b</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
diff --git a/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcxproj
index bb94c02..c0011ec 100644
--- a/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcxproj
+++ b/Projects/VC2010/lcms2_DLL/lcms2_DLL.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -68,6 +68,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>../../../bin/lcms2d.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -94,6 +95,7 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>../../../bin/lcms2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/Projects/VC2010/lcms2_static/lcms2_static.vcxproj b/Projects/VC2010/lcms2_static/lcms2_static.vcxproj
index 65065d6..c611473 100644
--- a/Projects/VC2010/lcms2_static/lcms2_static.vcxproj
+++ b/Projects/VC2010/lcms2_static/lcms2_static.vcxproj
@@ -37,9 +37,9 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\Lib\MS\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\Lib\MS\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
diff --git a/Projects/VC2010/linkicc/linkicc.vcxproj b/Projects/VC2010/linkicc/linkicc.vcxproj
index 0f4379c..6bd9ebc 100644
--- a/Projects/VC2010/linkicc/linkicc.vcxproj
+++ b/Projects/VC2010/linkicc/linkicc.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
diff --git a/Projects/VC2010/psicc/psicc.vcxproj b/Projects/VC2010/psicc/psicc.vcxproj
index 0bbcddd..b200db1 100644
--- a/Projects/VC2010/psicc/psicc.vcxproj
+++ b/Projects/VC2010/psicc/psicc.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
diff --git a/Projects/VC2010/testbed/testbed.vcxproj b/Projects/VC2010/testbed/testbed.vcxproj
index b23655d..15988b5 100644
--- a/Projects/VC2010/testbed/testbed.vcxproj
+++ b/Projects/VC2010/testbed/testbed.vcxproj
@@ -39,7 +39,7 @@
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\testbed\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -48,6 +48,7 @@
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\testbed\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
diff --git a/Projects/VC2010/tiffdiff/tiffdiff.vcxproj b/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
index 23e35f6..210d812 100644
--- a/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
+++ b/Projects/VC2010/tiffdiff/tiffdiff.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -49,6 +49,10 @@
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);;C:\tiff-3.9.4\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);;C:\tiff-3.9.4\libtiff</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);;C:\tiff-3.9.4\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);;C:\tiff-3.9.4\libtiff</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -90,6 +94,7 @@
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/Projects/VC2010/tifficc/tifficc.vcxproj b/Projects/VC2010/tifficc/tifficc.vcxproj
index 19bf336..cd63de0 100644
--- a/Projects/VC2010/tifficc/tifficc.vcxproj
+++ b/Projects/VC2010/tifficc/tifficc.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
@@ -49,6 +49,10 @@
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IncludePath);C:\tiff-3.9.4\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath);C:\tiff-3.9.4\libtiff</LibraryPath>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath);C:\tiff-3.9.4\libtiff</IncludePath>
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath);C:\tiff-3.9.4\libtiff</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
diff --git a/Projects/VC2010/transicc/transicc.vcxproj b/Projects/VC2010/transicc/transicc.vcxproj
index 814a483..e7f66e1 100644
--- a/Projects/VC2010/transicc/transicc.vcxproj
+++ b/Projects/VC2010/transicc/transicc.vcxproj
@@ -37,10 +37,10 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
diff --git a/include/lcms2.h b/include/lcms2.h
index b8a1071..0ece3d7 100644
--- a/include/lcms2.h
+++ b/include/lcms2.h
@@ -23,7 +23,7 @@
//
//---------------------------------------------------------------------------------
//
-// Version 2.0
+// Version 2.1(alpha1)
//
#ifndef _lcms2_H
diff --git a/src/cmsxform.c b/src/cmsxform.c
index eb57316..8c31bb2 100644
--- a/src/cmsxform.c
+++ b/src/cmsxform.c
@@ -762,3 +762,38 @@ cmsContext CMSEXPORT cmsGetTransformContextID(cmsHTRANSFORM hTransform)
if (xform == NULL) return NULL;
return xform -> ContextID;
}
+
+
+
+// For backwards compatibility
+cmsBool CMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform,
+ cmsUInt32Number InputFormat,
+ cmsUInt32Number OutputFormat)
+{
+
+ _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);
+ if (!(BytesPerPixelInput == 0 || BytesPerPixelInput >= 2)) {
+
+ cmsSignalError(xform ->ContextID, cmsERROR_NOT_SUITABLE, "cmsChangeBuffersFormat works() only on transforms created originally with at least 16 bits of precision");
+ return FALSE;
+ }
+
+
+ FromInput = _cmsGetFormatter(InputFormat, cmsFormatterInput, CMS_PACK_FLAGS_16BITS).Fmt16;
+ ToOutput = _cmsGetFormatter(OutputFormat, cmsFormatterOutput, CMS_PACK_FLAGS_16BITS).Fmt16;
+
+ if (FromInput == NULL || ToOutput == NULL) {
+
+ cmsSignalError(xform -> ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported raster format");
+ return FALSE;
+ }
+
+ xform ->FromInput = FromInput;
+ xform ->ToOutput = ToOutput;
+ return TRUE;
+}
diff --git a/testbed/testcms2.c b/testbed/testcms2.c
index a355562..38b9c84 100644
--- a/testbed/testcms2.c
+++ b/testbed/testcms2.c
@@ -3791,9 +3791,9 @@ cmsInt32Number CheckFormatters16(void)
C( TYPE_GRAY_FLT );
C( TYPE_RGB_FLT );
C( TYPE_CMYK_FLT );
- C( TYPE_XYZA_FLT );
- C( TYPE_LabA_FLT );
- C( TYPE_RGBA_FLT );
+ C( TYPE_XYZA_FLT );
+ C( TYPE_LabA_FLT );
+ C( TYPE_RGBA_FLT );
C( TYPE_XYZ_DBL );
C( TYPE_Lab_DBL );
@@ -3885,11 +3885,11 @@ cmsInt32Number CheckFormattersFloat(void)
C( TYPE_RGB_FLT );
C( TYPE_CMYK_FLT );
- // User
- C( TYPE_XYZA_FLT );
- C( TYPE_LabA_FLT );
- C( TYPE_RGBA_FLT );
-
+ // User
+ C( TYPE_XYZA_FLT );
+ C( TYPE_LabA_FLT );
+ C( TYPE_RGBA_FLT );
+
C( TYPE_XYZ_DBL );
C( TYPE_Lab_DBL );
C( TYPE_GRAY_DBL );
@@ -3901,6 +3901,75 @@ cmsInt32Number CheckFormattersFloat(void)
#undef C
+static
+cmsInt32Number CheckOneRGB(cmsHTRANSFORM xform, cmsUInt32Number R, cmsUInt32Number G, cmsUInt32Number B, cmsUInt32Number Ro, cmsUInt32Number Go, cmsUInt32Number Bo)
+{
+ cmsUInt16Number RGB[3];
+ cmsUInt16Number Out[3];
+
+ RGB[0] = R;
+ RGB[1] = G;
+ RGB[2] = B;
+
+ cmsDoTransform(xform, RGB, Out, 1);
+
+ return IsGoodWord("R", Ro , Out[0]) &&
+ IsGoodWord("G", Go , Out[1]) &&
+ IsGoodWord("B", Bo , Out[2]);
+}
+
+// Check known values going from sRGB to XYZ
+static
+cmsInt32Number CheckOneRGB_double(cmsHTRANSFORM xform, cmsFloat64Number R, cmsFloat64Number G, cmsFloat64Number B, cmsFloat64Number Ro, cmsFloat64Number Go, cmsFloat64Number Bo)
+{
+ cmsFloat64Number RGB[3];
+ cmsFloat64Number Out[3];
+
+ RGB[0] = R;
+ RGB[1] = G;
+ RGB[2] = B;
+
+ cmsDoTransform(xform, RGB, Out, 1);
+
+ return IsGoodVal("R", Ro , Out[0], 0.01) &&
+ IsGoodVal("G", Go , Out[1], 0.01) &&
+ IsGoodVal("B", Bo , Out[2], 0.01);
+}
+
+
+static
+cmsInt32Number CheckChangeBufferFormat(void)
+{
+ cmsHPROFILE hsRGB = cmsCreate_sRGBProfile();
+ cmsHTRANSFORM xform;
+
+
+ xform = cmsCreateTransform(hsRGB, TYPE_RGB_16, hsRGB, TYPE_RGB_16, INTENT_PERCEPTUAL, 0);
+ cmsCloseProfile(hsRGB);
+ if (xform == NULL) return 0;
+
+
+ if (!CheckOneRGB(xform, 0, 0, 0, 0, 0, 0)) return 0;
+ if (!CheckOneRGB(xform, 120, 0, 0, 120, 0, 0)) return 0;
+ if (!CheckOneRGB(xform, 0, 222, 255, 0, 222, 255)) return 0;
+
+
+ if (!cmsChangeBuffersFormat(xform, TYPE_BGR_16, TYPE_RGB_16)) return 0;
+
+ if (!CheckOneRGB(xform, 0, 0, 123, 123, 0, 0)) return 0;
+ if (!CheckOneRGB(xform, 154, 234, 0, 0, 234, 154)) return 0;
+
+ if (!cmsChangeBuffersFormat(xform, TYPE_RGB_DBL, TYPE_RGB_DBL)) return 0;
+
+ if (!CheckOneRGB_double(xform, 0.20, 0, 0, 0.20, 0, 0)) return 0;
+ if (!CheckOneRGB_double(xform, 0, 0.9, 1, 0, 0.9, 1)) return 0;
+
+ cmsDeleteTransform(xform);
+
+return 1;
+}
+
+
// Write tag testbed ----------------------------------------------------------------------------------------
static
@@ -5007,43 +5076,43 @@ static
cmsInt32Number CheckBadTransforms(void)
{
cmsHPROFILE h1 = cmsCreate_sRGBProfile();
- cmsHTRANSFORM x1;
-
- x1 = cmsCreateTransform(NULL, 0, NULL, 0, 0, 0);
- if (x1 != NULL) {
- cmsDeleteTransform(x1);
- return 0;
- }
-
-
-
- x1 = cmsCreateTransform(h1, TYPE_RGB_8, h1, TYPE_RGB_8, 12345, 0);
- if (x1 != NULL) {
- cmsDeleteTransform(x1);
- return 0;
- }
+ cmsHTRANSFORM x1;
+
+ x1 = cmsCreateTransform(NULL, 0, NULL, 0, 0, 0);
+ if (x1 != NULL) {
+ cmsDeleteTransform(x1);
+ return 0;
+ }
+
+
+
+ x1 = cmsCreateTransform(h1, TYPE_RGB_8, h1, TYPE_RGB_8, 12345, 0);
+ if (x1 != NULL) {
+ cmsDeleteTransform(x1);
+ return 0;
+ }
x1 = cmsCreateTransform(h1, TYPE_CMYK_8, h1, TYPE_RGB_8, 0, 0);
- if (x1 != NULL) {
- cmsDeleteTransform(x1);
- return 0;
- }
-
- x1 = cmsCreateTransform(h1, TYPE_RGB_8, h1, TYPE_CMYK_8, 1, 0);
- if (x1 != NULL) {
- cmsDeleteTransform(x1);
- return 0;
- }
-
- // sRGB does its output as XYZ!
- x1 = cmsCreateTransform(h1, TYPE_RGB_8, NULL, TYPE_Lab_8, 1, 0);
- if (x1 != NULL) {
- cmsDeleteTransform(x1);
- return 0;
- }
-
- cmsCloseProfile(h1);
- return 1;
+ if (x1 != NULL) {
+ cmsDeleteTransform(x1);
+ return 0;
+ }
+
+ x1 = cmsCreateTransform(h1, TYPE_RGB_8, h1, TYPE_CMYK_8, 1, 0);
+ if (x1 != NULL) {
+ cmsDeleteTransform(x1);
+ return 0;
+ }
+
+ // sRGB does its output as XYZ!
+ x1 = cmsCreateTransform(h1, TYPE_RGB_8, NULL, TYPE_Lab_8, 1, 0);
+ if (x1 != NULL) {
+ cmsDeleteTransform(x1);
+ return 0;
+ }
+
+ cmsCloseProfile(h1);
+ return 1;
}
@@ -5661,7 +5730,6 @@ cmsInt32Number CheckOneRGB_f(cmsHTRANSFORM xform, cmsInt32Number R, cmsInt32Numb
IsGoodVal("Z", Z , Out[2], err);
}
-
static
cmsInt32Number Chack_sRGB_Float(void)
{
@@ -7262,7 +7330,6 @@ int main(int argc, char* argv[])
cmsInt32Number Exhaustive = 0;
cmsInt32Number DoSpeedTests = 1;
-
#ifdef _MSC_VER
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
@@ -7405,6 +7472,9 @@ int main(int argc, char* argv[])
Check("Usual formatters", CheckFormatters16);
Check("Floating point formatters", CheckFormattersFloat);
+ // ChangeBuffersFormat
+ Check("ChangeBuffersFormat", CheckChangeBufferFormat);
+
// MLU
Check("Multilocalized Unicode", CheckMLU);
diff --git a/utils/common/utils.h b/utils/common/utils.h
index 322d310..8f82ea4 100644
--- a/utils/common/utils.h
+++ b/utils/common/utils.h
@@ -49,6 +49,10 @@
#include <math.h>
#include <wchar.h>
+// Avoid warnings
+
+#define UTILS_UNUSED_PARAMETER(x) ((void)x)
+
// Init the utility functions
void InitUtils(const char* PName);
diff --git a/utils/common/vprf.c b/utils/common/vprf.c
index deb494a..bf89230 100644
--- a/utils/common/vprf.c
+++ b/utils/common/vprf.c
@@ -50,6 +50,9 @@ void MyErrorLogHandler(cmsContext ContextID, cmsUInt32Number ErrorCode, const ch
{
if (Verbose >= 0)
fprintf(stderr, "[%s]: %s\n", ProgramName, Text);
+
+ UTILS_UNUSED_PARAMETER(ErrorCode);
+ UTILS_UNUSED_PARAMETER(ContextID);
}
diff --git a/utils/jpgicc/jpgicc.c b/utils/jpgicc/jpgicc.c
index 1ab7c72..d212891 100644
--- a/utils/jpgicc/jpgicc.c
+++ b/utils/jpgicc/jpgicc.c
@@ -813,6 +813,8 @@ int TransformImage(char *cDefInpProf, char *cOutProf)
hOut, wOutput,
hProof, Intent,
ProofingIntent, dwFlags);
+ if (xform == NULL)
+ FatalError("Cannot transform by using the profiles");
DoTransform(xform, OutputColorSpace);
diff --git a/utils/tificc/tificc.c b/utils/tificc/tificc.c
index b0363c2..4d972b1 100644
--- a/utils/tificc/tificc.c
+++ b/utils/tificc/tificc.c
@@ -143,6 +143,9 @@ unsigned char* UnrollTIFFLab8(struct _cmstransform_struct* CMMcargo,
wIn[2] = (cmsUInt16Number) FromLabV2ToLabV4(((accum[2] > 127) ? (accum[2] - 128) : (accum[2] + 128)) << 8);
return accum + 3;
+
+ UTILS_UNUSED_PARAMETER(Stride);
+ UTILS_UNUSED_PARAMETER(CMMcargo);
}
static
@@ -162,6 +165,9 @@ unsigned char* PackTIFFLab8(struct _cmstransform_struct* CMMcargo,
*output++ = (cmsUInt8Number) ((b < 128) ? (b + 128) : (b - 128));
return output;
+
+ UTILS_UNUSED_PARAMETER(Stride);
+ UTILS_UNUSED_PARAMETER(CMMcargo);
}