diff options
author | Robin Watts <robin.watts@artifex.com> | 2018-10-14 00:06:46 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2018-10-15 13:46:46 +0100 |
commit | 90b8faa80a4746f7f1e0966d6c56a687d2f8d333 (patch) | |
tree | 060f2aae149fe0861a39ef954abf1862e9694169 /lcms2mt | |
parent | fc61ee05129b7cafb22dbce5b93c9a80d30433f7 (diff) | |
download | ghostpdl-90b8faa80a4746f7f1e0966d6c56a687d2f8d333.tar.gz |
Pull in newly merged and updated LCMS2MT from MuPDF thirdparty repo.
The MuPDF repo should be considered canonical, as that is
the one that can pull in updates from upstream lcms2 easily.
Diffstat (limited to 'lcms2mt')
105 files changed, 2340 insertions, 1345 deletions
diff --git a/lcms2mt/AUTHORS b/lcms2mt/AUTHORS index 147246a38..dd801a9d1 100644 --- a/lcms2mt/AUTHORS +++ b/lcms2mt/AUTHORS @@ -37,6 +37,7 @@ John Hein Thomas Weber (Debian) Mark Allen Noel Carboni +Sergei Trofimovic Special Thanks -------------- diff --git a/lcms2mt/ChangeLog b/lcms2mt/ChangeLog index b9b6df9ba..49342f049 100644 --- a/lcms2mt/ChangeLog +++ b/lcms2mt/ChangeLog @@ -27,6 +27,9 @@ Extend T_EXTRA etc to allow for 63 extra channels. Several fixes related with security, and therefore not detailed here. C++ compiles now without warnings Added OSX and clang in travis +Added a travis-ci test matrix for many compilers and OS. Thanks to Thomas Weber (debian) for this great improvement. +testbed can now work with dynamic versions of library +Fixed wrong planar formatters regarding linestride interpretation ----------------------- 2.8 Featured release @@ -165,7 +168,7 @@ Fixed a 0 byte allocation issue in _cmsCreateSubAllocChunk Pascal unit now is supported by Free Pascal Compiler Fixed a bug on ReadRAWtag Added dictionary metatag support -Fixed a bug in black preservation and sligtly non-monotonic curves +Fixed a bug in black preservation and slightly non-monotonic curves Added named color functionality Fixed a bug that made crash black preservation on CMYK2CMYK devicelinks Added functions to retrieve formatters from transforms diff --git a/lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj b/lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj index eef52169f..c2ff9cd3c 100644 --- a/lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj +++ b/lcms2mt/Projects/VC2010/jpegicc/jpegicc.vcxproj @@ -190,7 +190,7 @@ <ClCompile Include="..\..\..\utils\jpgicc\jpgicc.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2010/lcms2mt.rc b/lcms2mt/Projects/VC2010/lcms2mt.rc new file mode 100644 index 000000000..2d0d0a8ff --- /dev/null +++ b/lcms2mt/Projects/VC2010/lcms2mt.rc @@ -0,0 +1,104 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Spanish (Spain, International Sort) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN) +LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +1 VERSIONINFO + FILEVERSION 2,8,0,0 + PRODUCTVERSION 2,8,0,0 + FILEFLAGSMASK 0x0L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Marti Maria" + VALUE "FileDescription", "lcms color engine" + VALUE "FileVersion", "2.9.0.0" + VALUE "InternalName", "lcms" + VALUE "LegalCopyright", "Copyright © Marti Maria 2017" + VALUE "OriginalFilename", "lcms2mt.dll" + VALUE "ProductName", "LittleCMS color engine" + VALUE "ProductVersion", "2.9.0.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // Spanish (Spain, International Sort) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/lcms2mt/Projects/VC2010/lcms2mt.sln b/lcms2mt/Projects/VC2010/lcms2mt.sln Binary files differnew file mode 100644 index 000000000..79ac5edb2 --- /dev/null +++ b/lcms2mt/Projects/VC2010/lcms2mt.sln diff --git a/lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj b/lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj new file mode 100644 index 000000000..a5e717859 --- /dev/null +++ b/lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid> + <RootNamespace>lcms2mt_DLL</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\</OutDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\</OutDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">lcms2mt</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">lcms2mt</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">lcms2mt</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">lcms2mt</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CMS_DLL_BUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <ModuleDefinitionFile>..\..\..\src\lcms2mt.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <TargetMachine>MachineX86</TargetMachine> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CMS_DLL_BUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <ModuleDefinitionFile> + </ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>Full</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <WholeProgramOptimization>true</WholeProgramOptimization> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CMS_DLL_BUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <StringPooling>true</StringPooling> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <ModuleDefinitionFile>..\..\..\src\lcms2mt.def</ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX86</TargetMachine> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>Full</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <WholeProgramOptimization>true</WholeProgramOptimization> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CMS_DLL_BUILD;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <StringPooling>true</StringPooling> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <ModuleDefinitionFile> + </ModuleDefinitionFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\src\cmsalpha.c" /> + <ClCompile Include="..\..\..\src\cmscam02.c" /> + <ClCompile Include="..\..\..\src\cmscgats.c" /> + <ClCompile Include="..\..\..\src\cmscnvrt.c" /> + <ClCompile Include="..\..\..\src\cmserr.c" /> + <ClCompile Include="..\..\..\src\cmsgamma.c" /> + <ClCompile Include="..\..\..\src\cmsgmt.c" /> + <ClCompile Include="..\..\..\src\cmshalf.c" /> + <ClCompile Include="..\..\..\src\cmsintrp.c" /> + <ClCompile Include="..\..\..\src\cmsio0.c" /> + <ClCompile Include="..\..\..\src\cmsio1.c" /> + <ClCompile Include="..\..\..\src\cmslut.c" /> + <ClCompile Include="..\..\..\src\cmsmd5.c" /> + <ClCompile Include="..\..\..\src\cmsmtrx.c" /> + <ClCompile Include="..\..\..\src\cmsnamed.c" /> + <ClCompile Include="..\..\..\src\cmsopt.c" /> + <ClCompile Include="..\..\..\src\cmspack.c" /> + <ClCompile Include="..\..\..\src\cmspcs.c" /> + <ClCompile Include="..\..\..\src\cmsplugin.c" /> + <ClCompile Include="..\..\..\src\cmsps2.c" /> + <ClCompile Include="..\..\..\src\cmssamp.c" /> + <ClCompile Include="..\..\..\src\cmssm.c" /> + <ClCompile Include="..\..\..\src\cmstypes.c" /> + <ClCompile Include="..\..\..\src\cmsvirt.c" /> + <ClCompile Include="..\..\..\src\cmswtpnt.c" /> + <ClCompile Include="..\..\..\src\cmsxform.c" /> + </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\..\src\lcms2mt.def" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\src\lcms2_internal.h" /> + <ClInclude Include="..\..\..\include\lcms2mt.h" /> + <ClInclude Include="..\..\..\include\lcms2mt_plugin.h" /> + <ClInclude Include="..\resource.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\lcms2mt.rc" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters b/lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters new file mode 100644 index 000000000..c83b554e8 --- /dev/null +++ b/lcms2mt/Projects/VC2010/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\src\cmsalpha.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmscam02.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmscgats.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmscnvrt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmserr.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsgamma.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsgmt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsintrp.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsio0.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsio1.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmslut.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsmd5.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsmtrx.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsnamed.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsopt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmspack.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmspcs.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsplugin.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsps2.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmssamp.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmssm.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmstypes.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsvirt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmswtpnt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsxform.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmshalf.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\include\lcms2mt.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\lcms2mt_plugin.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\src\lcms2_internal.h"> + <Filter>Source Files</Filter> + </ClInclude> + <ClInclude Include="..\resource.h"> + <Filter>Resource Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\lcms2mt.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <CustomBuild Include="..\..\..\src\lcms2mt.def"> + <Filter>Source Files</Filter> + </CustomBuild> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj b/lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj new file mode 100644 index 000000000..96e12f20f --- /dev/null +++ b/lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj @@ -0,0 +1,194 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid> + <RootNamespace>lcms2mt_static</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\Lib\MS\</OutDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\Lib\MS\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\Lib\MS\</OutDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\Lib\MS\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <FunctionLevelLinking> + </FunctionLevelLinking> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <MinimalRebuild> + </MinimalRebuild> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <FunctionLevelLinking> + </FunctionLevelLinking> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>Full</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <ExceptionHandling>false</ExceptionHandling> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>Full</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level4</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <ExceptionHandling>false</ExceptionHandling> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\src\cmsalpha.c" /> + <ClCompile Include="..\..\..\src\cmscam02.c" /> + <ClCompile Include="..\..\..\src\cmscgats.c" /> + <ClCompile Include="..\..\..\src\cmscnvrt.c" /> + <ClCompile Include="..\..\..\src\cmserr.c" /> + <ClCompile Include="..\..\..\src\cmsgamma.c" /> + <ClCompile Include="..\..\..\src\cmsgmt.c" /> + <ClCompile Include="..\..\..\src\cmshalf.c" /> + <ClCompile Include="..\..\..\src\cmsintrp.c" /> + <ClCompile Include="..\..\..\src\cmsio0.c" /> + <ClCompile Include="..\..\..\src\cmsio1.c" /> + <ClCompile Include="..\..\..\src\cmslut.c" /> + <ClCompile Include="..\..\..\src\cmsmd5.c" /> + <ClCompile Include="..\..\..\src\cmsmtrx.c" /> + <ClCompile Include="..\..\..\src\cmsnamed.c" /> + <ClCompile Include="..\..\..\src\cmsopt.c" /> + <ClCompile Include="..\..\..\src\cmspack.c" /> + <ClCompile Include="..\..\..\src\cmspcs.c" /> + <ClCompile Include="..\..\..\src\cmsplugin.c" /> + <ClCompile Include="..\..\..\src\cmsps2.c" /> + <ClCompile Include="..\..\..\src\cmssamp.c" /> + <ClCompile Include="..\..\..\src\cmssm.c" /> + <ClCompile Include="..\..\..\src\cmstypes.c" /> + <ClCompile Include="..\..\..\src\cmsvirt.c" /> + <ClCompile Include="..\..\..\src\cmswtpnt.c" /> + <ClCompile Include="..\..\..\src\cmsxform.c" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\src\lcms2_internal.h" /> + <ClInclude Include="..\..\..\include\lcms2mt.h" /> + <ClInclude Include="..\..\..\include\lcms2mt_plugin.h" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj.filters b/lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj.filters new file mode 100644 index 000000000..712f6eb48 --- /dev/null +++ b/lcms2mt/Projects/VC2010/lcms2mt_static/lcms2mt_static.vcxproj.filters @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\..\src\cmsalpha.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmscam02.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmscgats.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmscnvrt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmserr.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsgamma.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsgmt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsintrp.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsio0.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsio1.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmslut.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsmd5.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsmtrx.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsnamed.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsopt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmspack.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmspcs.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsplugin.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsps2.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmssamp.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmssm.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmstypes.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsvirt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmswtpnt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmsxform.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\cmshalf.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\include\lcms2mt.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\lcms2mt_plugin.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\src\lcms2_internal.h"> + <Filter>Source Files</Filter> + </ClInclude> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj b/lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj index 567aaa603..eeabfe794 100644 --- a/lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj +++ b/lcms2mt/Projects/VC2010/linkicc/linkicc.vcxproj @@ -171,7 +171,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2010/psicc/psicc.vcxproj b/lcms2mt/Projects/VC2010/psicc/psicc.vcxproj index 739081016..b2c3b171c 100644 --- a/lcms2mt/Projects/VC2010/psicc/psicc.vcxproj +++ b/lcms2mt/Projects/VC2010/psicc/psicc.vcxproj @@ -171,7 +171,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2010/testbed/testbed.vcxproj b/lcms2mt/Projects/VC2010/testbed/testbed.vcxproj index ff9bb8740..917bdec9d 100644 --- a/lcms2mt/Projects/VC2010/testbed/testbed.vcxproj +++ b/lcms2mt/Projects/VC2010/testbed/testbed.vcxproj @@ -182,7 +182,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj b/lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj index abb471075..398f8a655 100644 --- a/lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj +++ b/lcms2mt/Projects/VC2010/tiffdiff/tiffdiff.vcxproj @@ -185,7 +185,7 @@ <ClCompile Include="..\..\..\utils\tificc\tifdiff.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj b/lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj index cf2ec993e..1b7f08218 100644 --- a/lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj +++ b/lcms2mt/Projects/VC2010/tifficc/tifficc.vcxproj @@ -186,7 +186,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2010/transicc/transicc.vcxproj b/lcms2mt/Projects/VC2010/transicc/transicc.vcxproj index 4fd530f33..e9ba6bfd5 100644 --- a/lcms2mt/Projects/VC2010/transicc/transicc.vcxproj +++ b/lcms2mt/Projects/VC2010/transicc/transicc.vcxproj @@ -174,7 +174,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj b/lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj index 6a059b6fb..8212c27ae 100755 --- a/lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj +++ b/lcms2mt/Projects/VC2012/jpegicc/jpegicc.vcxproj @@ -203,7 +203,7 @@ <ClCompile Include="..\..\..\utils\jpgicc\jpgicc.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj b/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj index 4e74762c4..52e3c7fab 100644 --- a/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj +++ b/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj @@ -250,4 +250,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters b/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters index 6586e00c3..c83b554e8 100644 --- a/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters +++ b/lcms2mt/Projects/VC2012/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters @@ -15,6 +15,9 @@ </Filter> </ItemGroup> <ItemGroup> + <ClCompile Include="..\..\..\src\cmsalpha.c"> + <Filter>Source Files</Filter> + </ClCompile> <ClCompile Include="..\..\..\src\cmscam02.c"> <Filter>Source Files</Filter> </ClCompile> @@ -115,4 +118,4 @@ <Filter>Source Files</Filter> </CustomBuild> </ItemGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj b/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj index 78762af3b..687eaef89 100644 --- a/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj +++ b/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj @@ -203,4 +203,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters b/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters index 2ce9f025c..712f6eb48 100644 --- a/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters +++ b/lcms2mt/Projects/VC2012/lcms2mt_static/lcms2mt_static.vcxproj.filters @@ -15,6 +15,9 @@ </Filter> </ItemGroup> <ItemGroup> + <ClCompile Include="..\..\..\src\cmsalpha.c"> + <Filter>Source Files</Filter> + </ClCompile> <ClCompile Include="..\..\..\src\cmscam02.c"> <Filter>Source Files</Filter> </ClCompile> @@ -102,4 +105,4 @@ <Filter>Source Files</Filter> </ClInclude> </ItemGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj b/lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj index d1b1eac7e..b16190e8e 100755 --- a/lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj +++ b/lcms2mt/Projects/VC2012/linkicc/linkicc.vcxproj @@ -180,7 +180,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/psicc/psicc.vcxproj b/lcms2mt/Projects/VC2012/psicc/psicc.vcxproj index 043c31ac4..c18f74e15 100755 --- a/lcms2mt/Projects/VC2012/psicc/psicc.vcxproj +++ b/lcms2mt/Projects/VC2012/psicc/psicc.vcxproj @@ -180,7 +180,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/testbed/testbed.vcxproj b/lcms2mt/Projects/VC2012/testbed/testbed.vcxproj index 5b10cf595..5c2238ade 100755 --- a/lcms2mt/Projects/VC2012/testbed/testbed.vcxproj +++ b/lcms2mt/Projects/VC2012/testbed/testbed.vcxproj @@ -191,7 +191,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj b/lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj index c2c5dc893..1287a73a2 100755 --- a/lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj +++ b/lcms2mt/Projects/VC2012/tiffdiff/tiffdiff.vcxproj @@ -198,7 +198,7 @@ <ClCompile Include="..\..\..\utils\tificc\tifdiff.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj b/lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj index b2502a816..0e5c5c7bd 100755 --- a/lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj +++ b/lcms2mt/Projects/VC2012/tifficc/tifficc.vcxproj @@ -199,7 +199,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2012/transicc/transicc.vcxproj b/lcms2mt/Projects/VC2012/transicc/transicc.vcxproj index 1f89ceec1..22a2c6dfb 100755 --- a/lcms2mt/Projects/VC2012/transicc/transicc.vcxproj +++ b/lcms2mt/Projects/VC2012/transicc/transicc.vcxproj @@ -183,7 +183,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj b/lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj index 5e4eaa91e..106e9cd56 100755 --- a/lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj +++ b/lcms2mt/Projects/VC2013/jpegicc/jpegicc.vcxproj @@ -203,7 +203,7 @@ <ClCompile Include="..\..\..\utils\jpgicc\jpgicc.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/lcms2mt.sln b/lcms2mt/Projects/VC2013/lcms2mt.sln Binary files differindex 75496c7b0..750350596 100644 --- a/lcms2mt/Projects/VC2013/lcms2mt.sln +++ b/lcms2mt/Projects/VC2013/lcms2mt.sln diff --git a/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj b/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj index 129d5705e..7f73cdeb1 100644 --- a/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj +++ b/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj @@ -250,4 +250,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters b/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters index 4d685cce7..c9542c762 100644 --- a/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters +++ b/lcms2mt/Projects/VC2013/lcms2mt_DLL/lcms2mt_DLL.vcxproj.filters @@ -118,4 +118,4 @@ <Filter>Source Files</Filter> </CustomBuild> </ItemGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj b/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj index e3f3657ee..f7b4f7b4d 100644 --- a/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj +++ b/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj @@ -204,4 +204,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters b/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters index fdb810182..911498254 100644 --- a/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters +++ b/lcms2mt/Projects/VC2013/lcms2mt_static/lcms2mt_static.vcxproj.filters @@ -105,4 +105,4 @@ <Filter>Source Files</Filter> </ClInclude> </ItemGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj b/lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj index 7b230f180..d712a5f51 100755 --- a/lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj +++ b/lcms2mt/Projects/VC2013/linkicc/linkicc.vcxproj @@ -180,7 +180,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/psicc/psicc.vcxproj b/lcms2mt/Projects/VC2013/psicc/psicc.vcxproj index 6a56d0f71..c11343383 100755 --- a/lcms2mt/Projects/VC2013/psicc/psicc.vcxproj +++ b/lcms2mt/Projects/VC2013/psicc/psicc.vcxproj @@ -180,7 +180,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/testbed/testbed.vcxproj b/lcms2mt/Projects/VC2013/testbed/testbed.vcxproj index 522fa4a43..59838ff55 100755 --- a/lcms2mt/Projects/VC2013/testbed/testbed.vcxproj +++ b/lcms2mt/Projects/VC2013/testbed/testbed.vcxproj @@ -191,7 +191,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj b/lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj index 0c47e887c..e4042d46b 100755 --- a/lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj +++ b/lcms2mt/Projects/VC2013/tiffdiff/tiffdiff.vcxproj @@ -198,7 +198,7 @@ <ClCompile Include="..\..\..\utils\tificc\tifdiff.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj b/lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj index 664ad3c16..5a9b402e9 100755 --- a/lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj +++ b/lcms2mt/Projects/VC2013/tifficc/tifficc.vcxproj @@ -199,7 +199,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2013/transicc/transicc.vcxproj b/lcms2mt/Projects/VC2013/transicc/transicc.vcxproj index 5c65dec97..515fe7889 100755 --- a/lcms2mt/Projects/VC2013/transicc/transicc.vcxproj +++ b/lcms2mt/Projects/VC2013/transicc/transicc.vcxproj @@ -183,7 +183,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj b/lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj index ebe1e2919..e5db27bbd 100644 --- a/lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj +++ b/lcms2mt/Projects/VC2015/jpegicc/jpegicc.vcxproj @@ -203,7 +203,7 @@ <ClCompile Include="..\..\..\utils\jpgicc\jpgicc.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/lcms2mt.sln b/lcms2mt/Projects/VC2015/lcms2mt.sln Binary files differindex 2b5e57a40..402cb8edc 100644 --- a/lcms2mt/Projects/VC2015/lcms2mt.sln +++ b/lcms2mt/Projects/VC2015/lcms2mt.sln diff --git a/lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj b/lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj index 18ee95568..3587398a0 100644 --- a/lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj +++ b/lcms2mt/Projects/VC2015/linkicc/linkicc.vcxproj @@ -181,7 +181,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/psicc/psicc.vcxproj b/lcms2mt/Projects/VC2015/psicc/psicc.vcxproj index 938c31264..d93405663 100644 --- a/lcms2mt/Projects/VC2015/psicc/psicc.vcxproj +++ b/lcms2mt/Projects/VC2015/psicc/psicc.vcxproj @@ -181,7 +181,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/testbed/testbed.vcxproj b/lcms2mt/Projects/VC2015/testbed/testbed.vcxproj index 63e979457..4f64b820a 100644 --- a/lcms2mt/Projects/VC2015/testbed/testbed.vcxproj +++ b/lcms2mt/Projects/VC2015/testbed/testbed.vcxproj @@ -192,7 +192,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj b/lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj index 63a5eef0c..9d3e81429 100644 --- a/lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj +++ b/lcms2mt/Projects/VC2015/tiffdiff/tiffdiff.vcxproj @@ -199,7 +199,7 @@ <ClCompile Include="..\..\..\utils\tificc\tifdiff.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj b/lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj index 7de14c4b9..145e23f43 100644 --- a/lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj +++ b/lcms2mt/Projects/VC2015/tifficc/tifficc.vcxproj @@ -200,7 +200,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2015/transicc/transicc.vcxproj b/lcms2mt/Projects/VC2015/transicc/transicc.vcxproj index f96500605..4d3ff3d96 100644 --- a/lcms2mt/Projects/VC2015/transicc/transicc.vcxproj +++ b/lcms2mt/Projects/VC2015/transicc/transicc.vcxproj @@ -185,7 +185,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj b/lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj index ab26a53c0..27e6bd9df 100644 --- a/lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj +++ b/lcms2mt/Projects/VC2017/jpegicc/jpegicc.vcxproj @@ -22,6 +22,7 @@ <ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid> <RootNamespace>jpegicc</RootNamespace> <Keyword>Win32Proj</Keyword> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -203,7 +204,7 @@ <ClCompile Include="..\..\..\utils\jpgicc\jpgicc.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/lcms2mt.sln b/lcms2mt/Projects/VC2017/lcms2mt.sln Binary files differindex 2b5e57a40..402cb8edc 100644 --- a/lcms2mt/Projects/VC2017/lcms2mt.sln +++ b/lcms2mt/Projects/VC2017/lcms2mt.sln diff --git a/lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj b/lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj index 727954539..e258c0de3 100644 --- a/lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj +++ b/lcms2mt/Projects/VC2017/lcms2mt_DLL/lcms2mt_DLL.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid> <RootNamespace>lcms2mt_DLL</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> diff --git a/lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj b/lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj index 283a91923..0d26f770c 100644 --- a/lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj +++ b/lcms2mt/Projects/VC2017/lcms2mt_static/lcms2mt_static.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid> <RootNamespace>lcms2mt_static</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> diff --git a/lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj b/lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj index 30c2b4ef4..9b5ecaea0 100644 --- a/lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj +++ b/lcms2mt/Projects/VC2017/linkicc/linkicc.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid> <RootNamespace>linkicc</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -181,7 +181,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/psicc/psicc.vcxproj b/lcms2mt/Projects/VC2017/psicc/psicc.vcxproj index 9dcf89a09..480d4e929 100644 --- a/lcms2mt/Projects/VC2017/psicc/psicc.vcxproj +++ b/lcms2mt/Projects/VC2017/psicc/psicc.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid> <RootNamespace>psicc</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -181,7 +181,7 @@ <ClCompile Include="..\..\..\utils\common\xgetopt.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/testbed/testbed.vcxproj b/lcms2mt/Projects/VC2017/testbed/testbed.vcxproj index 0af376217..6bc65d377 100644 --- a/lcms2mt/Projects/VC2017/testbed/testbed.vcxproj +++ b/lcms2mt/Projects/VC2017/testbed/testbed.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid> <RootNamespace>testbed</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -192,7 +192,7 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj index 7edfe2816..36875cfaa 100644 --- a/lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj +++ b/lcms2mt/Projects/VC2017/tiffdiff/tiffdiff.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid> <RootNamespace>tiffdiff</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -199,7 +199,7 @@ <ClCompile Include="..\..\..\utils\tificc\tifdiff.c" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj b/lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj index cd9f04c2c..05a868607 100644 --- a/lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj +++ b/lcms2mt/Projects/VC2017/tifficc/tifficc.vcxproj @@ -22,7 +22,7 @@ <ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid> <RootNamespace>tifficc</RootNamespace> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -200,7 +200,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/Projects/VC2017/transicc/transicc.vcxproj b/lcms2mt/Projects/VC2017/transicc/transicc.vcxproj index d9b77c6c1..3d7de6826 100644 --- a/lcms2mt/Projects/VC2017/transicc/transicc.vcxproj +++ b/lcms2mt/Projects/VC2017/transicc/transicc.vcxproj @@ -22,6 +22,7 @@ <ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid> <RootNamespace>transicc</RootNamespace> <Keyword>Win32Proj</Keyword> + <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> @@ -185,7 +186,7 @@ <ClInclude Include="..\..\..\utils\common\utils.h" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj"> + <ProjectReference Include="..\lcms2mt_static\lcms2mt_static.vcxproj"> <Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> diff --git a/lcms2mt/config.guess b/lcms2mt/config.guess index 6c32c8645..e7464614e 100755 --- a/lcms2mt/config.guess +++ b/lcms2mt/config.guess @@ -1100,7 +1100,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configuration will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; diff --git a/lcms2mt/doc/WhyThisFork.txt b/lcms2mt/doc/WhyThisFork.txt index bb91283c4..e3cbde475 100644 --- a/lcms2mt/doc/WhyThisFork.txt +++ b/lcms2mt/doc/WhyThisFork.txt @@ -1,5 +1,5 @@ LCMS 2.9.MT - ============ + =========== Why does this fork exist? ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -45,8 +45,8 @@ Put simply, we ran into problems with using LCMS in a multi-threaded environment. A few years ago, Marti kindly made some changes within LittleCMS -intended to enable us to safely use LCMS with Ghostscript when run -with multiple threads. +to enable us to safely use LCMS with Ghostscript when run with +multiple threads. Specifically, Ghostscript needed to use different allocators from each thread. In order to account for this, Marti added the idea @@ -111,7 +111,7 @@ new buffer format handlers. Since the underlying tables for the link are shared, the cost of cloning the profile is very low. In addition, we've made 1 other change that breaks the ABI, but not -the API. +the API: 5) The organisation of the flags word used to describe the format of input/output pixels has been altered to accommodate more 'extra' diff --git a/lcms2mt/include/lcms2mt.h b/lcms2mt/include/lcms2mt.h index fcf0965c9..d36115d22 100644 --- a/lcms2mt/include/lcms2mt.h +++ b/lcms2mt/include/lcms2mt.h @@ -1041,10 +1041,8 @@ CMSAPI void* CMSEXPORT cmsGetContextUserData(cmsContext ContextID); // Plug-In registering -------------------------------------------------------------------------------------------------- -CMSAPI cmsBool CMSEXPORT cmsPlugin(void* Plugin); -CMSAPI cmsBool CMSEXPORT cmsPluginTHR(cmsContext ContextID, void* Plugin); +CMSAPI cmsBool CMSEXPORT cmsPlugin(cmsContext ContextID, void* Plugin); CMSAPI void CMSEXPORT cmsUnregisterPlugins(cmsContext ContextID); -CMSAPI void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID); // Error logging ---------------------------------------------------------------------------------------------------------- @@ -1080,8 +1078,7 @@ CMSAPI void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID) typedef void (* cmsLogErrorHandlerFunction)(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text); // Allows user to set any specific logger -CMSAPI void CMSEXPORT cmsSetLogErrorHandler(cmsLogErrorHandlerFunction Fn); -CMSAPI void CMSEXPORT cmsSetLogErrorHandlerTHR(cmsContext ContextID, cmsLogErrorHandlerFunction Fn); +CMSAPI void CMSEXPORT cmsSetLogErrorHandler(cmsContext ContextID, cmsLogErrorHandlerFunction Fn); // Conversions -------------------------------------------------------------------------------------------------------------- @@ -1536,14 +1533,11 @@ CMSAPI cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPRO // Profile high level functions ------------------------------------------------------------------------------------------ -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFileTHR(cmsContext ContextID, const char *ICCProfile, const char *sAccess); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStream(FILE* ICCProfile, const char* sAccess); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStreamTHR(cmsContext ContextID, FILE* ICCProfile, const char* sAccess); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(const void * MemPtr, cmsUInt32Number dwSize); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void * MemPtr, cmsUInt32Number dwSize); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandlerTHR(cmsContext ContextID, cmsIOHANDLER* io); -CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2THR(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write); +CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromFile(cmsContext ContextID, const char *ICCProfile, const char *sAccess); +CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromStream(cmsContext ContextID, FILE* ICCProfile, const char* sAccess); +CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(cmsContext ContextID, const void * MemPtr, cmsUInt32Number dwSize); +CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler(cmsContext ContextID, cmsIOHANDLER* io); +CMSAPI cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write); CMSAPI cmsBool CMSEXPORT cmsCloseProfile(cmsContext ContextID, cmsHPROFILE hProfile); CMSAPI cmsBool CMSEXPORT cmsSaveProfileToFile(cmsContext ContextID, cmsHPROFILE hProfile, const char* FileName); @@ -1553,68 +1547,48 @@ CMSAPI cmsUInt32Number CMSEXPORT cmsSaveProfileToIOhandler(cmsContext ContextID // Predefined virtual profiles ------------------------------------------------------------------------------------------ -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfileTHR(cmsContext ContextID, - const cmsCIExyY* WhitePoint, - const cmsCIExyYTRIPLE* Primaries, - cmsToneCurve* const TransferFunction[3]); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfile(cmsContext ContextID, + const cmsCIExyY* WhitePoint, + const cmsCIExyYTRIPLE* Primaries, + cmsToneCurve* const TransferFunction[3]); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateRGBProfile(const cmsCIExyY* WhitePoint, - const cmsCIExyYTRIPLE* Primaries, - cmsToneCurve* const TransferFunction[3]); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfile(cmsContext ContextID, + const cmsCIExyY* WhitePoint, + const cmsToneCurve* TransferFunction); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfileTHR(cmsContext ContextID, - const cmsCIExyY* WhitePoint, - const cmsToneCurve* TransferFunction); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLink(cmsContext ContextID, + cmsColorSpaceSignature ColorSpace, + cmsToneCurve* const TransferFunctions[]); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateGrayProfile(const cmsCIExyY* WhitePoint, - const cmsToneCurve* TransferFunction); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLink(cmsContext ContextID, + cmsColorSpaceSignature ColorSpace, + cmsFloat64Number Limit); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID, - cmsColorSpaceSignature ColorSpace, - cmsToneCurve* const TransferFunctions[]); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2Profile(cmsContext ContextID, + const cmsCIExyY* WhitePoint); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4Profile(cmsContext ContextID, + const cmsCIExyY* WhitePoint); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLink(cmsColorSpaceSignature ColorSpace, - cmsToneCurve* const TransferFunctions[]); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(cmsContext ContextID); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLinkTHR(cmsContext ContextID, - cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(cmsContext ContextID); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLink(cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(cmsContext ContextID, + cmsUInt32Number nLUTPoints, + cmsFloat64Number Bright, + cmsFloat64Number Contrast, + cmsFloat64Number Hue, + cmsFloat64Number Saturation, + cmsUInt32Number TempSrc, + cmsUInt32Number TempDest); - -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab2Profile(const cmsCIExyY* WhitePoint); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateLab4Profile(const cmsCIExyY* WhitePoint); - -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfileTHR(cmsContext ContextID); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(void); - -CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void); - -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID, - cmsUInt32Number nLUTPoints, - cmsFloat64Number Bright, - cmsFloat64Number Contrast, - cmsFloat64Number Hue, - cmsFloat64Number Saturation, - cmsUInt32Number TempSrc, - cmsUInt32Number TempDest); - -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(cmsUInt32Number nLUTPoints, - cmsFloat64Number Bright, - cmsFloat64Number Contrast, - cmsFloat64Number Hue, - cmsFloat64Number Saturation, - cmsUInt32Number TempSrc, - cmsUInt32Number TempDest); - -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID); -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfile(void); +CMSAPI cmsHPROFILE CMSEXPORT cmsCreateNULLProfile(cmsContext ContextID); // Converts a transform to a devicelink profile -CMSAPI cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsContext ContextID, cmsHTRANSFORM hTransform, cmsFloat64Number Version, cmsUInt32Number dwFlags); +CMSAPI cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsContext ContextID, + cmsHTRANSFORM hTransform, + cmsFloat64Number Version, + cmsUInt32Number dwFlags); // Intents ---------------------------------------------------------------------------------------------- @@ -1633,8 +1607,10 @@ CMSAPI cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsContext ContextID, #define INTENT_PRESERVE_K_PLANE_SATURATION 15 // Call with NULL as parameters to get the intent count -CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions); -CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID, cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions); +CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsContext ContextID, + cmsUInt32Number nMax, + cmsUInt32Number* Codes, + char** Descriptions); // Flags @@ -1649,7 +1625,7 @@ CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID // Misc #define cmsFLAGS_BLACKPOINTCOMPENSATION 0x2000 #define cmsFLAGS_NOWHITEONWHITEFIXUP 0x0004 // Don't fix scum dot -#define cmsFLAGS_HIGHRESPRECALC 0x0400 // Use more memory to give better accurancy +#define cmsFLAGS_HIGHRESPRECALC 0x0400 // Use more memory to give better accuracy #define cmsFLAGS_LOWRESPRECALC 0x0800 // Use less memory to minimize resources // For devicelink creation @@ -1676,7 +1652,7 @@ CMSAPI cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID // Transforms --------------------------------------------------------------------------------------------------- -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID, +CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransform(cmsContext ContextID, cmsHPROFILE Input, cmsUInt32Number InputFormat, cmsHPROFILE Output, @@ -1684,14 +1660,7 @@ CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID, cmsUInt32Number Intent, cmsUInt32Number dwFlags); -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransform(cmsHPROFILE Input, - cmsUInt32Number InputFormat, - cmsHPROFILE Output, - cmsUInt32Number OutputFormat, - cmsUInt32Number Intent, - cmsUInt32Number dwFlags); - -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext ContextID, +CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransform(cmsContext ContextID, cmsHPROFILE Input, cmsUInt32Number InputFormat, cmsHPROFILE Output, @@ -1701,16 +1670,7 @@ CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext Conte cmsUInt32Number ProofingIntent, cmsUInt32Number dwFlags); -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransform(cmsHPROFILE Input, - cmsUInt32Number InputFormat, - cmsHPROFILE Output, - cmsUInt32Number OutputFormat, - cmsHPROFILE Proofing, - cmsUInt32Number Intent, - cmsUInt32Number ProofingIntent, - cmsUInt32Number dwFlags); - -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext ContextID, +CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsContext ContextID, cmsHPROFILE hProfiles[], cmsUInt32Number nProfiles, cmsUInt32Number InputFormat, @@ -1719,14 +1679,6 @@ CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext C cmsUInt32Number dwFlags); -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[], - cmsUInt32Number nProfiles, - cmsUInt32Number InputFormat, - cmsUInt32Number OutputFormat, - cmsUInt32Number Intent, - cmsUInt32Number dwFlags); - - CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[], cmsBool BPC[], @@ -1765,20 +1717,15 @@ CMSAPI void CMSEXPORT cmsDoTransformLineStride(cmsContext ContextID, cmsUInt32Number BytesPerPlaneOut); -CMSAPI void CMSEXPORT cmsSetAlarmCodes(const cmsUInt16Number NewAlarm[cmsMAXCHANNELS]); -CMSAPI void CMSEXPORT cmsGetAlarmCodes(cmsUInt16Number NewAlarm[cmsMAXCHANNELS]); - - -CMSAPI void CMSEXPORT cmsSetAlarmCodesTHR(cmsContext ContextID, - const cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]); -CMSAPI void CMSEXPORT cmsGetAlarmCodesTHR(cmsContext ContextID, - cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]); +CMSAPI void CMSEXPORT cmsSetAlarmCodes(cmsContext ContextID, + const cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]); +CMSAPI void CMSEXPORT cmsGetAlarmCodes(cmsContext ContextID, + cmsUInt16Number AlarmCodes[cmsMAXCHANNELS]); // Adaptation state for absolute colorimetric intent -CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsFloat64Number d); -CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationStateTHR(cmsContext ContextID, cmsFloat64Number d); +CMSAPI cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsContext ContextID, cmsFloat64Number d); // Grab the input/output formats diff --git a/lcms2mt/include/lcms2mt_plugin.h b/lcms2mt/include/lcms2mt_plugin.h index 7035dd082..efd05a348 100644 --- a/lcms2mt/include/lcms2mt_plugin.h +++ b/lcms2mt/include/lcms2mt_plugin.h @@ -128,9 +128,9 @@ struct _cms_io_handler { }; // Endianness adjust functions -CMSAPI cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsContext ContextID, cmsUInt16Number Word); -CMSAPI cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsContext ContextID, cmsUInt32Number Value); -CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsContext ContextID, cmsUInt64Number* Result, cmsUInt64Number* QWord); +CMSAPI cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsUInt16Number Word); +CMSAPI cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number Value); +CMSAPI void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord); // Helper IO functions CMSAPI cmsBool CMSEXPORT _cmsReadUInt8Number(cmsContext ContextID, cmsIOHANDLER* io, cmsUInt8Number* n); diff --git a/lcms2mt/ltmain.sh b/lcms2mt/ltmain.sh index b395429f2..1b425a27f 100755 --- a/lcms2mt/ltmain.sh +++ b/lcms2mt/ltmain.sh @@ -189,7 +189,7 @@ func_basename () # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. -# value retuned in "$func_basename_result" +# value returned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. @@ -4394,7 +4394,7 @@ EOF { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then + have already dealt with, above (including dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll diff --git a/lcms2mt/src/cmsalpha.c b/lcms2mt/src/cmsalpha.c index 9ffe3b5d4..e64f9497b 100644 --- a/lcms2mt/src/cmsalpha.c +++ b/lcms2mt/src/cmsalpha.c @@ -28,6 +28,10 @@ // Alpha copy ------------------------------------------------------------------------------------------------------------------ +// This macro return words stored as big endian +#define CHANGE_ENDIAN(w) (cmsUInt16Number) ((cmsUInt16Number) ((w)<<8)|((w)>>8)) + + // Floor to byte, taking care of saturation cmsINLINE cmsUInt8Number _cmsQuickSaturateByte(cmsFloat64Number d) { @@ -75,6 +79,13 @@ void from8to16(void* dst, const void* src) } static +void from8to16SE(void* dst, const void* src) +{ + cmsUInt8Number n = *(cmsUInt8Number*)src; + *(cmsUInt16Number*)dst = CHANGE_ENDIAN(FROM_8_TO_16(n)); +} + +static void from8toFLT(void* dst, const void* src) { *(cmsFloat32Number*)dst = (*(cmsUInt8Number*)src) / 255.0f; @@ -108,24 +119,50 @@ void from16to8(void* dst, const void* src) } static +void from16SEto8(void* dst, const void* src) +{ + cmsUInt16Number n = *(cmsUInt16Number*)src; + *(cmsUInt8Number*)dst = FROM_16_TO_8(CHANGE_ENDIAN(n)); +} + +static void copy16(void* dst, const void* src) { memmove(dst, src, 2); } static +void from16to16(void* dst, const void* src) +{ + cmsUInt16Number n = *(cmsUInt16Number*)src; + *(cmsUInt16Number*)dst = CHANGE_ENDIAN(n); +} + +static void from16toFLT(void* dst, const void* src) { *(cmsFloat32Number*)dst = (*(cmsUInt16Number*)src) / 65535.0f; } static +void from16SEtoFLT(void* dst, const void* src) +{ + *(cmsFloat32Number*)dst = (CHANGE_ENDIAN(*(cmsUInt16Number*)src)) / 65535.0f; +} + +static void from16toDBL(void* dst, const void* src) { *(cmsFloat64Number*)dst = (*(cmsUInt16Number*)src) / 65535.0f; } static +void from16SEtoDBL(void* dst, const void* src) +{ + *(cmsFloat64Number*)dst = (CHANGE_ENDIAN(*(cmsUInt16Number*)src)) / 65535.0f; +} + +static void from16toHLF(void* dst, const void* src) { #ifndef CMS_NO_HALF_SUPPORT @@ -137,33 +174,53 @@ void from16toHLF(void* dst, const void* src) #endif } +static +void from16SEtoHLF(void* dst, const void* src) +{ +#ifndef CMS_NO_HALF_SUPPORT + cmsFloat32Number n = (CHANGE_ENDIAN(*(cmsUInt16Number*)src)) / 65535.0f; + *(cmsUInt16Number*)dst = _cmsFloat2Half(n); +#else + cmsUNUSED_PARAMETER(dst); + cmsUNUSED_PARAMETER(src); +#endif +} // From Float static void fromFLTto8(void* dst, const void* src) { - cmsFloat32Number n = *(cmsFloat32Number*)src; - *(cmsUInt8Number*)dst = _cmsQuickSaturateByte(n * 255.0f); + cmsFloat32Number n = *(cmsFloat32Number*)src; + *(cmsUInt8Number*)dst = _cmsQuickSaturateByte(n * 255.0f); } static void fromFLTto16(void* dst, const void* src) { - cmsFloat32Number n = *(cmsFloat32Number*)src; - *(cmsUInt16Number*)dst = _cmsQuickSaturateWord(n * 65535.0f); + cmsFloat32Number n = *(cmsFloat32Number*)src; + *(cmsUInt16Number*)dst = _cmsQuickSaturateWord(n * 65535.0f); +} + +static +void fromFLTto16SE(void* dst, const void* src) +{ + cmsFloat32Number n = *(cmsFloat32Number*)src; + cmsUInt16Number i = _cmsQuickSaturateWord(n * 65535.0f); + + *(cmsUInt16Number*)dst = CHANGE_ENDIAN(i); } static void copy32(void* dst, const void* src) { - memmove(dst, src, sizeof(cmsFloat32Number)); + memmove(dst, src, sizeof(cmsFloat32Number)); } static void fromFLTtoDBL(void* dst, const void* src) { - cmsFloat32Number n = *(cmsFloat32Number*)src; - *(cmsFloat64Number*)dst = (cmsFloat64Number)n; + cmsFloat32Number n = *(cmsFloat32Number*)src; + *(cmsFloat64Number*)dst = (cmsFloat64Number)n; } static @@ -207,6 +264,18 @@ void fromHLFto16(void* dst, const void* src) } static +void fromHLFto16SE(void* dst, const void* src) +{ +#ifndef CMS_NO_HALF_SUPPORT + cmsFloat32Number n = _cmsHalf2Float(*(cmsUInt16Number*)src); + cmsUInt16Number i = _cmsQuickSaturateWord(n * 65535.0f); + *(cmsUInt16Number*)dst = CHANGE_ENDIAN(i); +#else + cmsUNUSED_PARAMETER(dst); + cmsUNUSED_PARAMETER(src); +#endif +} +static void fromHLFtoFLT(void* dst, const void* src) { #ifndef CMS_NO_HALF_SUPPORT @@ -244,6 +313,13 @@ void fromDBLto16(void* dst, const void* src) } static +void fromDBLto16SE(void* dst, const void* src) +{ + cmsFloat64Number n = *(cmsFloat64Number*)src; + cmsUInt16Number i = _cmsQuickSaturateWord(n * 65535.0f); + *(cmsUInt16Number*)dst = CHANGE_ENDIAN(i); +} +static void fromDBLtoFLT(void* dst, const void* src) { cmsFloat64Number n = *(cmsFloat64Number*)src; @@ -276,18 +352,19 @@ int FormatterPos(cmsUInt32Number frm) cmsUInt32Number b = T_BYTES(frm); if (b == 0 && T_FLOAT(frm)) - return 4; // DBL + return 5; // DBL #ifndef CMS_NO_HALF_SUPPORT if (b == 2 && T_FLOAT(frm)) - return 2; // HLF + return 3; // HLF #endif if (b == 4 && T_FLOAT(frm)) - return 3; // FLT + return 4; // FLT if (b == 2 && !T_FLOAT(frm)) return 1; // 16 if (b == 1 && !T_FLOAT(frm)) return 0; // 8 - + if (b == 2 && T_ENDIAN16(frm)) + return 3; return -1; // not recognized } @@ -295,13 +372,14 @@ int FormatterPos(cmsUInt32Number frm) static cmsFormatterAlphaFn _cmsGetFormatterAlpha(cmsContext id, cmsUInt32Number in, cmsUInt32Number out) { -static cmsFormatterAlphaFn FormattersAlpha[5][5] = { +static cmsFormatterAlphaFn FormattersAlpha[6][6] = { - /* from 8 */ { copy8, from8to16, from8toHLF, from8toFLT, from8toDBL }, - /* from 16*/ { from16to8, copy16, from16toHLF, from16toFLT, from16toDBL }, - /* from HLF*/ { fromHLFto8, fromHLFto16, copy16, fromHLFtoFLT, fromHLFtoDBL }, - /* from FLT*/ { fromFLTto8, fromFLTto16, fromFLTtoHLF, copy32, fromFLTtoDBL }, - /* from DBL*/ { fromDBLto8, fromDBLto16, fromDBLtoHLF, fromDBLtoFLT, copy64 }}; + /* from 8 */ { copy8, from8to16, from8to16SE, from8toHLF, from8toFLT, from8toDBL }, + /* from 16*/ { from16to8, copy16, from16to16, from16toHLF, from16toFLT, from16toDBL }, + /* from 16SE*/{ from16SEto8, from16to16, copy16, from16SEtoHLF,from16SEtoFLT, from16SEtoDBL }, + /* from HLF*/ { fromHLFto8, fromHLFto16, fromHLFto16SE, copy16, fromHLFtoFLT, fromHLFtoDBL }, + /* from FLT*/ { fromFLTto8, fromFLTto16, fromFLTto16SE, fromFLTtoHLF, copy32, fromFLTtoDBL }, + /* from DBL*/ { fromDBLto8, fromDBLto16, fromDBLto16SE, fromDBLtoHLF, fromDBLtoFLT, copy64 }}; int in_n = FormatterPos(in); int out_n = FormatterPos(out); diff --git a/lcms2mt/src/cmscgats.c b/lcms2mt/src/cmscgats.c index d6cdf2b7e..50f7fb8f8 100644 --- a/lcms2mt/src/cmscgats.c +++ b/lcms2mt/src/cmscgats.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2017 Marti Maria Saguer +// Copyright (c) 1998-2018 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"), @@ -129,7 +129,7 @@ typedef struct _Table { // File stream being parsed typedef struct _FileContext { - char FileName[cmsMAX_PATH]; // File name if being readed from file + char FileName[cmsMAX_PATH]; // File name if being read from file FILE* Stream; // File stream or NULL if holded in memory } FILECTX; @@ -254,7 +254,7 @@ static PROPERTY PredefinedProperties[] = { // needed. {"SAMPLE_BACKING", WRITE_STRINGIFY}, // Identifies the backing material used behind the sample during - // measurement. Allowed values are “black”, “white”, or {"na". + // measurement. Allowed values are "black", "white", or {"na". {"CHISQ_DOF", WRITE_STRINGIFY}, // Degrees of freedom associated with the Chi squared statistic // below properties are new in recent specs: @@ -269,7 +269,7 @@ static PROPERTY PredefinedProperties[] = { // denote the use of filters such as none, D65, Red, Green or Blue. {"POLARIZATION", WRITE_STRINGIFY}, // Identifies the use of a physical polarization filter during measurement. Allowed - // values are {"yes”, “white”, “none” or “na”. + // values are {"yes", "white", "none" or "na". {"WEIGHTING_FUNCTION", WRITE_PAIR}, // Indicates such functions as: the CIE standard observer functions used in the // calculation of various data parameters (2 degree and 10 degree), CIE standard @@ -478,10 +478,8 @@ cmsBool Check(cmsContext ContextID, cmsIT8* it8, SYMBOL sy, const char* Err) // Read Next character from stream static -void NextCh(cmsContext ContextID, cmsIT8* it8) +void NextCh(cmsIT8* it8) { - cmsUNUSED_PARAMETER(ContextID); - if (it8 -> FileStack[it8 ->IncludeSP]->Stream) { it8 ->ch = fgetc(it8 ->FileStack[it8 ->IncludeSP]->Stream); @@ -506,12 +504,11 @@ void NextCh(cmsContext ContextID, cmsIT8* it8) // Try to see if current identifier is a keyword, if so return the referred symbol static -SYMBOL BinSrchKey(cmsContext ContextID, const char *id) +SYMBOL BinSrchKey(const char *id) { int l = 1; int r = NUMKEYS; int x, res; - cmsUNUSED_PARAMETER(ContextID); while (r >= l) { @@ -536,14 +533,14 @@ cmsFloat64Number xpow10(int n) // Reads a Real number, tries to follow from integer number static -void ReadReal(cmsContext ContextID, cmsIT8* it8, cmsInt32Number inum) +void ReadReal(cmsIT8* it8, cmsInt32Number inum) { it8->dnum = (cmsFloat64Number)inum; while (isdigit(it8->ch)) { it8->dnum = (cmsFloat64Number)it8->dnum * 10.0 + (cmsFloat64Number)(it8->ch - '0'); - NextCh(ContextID, it8); + NextCh(it8); } if (it8->ch == '.') { // Decimal point @@ -551,13 +548,13 @@ void ReadReal(cmsContext ContextID, cmsIT8* it8, cmsInt32Number inum) cmsFloat64Number frac = 0.0; // fraction int prec = 0; // precision - NextCh(ContextID, it8); // Eats dec. point + NextCh(it8); // Eats dec. point while (isdigit(it8->ch)) { frac = frac * 10.0 + (cmsFloat64Number)(it8->ch - '0'); prec++; - NextCh(ContextID, it8); + NextCh(it8); } it8->dnum = it8->dnum + (frac / xpow10(prec)); @@ -569,17 +566,17 @@ void ReadReal(cmsContext ContextID, cmsIT8* it8, cmsInt32Number inum) cmsInt32Number e; cmsInt32Number sgn; - NextCh(ContextID, it8); sgn = 1; + NextCh(it8); sgn = 1; if (it8->ch == '-') { - sgn = -1; NextCh(ContextID, it8); + sgn = -1; NextCh(it8); } else if (it8->ch == '+') { sgn = +1; - NextCh(ContextID, it8); + NextCh(it8); } e = 0; @@ -590,7 +587,7 @@ void ReadReal(cmsContext ContextID, cmsIT8* it8, cmsInt32Number inum) if ((cmsFloat64Number)e * 10.0 + (cmsFloat64Number)digit < (cmsFloat64Number)+2147483647.0) e = e * 10 + digit; - NextCh(ContextID, it8); + NextCh(it8); } e = sgn*e; @@ -602,11 +599,10 @@ void ReadReal(cmsContext ContextID, cmsIT8* it8, cmsInt32Number inum) // This can not call directly atof because it uses locale dependent // parsing, while CCMX files always use . as decimal separator static -cmsFloat64Number ParseFloatNumber(cmsContext ContextID, const char *Buffer) +cmsFloat64Number ParseFloatNumber(const char *Buffer) { cmsFloat64Number dnum = 0.0; int sign = 1; - cmsUNUSED_PARAMETER(ContextID); // keep safe if (Buffer == NULL) return 0.0; @@ -693,7 +689,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) do { while (isseparator(it8->ch)) - NextCh(ContextID, it8); + NextCh(it8); if (isfirstidchar(it8->ch)) { // Identifier @@ -704,14 +700,14 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) if (++k < MAXID) *idptr++ = (char) it8->ch; - NextCh(ContextID, it8); + NextCh(it8); } while (isidchar(it8->ch)); *idptr = '\0'; - key = BinSrchKey(ContextID, it8->id); + key = BinSrchKey(it8->id); if (key == SUNDEFINED) it8->sy = SIDENT; else it8->sy = key; @@ -723,7 +719,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) if (it8->ch == '-') { sign = -1; - NextCh(ContextID, it8); + NextCh(it8); } it8->inum = 0; @@ -731,12 +727,12 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) if (it8->ch == '0') { // 0xnnnn (Hexa) or 0bnnnn (Binary) - NextCh(ContextID, it8); + NextCh(it8); if (toupper(it8->ch) == 'X') { int j; - NextCh(ContextID, it8); + NextCh(it8); while (isxdigit(it8->ch)) { it8->ch = toupper(it8->ch); @@ -750,7 +746,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) } it8->inum = it8->inum * 16 + j; - NextCh(ContextID, it8); + NextCh(it8); } return; } @@ -759,7 +755,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) int j; - NextCh(ContextID, it8); + NextCh(it8); while (it8->ch == '0' || it8->ch == '1') { j = it8->ch - '0'; @@ -771,7 +767,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) } it8->inum = it8->inum * 2 + j; - NextCh(ContextID, it8); + NextCh(it8); } return; } @@ -783,19 +779,19 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) cmsInt32Number digit = (it8->ch - '0'); if ((cmsFloat64Number) it8->inum * 10.0 + (cmsFloat64Number) digit > (cmsFloat64Number) +2147483647.0) { - ReadReal(ContextID, it8, it8->inum); + ReadReal(it8, it8->inum); it8->sy = SDNUM; it8->dnum *= sign; return; } it8->inum = it8->inum * 10 + digit; - NextCh(ContextID, it8); + NextCh(it8); } if (it8->ch == '.') { - ReadReal(ContextID, it8, it8->inum); + ReadReal(it8, it8->inum); it8->sy = SDNUM; it8->dnum *= sign; return; @@ -822,7 +818,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) if (++k < MAXID) *idptr++ = (char) it8->ch; - NextCh(ContextID, it8); + NextCh(it8); } while (isidchar(it8->ch)); @@ -837,7 +833,7 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) // EOF marker -- ignore it case '\x1a': - NextCh(ContextID, it8); + NextCh(it8); break; // Eof stream markers @@ -849,24 +845,24 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) // Next line case '\r': - NextCh(ContextID, it8); + NextCh(it8); if (it8 ->ch == '\n') - NextCh(ContextID, it8); + NextCh(it8); it8->sy = SEOLN; it8->lineno++; break; case '\n': - NextCh(ContextID, it8); + NextCh(it8); it8->sy = SEOLN; it8->lineno++; break; // Comment case '#': - NextCh(ContextID, it8); + NextCh(it8); while (it8->ch && it8->ch != '\n' && it8->ch != '\r') - NextCh(ContextID, it8); + NextCh(it8); it8->sy = SCOMMENT; break; @@ -877,21 +873,21 @@ void InSymbol(cmsContext ContextID, cmsIT8* it8) idptr = it8->str; sng = it8->ch; k = 0; - NextCh(ContextID, it8); + NextCh(it8); while (k < (MAXSTR-1) && it8->ch != sng) { if (it8->ch == '\n'|| it8->ch == '\r') k = MAXSTR+1; else { *idptr++ = (char) it8->ch; - NextCh(ContextID, it8); + NextCh(it8); k++; } } it8->sy = SSTRING; *idptr = '\0'; - NextCh(ContextID, it8); + NextCh(it8); break; @@ -1421,7 +1417,7 @@ cmsFloat64Number CMSEXPORT cmsIT8GetPropertyDbl(cmsContext ContextID, cmsHANDLE if (v == NULL) return 0.0; - return ParseFloatNumber(ContextID, v); + return ParseFloatNumber(v); } const char* CMSEXPORT cmsIT8GetPropertyMulti(cmsContext ContextID, cmsHANDLE hIT8, const char* Key, const char *SubKey) @@ -1509,10 +1505,16 @@ void AllocateDataSet(cmsContext ContextID, cmsIT8* it8) t-> nSamples = atoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_FIELDS")); t-> nPatches = atoi(cmsIT8GetProperty(ContextID, it8, "NUMBER_OF_SETS")); - t-> Data = (char**)AllocChunk (ContextID, it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*)); - if (t->Data == NULL) { + if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe) + { + SynError(ContextID, it8, "AllocateDataSet: too much data"); + } + else { + t->Data = (char**)AllocChunk(ContextID, it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*)); + if (t->Data == NULL) { - SynError(ContextID, it8, "AllocateDataSet: Unable to allocate data array"); + SynError(ContextID, it8, "AllocateDataSet: Unable to allocate data array"); + } } } @@ -2032,20 +2034,20 @@ cmsBool HeaderSection(cmsContext ContextID, cmsIT8* it8) static -void ReadType(cmsContext ContextID, cmsIT8* it8, char* SheetTypePtr) +void ReadType(cmsIT8* it8, char* SheetTypePtr) { cmsInt32Number cnt = 0; // First line is a very special case. while (isseparator(it8->ch)) - NextCh(ContextID, it8); + NextCh(it8); while (it8->ch != '\r' && it8 ->ch != '\n' && it8->ch != '\t' && it8 -> ch != 0) { if (cnt++ < MAXSTR) *SheetTypePtr++= (char) it8 ->ch; - NextCh(ContextID, it8); + NextCh(it8); } *SheetTypePtr = 0; @@ -2058,7 +2060,7 @@ cmsBool ParseIT8(cmsContext ContextID, cmsIT8* it8, cmsBool nosheet) char* SheetTypePtr = it8 ->Tab[0].SheetType; if (nosheet == 0) { - ReadType(ContextID, it8, SheetTypePtr); + ReadType(it8, SheetTypePtr); } InSymbol(ContextID, it8); @@ -2093,7 +2095,7 @@ cmsBool ParseIT8(cmsContext ContextID, cmsIT8* it8, cmsBool nosheet) // May be a type sheet or may be a prop value statement. We cannot use insymbol in // this special case... while (isseparator(it8->ch)) - NextCh(ContextID, it8); + NextCh(it8); // If a newline is found, then this is a type string if (it8 ->ch == '\n' || it8->ch == '\r') { @@ -2237,7 +2239,7 @@ void CookPointers(cmsContext ContextID, cmsIT8* it8) // that should be something like some printable characters plus a \n // returns 0 if this is not like a CGATS, or an integer otherwise. This integer is the number of words in first line? static -int IsMyBlock(cmsContext ContextID, const cmsUInt8Number* Buffer, cmsUInt32Number n) +int IsMyBlock(const cmsUInt8Number* Buffer, cmsUInt32Number n) { int words = 1, space = 0, quot = 0; cmsUInt32Number i; @@ -2276,7 +2278,7 @@ int IsMyBlock(cmsContext ContextID, const cmsUInt8Number* Buffer, cmsUInt32Numbe static -cmsBool IsMyFile(cmsContext ContextID, const char* FileName) +cmsBool IsMyFile(const char* FileName) { FILE *fp; cmsUInt32Number Size; @@ -2295,7 +2297,7 @@ cmsBool IsMyFile(cmsContext ContextID, const char* FileName) Ptr[Size] = '\0'; - return IsMyBlock(ContextID, Ptr, Size); + return IsMyBlock(Ptr, Size); } // ---------------------------------------------------------- Exported routines @@ -2310,7 +2312,7 @@ cmsHANDLE CMSEXPORT cmsIT8LoadFromMem(cmsContext ContextID, const void *Ptr, cm _cmsAssert(Ptr != NULL); _cmsAssert(len != 0); - type = IsMyBlock(ContextID, (const cmsUInt8Number*)Ptr, len); + type = IsMyBlock((const cmsUInt8Number*)Ptr, len); if (type == 0) return NULL; hIT8 = cmsIT8Alloc(ContextID); @@ -2318,6 +2320,11 @@ cmsHANDLE CMSEXPORT cmsIT8LoadFromMem(cmsContext ContextID, const void *Ptr, cm it8 = (cmsIT8*) hIT8; it8 ->MemoryBlock = (char*) _cmsMalloc(ContextID, len + 1); + if (it8->MemoryBlock == NULL) + { + cmsIT8Free(ContextID, hIT8); + return FALSE; + } strncpy(it8 ->MemoryBlock, (const char*) Ptr, len); it8 ->MemoryBlock[len] = 0; @@ -2352,7 +2359,7 @@ cmsHANDLE CMSEXPORT cmsIT8LoadFromFile(cmsContext ContextID, const char* cFileN _cmsAssert(cFileName != NULL); - type = IsMyFile(ContextID, cFileName); + type = IsMyFile(cFileName); if (type == 0) return NULL; hIT8 = cmsIT8Alloc(ContextID); @@ -2569,7 +2576,7 @@ cmsFloat64Number CMSEXPORT cmsIT8GetDataRowColDbl(cmsContext ContextID, cmsHANDL if (Buffer == NULL) return 0.0; - return ParseFloatNumber(ContextID, Buffer); + return ParseFloatNumber(Buffer); } @@ -2624,7 +2631,7 @@ cmsFloat64Number CMSEXPORT cmsIT8GetDataDbl(cmsContext ContextID, cmsHANDLE it8 Buffer = cmsIT8GetData(ContextID, it8, cPatch, cSample); - return ParseFloatNumber(ContextID, Buffer); + return ParseFloatNumber(Buffer); } diff --git a/lcms2mt/src/cmscnvrt.c b/lcms2mt/src/cmscnvrt.c index 53d72b5ed..afa3de60d 100644 --- a/lcms2mt/src/cmscnvrt.c +++ b/lcms2mt/src/cmscnvrt.c @@ -503,10 +503,8 @@ cmsBool AddConversion(cmsContext ContextID, cmsPipeline* Result, cmsColorSpaceSi // Is a given space compatible with another? static -cmsBool ColorSpaceIsCompatible(cmsContext ContextID, cmsColorSpaceSignature a, cmsColorSpaceSignature b) +cmsBool ColorSpaceIsCompatible(cmsColorSpaceSignature a, cmsColorSpaceSignature b) { - cmsUNUSED_PARAMETER(ContextID); - // If they are same, they are compatible. if (a == b) return TRUE; @@ -581,7 +579,7 @@ cmsPipeline* DefaultICCintents(cmsContext ContextID, ColorSpaceOut = cmsGetColorSpace(ContextID, hProfile); } - if (!ColorSpaceIsCompatible(ContextID, ColorSpaceIn, CurrentColorSpace)) { + if (!ColorSpaceIsCompatible(ColorSpaceIn, CurrentColorSpace)) { cmsSignalError(ContextID, cmsERROR_COLORSPACE_CHECK, "ColorSpace mismatch"); goto Error; @@ -876,7 +874,7 @@ int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number return TRUE; } - // K differ, mesure and keep Lab measurement for further usage + // K differ, measure and keep Lab measurement for further usage // this is done in relative colorimetric intent cmsDoTransform(ContextID, bp->hProofOutput, Out, &ColorimetricLab, 1); @@ -990,15 +988,15 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID, if (bp.KTone == NULL) goto Cleanup; // To measure the output, Last profile to Lab - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); - bp.hProofOutput = cmsCreateTransformTHR(ContextID, hProfiles[nProfiles-1], + hLab = cmsCreateLab4Profile(ContextID, NULL); + bp.hProofOutput = cmsCreateTransform(ContextID, hProfiles[nProfiles-1], CHANNELS_SH(4)|BYTES_SH(2), hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE); if ( bp.hProofOutput == NULL) goto Cleanup; // Same as anterior, but lab in the 0..1 range - bp.cmyk2Lab = cmsCreateTransformTHR(ContextID, hProfiles[nProfiles-1], + bp.cmyk2Lab = cmsCreateTransform(ContextID, hProfiles[nProfiles-1], FLOAT_SH(1)|CHANNELS_SH(4)|BYTES_SH(4), hLab, FLOAT_SH(1)|CHANNELS_SH(3)|BYTES_SH(4), INTENT_RELATIVE_COLORIMETRIC, @@ -1093,7 +1091,7 @@ cmsPipeline* _cmsLinkProfiles(cmsContext ContextID, // Get information about available intents. nMax is the maximum space for the supplied "Codes" // and "Descriptions" the function returns the total number of intents, which may be greater // than nMax, although the matrices are not populated beyond this level. -cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID, cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions) +cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsContext ContextID, cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions) { _cmsIntentsPluginChunkType* ctx = ( _cmsIntentsPluginChunkType*) _cmsContextGetClientChunk(ContextID, IntentPlugin); cmsIntentsList* pt; @@ -1128,11 +1126,6 @@ cmsUInt32Number CMSEXPORT cmsGetSupportedIntentsTHR(cmsContext ContextID, cmsUIn return nIntents; } -cmsUInt32Number CMSEXPORT cmsGetSupportedIntents(cmsUInt32Number nMax, cmsUInt32Number* Codes, char** Descriptions) -{ - return cmsGetSupportedIntentsTHR(NULL, nMax, Codes, Descriptions); -} - // The plug-in registration. User can add new intents or override default routines cmsBool _cmsRegisterRenderingIntentPlugin(cmsContext id, cmsPluginBase* Data) { diff --git a/lcms2mt/src/cmserr.c b/lcms2mt/src/cmserr.c index 811b49b9a..3165a8054 100644 --- a/lcms2mt/src/cmserr.c +++ b/lcms2mt/src/cmserr.c @@ -54,7 +54,7 @@ long int CMSEXPORT cmsfilelength(FILE* f) long int p , n; p = ftell(f); // register current file position - if (p == -1L) + if (p == -1L) return -1L; if (fseek(f, 0, SEEK_END) != 0) { @@ -72,7 +72,7 @@ long int CMSEXPORT cmsfilelength(FILE* f) // // This is the interface to low-level memory management routines. By default a simple // wrapping to malloc/free/realloc is provided, although there is a limit on the max -// amount of memoy that can be reclaimed. This is mostly as a safety feature to prevent +// amount of memoy that can be reclaimed. This is mostly as a safety feature to prevent // bogus or evil code to allocate huge blocks that otherwise lcms would never need. #define MAX_MEMORY_FOR_ALLOC ((cmsUInt32Number)(1024U*1024U*512U)) @@ -178,7 +178,7 @@ void* _cmsDupDefaultFn(cmsContext ContextID, const void* Org, cmsUInt32Number si // Pointers to memory manager functions in Context0 -_cmsMemPluginChunkType _cmsMemPluginChunk = { _cmsMallocDefaultFn, _cmsMallocZeroDefaultFn, _cmsFreeDefaultFn, +_cmsMemPluginChunkType _cmsMemPluginChunk = { _cmsMallocDefaultFn, _cmsMallocZeroDefaultFn, _cmsFreeDefaultFn, _cmsReallocDefaultFn, _cmsCallocDefaultFn, _cmsDupDefaultFn }; @@ -188,16 +188,16 @@ void _cmsAllocMemPluginChunk(struct _cmsContext_struct* ctx, const struct _cmsCo { _cmsAssert(ctx != NULL); - if (src != NULL) { + if (src != NULL) { // Duplicate - ctx ->chunks[MemPlugin] = _cmsSubAllocDup(ctx ->MemPool, src ->chunks[MemPlugin], sizeof(_cmsMemPluginChunkType)); + ctx ->chunks[MemPlugin] = _cmsSubAllocDup(ctx ->MemPool, src ->chunks[MemPlugin], sizeof(_cmsMemPluginChunkType)); } else { // To reset it, we use the default allocators, which cannot be overridden ctx ->chunks[MemPlugin] = &ctx ->DefaultMemoryManager; - } + } } // Auxiliary to fill memory management functions from plugin (or context 0 defaults) @@ -217,11 +217,11 @@ void _cmsInstallAllocFunctions(cmsPluginMemHandler* Plugin, _cmsMemPluginChunkTy ptr ->MallocZeroPtr= _cmsMallocZeroDefaultFn; ptr ->CallocPtr = _cmsCallocDefaultFn; ptr ->DupPtr = _cmsDupDefaultFn; - + if (Plugin ->MallocZeroPtr != NULL) ptr ->MallocZeroPtr = Plugin -> MallocZeroPtr; if (Plugin ->CallocPtr != NULL) ptr ->CallocPtr = Plugin -> CallocPtr; if (Plugin ->DupPtr != NULL) ptr ->DupPtr = Plugin -> DupPtr; - + } } @@ -229,12 +229,12 @@ void _cmsInstallAllocFunctions(cmsPluginMemHandler* Plugin, _cmsMemPluginChunkTy // Plug-in replacement entry cmsBool _cmsRegisterMemHandlerPlugin(cmsContext ContextID, cmsPluginBase *Data) { - cmsPluginMemHandler* Plugin = (cmsPluginMemHandler*) Data; + cmsPluginMemHandler* Plugin = (cmsPluginMemHandler*) Data; _cmsMemPluginChunkType* ptr; - // NULL forces to reset to defaults. In this special case, the defaults are stored in the context structure. + // NULL forces to reset to defaults. In this special case, the defaults are stored in the context structure. // Remaining plug-ins does NOT have any copy in the context structure, but this is somehow special as the - // context internal data should be malloce'd by using those functions. + // context internal data should be malloce'd by using those functions. if (Data == NULL) { struct _cmsContext_struct* ctx = ( struct _cmsContext_struct*) ContextID; @@ -253,7 +253,7 @@ cmsBool _cmsRegisterMemHandlerPlugin(cmsContext ContextID, cmsPluginBase *Data) // Set replacement functions ptr = (_cmsMemPluginChunkType*) _cmsContextGetClientChunk(ContextID, MemPlugin); - if (ptr == NULL) + if (ptr == NULL) return FALSE; _cmsInstallAllocFunctions(Plugin, ptr); @@ -414,7 +414,7 @@ void* _cmsSubAlloc(_cmsSubAllocator* sub, cmsUInt32Number size) void* _cmsSubAllocDup(_cmsSubAllocator* s, const void *ptr, cmsUInt32Number size) { void *NewPtr; - + // Dup of null pointer is also NULL if (ptr == NULL) return NULL; @@ -435,7 +435,7 @@ void* _cmsSubAllocDup(_cmsSubAllocator* s, const void *ptr, cmsUInt32Number size // There is no error handling at all. When a function fails, it returns proper value. // For example, all create functions does return NULL on failure. Other return FALSE // It may be interesting, for the developer, to know why the function is failing. -// for that reason, lcms2 does offer a logging function. This function does recive +// for that reason, lcms2 does offer a logging function. This function does receive // a ENGLISH string with some clues on what is going wrong. You can show this // info to the end user, or just create some sort of log. // The logging function should NOT terminate the program, as this obviously can leave @@ -456,20 +456,20 @@ _cmsLogErrorChunkType _cmsLogErrorChunk = { DefaultLogErrorHandlerFunction }; // Allocates and inits error logger container for a given context. If src is NULL, only initializes the value // to the default. Otherwise, it duplicates the value. The interface is standard across all context clients -void _cmsAllocLogErrorChunk(struct _cmsContext_struct* ctx, +void _cmsAllocLogErrorChunk(struct _cmsContext_struct* ctx, const struct _cmsContext_struct* src) -{ +{ static _cmsLogErrorChunkType LogErrorChunk = { DefaultLogErrorHandlerFunction }; void* from; - + if (src != NULL) { - from = src ->chunks[Logger]; + from = src ->chunks[Logger]; } else { from = &LogErrorChunk; } - - ctx ->chunks[Logger] = _cmsSubAllocDup(ctx ->MemPool, from, sizeof(_cmsLogErrorChunkType)); + + ctx ->chunks[Logger] = _cmsSubAllocDup(ctx ->MemPool, from, sizeof(_cmsLogErrorChunkType)); } // The default error logger does nothing. @@ -485,7 +485,7 @@ void DefaultLogErrorHandlerFunction(cmsContext ContextID, cmsUInt32Number ErrorC } // Change log error, context based -void CMSEXPORT cmsSetLogErrorHandlerTHR(cmsContext ContextID, cmsLogErrorHandlerFunction Fn) +void CMSEXPORT cmsSetLogErrorHandler(cmsContext ContextID, cmsLogErrorHandlerFunction Fn) { _cmsLogErrorChunkType* lhg = (_cmsLogErrorChunkType*) _cmsContextGetClientChunk(ContextID, Logger); @@ -498,12 +498,6 @@ void CMSEXPORT cmsSetLogErrorHandlerTHR(cmsContext ContextID, cmsLogErrorHandler } } -// Change log error, legacy -void CMSEXPORT cmsSetLogErrorHandler(cmsLogErrorHandlerFunction Fn) -{ - cmsSetLogErrorHandlerTHR(NULL, Fn); -} - // Log an error // ErrorText is a text holding an english description of error. void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText, ...) @@ -521,16 +515,16 @@ void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, c lhg = (_cmsLogErrorChunkType*) _cmsContextGetClientChunk(ContextID, Logger); if (lhg ->LogErrorHandler) { lhg ->LogErrorHandler(ContextID, ErrorCode, Buffer); - } + } } // Utility function to print signatures -void _cmsTagSignature2String(cmsContext ContextID, char String[5], cmsTagSignature sig) +void _cmsTagSignature2String(char String[5], cmsTagSignature sig) { cmsUInt32Number be; // Convert to big endian - be = _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) sig); + be = _cmsAdjustEndianess32((cmsUInt32Number) sig); // Move chars memmove(String, &be, 4); @@ -548,13 +542,13 @@ void* defMtxCreate(cmsContext id) _cmsMutex* ptr_mutex = (_cmsMutex*) _cmsMalloc(id, sizeof(_cmsMutex)); if (ptr_mutex != NULL) _cmsInitMutexPrimitive(ptr_mutex); - return (void*) ptr_mutex; + return (void*) ptr_mutex; } static void defMtxDestroy(cmsContext id, void* mtx) { - _cmsDestroyMutexPrimitive((_cmsMutex *) mtx); + _cmsDestroyMutexPrimitive((_cmsMutex *) mtx); _cmsFree(id, mtx); } @@ -562,14 +556,14 @@ static cmsBool defMtxLock(cmsContext id, void* mtx) { cmsUNUSED_PARAMETER(id); - return _cmsLockPrimitive((_cmsMutex *) mtx) == 0; + return _cmsLockPrimitive((_cmsMutex *) mtx) == 0; } static void defMtxUnlock(cmsContext id, void* mtx) { cmsUNUSED_PARAMETER(id); - _cmsUnlockPrimitive((_cmsMutex *) mtx); + _cmsUnlockPrimitive((_cmsMutex *) mtx); } @@ -578,20 +572,20 @@ void defMtxUnlock(cmsContext id, void* mtx) _cmsMutexPluginChunkType _cmsMutexPluginChunk = { defMtxCreate, defMtxDestroy, defMtxLock, defMtxUnlock }; // Allocate and init mutex container. -void _cmsAllocMutexPluginChunk(struct _cmsContext_struct* ctx, +void _cmsAllocMutexPluginChunk(struct _cmsContext_struct* ctx, const struct _cmsContext_struct* src) { static _cmsMutexPluginChunkType MutexChunk = {defMtxCreate, defMtxDestroy, defMtxLock, defMtxUnlock }; void* from; - + if (src != NULL) { - from = src ->chunks[MutexPlugin]; + from = src ->chunks[MutexPlugin]; } else { from = &MutexChunk; } - - ctx ->chunks[MutexPlugin] = _cmsSubAllocDup(ctx ->MemPool, from, sizeof(_cmsMutexPluginChunkType)); + + ctx ->chunks[MutexPlugin] = _cmsSubAllocDup(ctx ->MemPool, from, sizeof(_cmsMutexPluginChunkType)); } // Register new ways to transform @@ -603,15 +597,15 @@ cmsBool _cmsRegisterMutexPlugin(cmsContext ContextID, cmsPluginBase* Data) if (Data == NULL) { // No lock routines - ctx->CreateMutexPtr = NULL; - ctx->DestroyMutexPtr = NULL; + ctx->CreateMutexPtr = NULL; + ctx->DestroyMutexPtr = NULL; ctx->LockMutexPtr = NULL; ctx ->UnlockMutexPtr = NULL; return TRUE; } // Factory callback is required - if (Plugin ->CreateMutexPtr == NULL || Plugin ->DestroyMutexPtr == NULL || + if (Plugin ->CreateMutexPtr == NULL || Plugin ->DestroyMutexPtr == NULL || Plugin ->LockMutexPtr == NULL || Plugin ->UnlockMutexPtr == NULL) return FALSE; diff --git a/lcms2mt/src/cmsgamma.c b/lcms2mt/src/cmsgamma.c index b42c064fa..09e817ce1 100644 --- a/lcms2mt/src/cmsgamma.c +++ b/lcms2mt/src/cmsgamma.c @@ -821,7 +821,7 @@ cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurveFloat(cmsContext ContextID, cm // // Parameters goes as: Curve, a, b, c, d, e, f // Type is the ICC type +1 -// if type is negative, then the curve is analyticaly inverted +// if type is negative, then the curve is analytically inverted cmsToneCurve* CMSEXPORT cmsBuildParametricToneCurve(cmsContext ContextID, cmsInt32Number Type, const cmsFloat64Number Params[]) { cmsCurveSegment Seg0; @@ -1256,7 +1256,7 @@ cmsBool CMSEXPORT cmsSmoothToneCurve(cmsContext ContextID, cmsToneCurve* Tab, c } // Is a table linear? Do not use parametric since we cannot guarantee some weird parameters resulting -// in a linear table. This way assures it is linear in 12 bits, which should be enought in most cases. +// in a linear table. This way assures it is linear in 12 bits, which should be enough in most cases. cmsBool CMSEXPORT cmsIsToneCurveLinear(cmsContext ContextID, const cmsToneCurve* Curve) { int i; diff --git a/lcms2mt/src/cmsgmt.c b/lcms2mt/src/cmsgmt.c index 34b9487e0..e969876d6 100644 --- a/lcms2mt/src/cmsgmt.c +++ b/lcms2mt/src/cmsgmt.c @@ -52,7 +52,7 @@ cmsHTRANSFORM _cmsChain2Lab(cmsContext ContextID, if (nProfiles > 254) return NULL; // The output space - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); + hLab = cmsCreateLab4Profile(ContextID, NULL); if (hLab == NULL) return NULL; // Create a copy of parameters @@ -313,7 +313,7 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID, return NULL; } - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); + hLab = cmsCreateLab4Profile(ContextID, NULL); if (hLab == NULL) return NULL; @@ -365,14 +365,14 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID, // Does create the forward step. Lab double to device dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2)); - Chain.hForward = cmsCreateTransformTHR(ContextID, + Chain.hForward = cmsCreateTransform(ContextID, hLab, TYPE_Lab_DBL, hGamut, dwFormat, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE); // Does create the backwards step - Chain.hReverse = cmsCreateTransformTHR(ContextID, hGamut, dwFormat, + Chain.hReverse = cmsCreateTransform(ContextID, hGamut, dwFormat, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE); @@ -477,10 +477,10 @@ cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsContext ContextID, cmsHPROFILE hProfi // for safety if (bp.nOutputChans >= cmsMAXCHANNELS) return 0; - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); + hLab = cmsCreateLab4Profile(ContextID, NULL); if (hLab == NULL) return 0; // Setup a roundtrip on perceptual intent in output profile for TAC estimation - bp.hRoundTrip = cmsCreateTransformTHR(ContextID, hLab, TYPE_Lab_16, + bp.hRoundTrip = cmsCreateTransform(ContextID, hLab, TYPE_Lab_16, hProfile, dwFormatter, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); cmsCloseProfile(ContextID, hLab); diff --git a/lcms2mt/src/cmshalf.c b/lcms2mt/src/cmshalf.c index c2540f804..66c270113 100644 --- a/lcms2mt/src/cmshalf.c +++ b/lcms2mt/src/cmshalf.c @@ -503,7 +503,7 @@ static cmsUInt8Number Shift[512] = { 0x18, 0x18, 0x18, 0x18, 0x0d }; -cmsFloat32Number _cmsHalf2Float(cmsUInt16Number h) +cmsFloat32Number CMSEXPORT _cmsHalf2Float(cmsUInt16Number h) { union { cmsFloat32Number flt; @@ -516,7 +516,7 @@ cmsFloat32Number _cmsHalf2Float(cmsUInt16Number h) return out.flt; } -cmsUInt16Number _cmsFloat2Half(cmsFloat32Number flt) +cmsUInt16Number CMSEXPORT _cmsFloat2Half(cmsFloat32Number flt) { union { cmsFloat32Number flt; diff --git a/lcms2mt/src/cmsintrp.c b/lcms2mt/src/cmsintrp.c index c613a1bd3..651e25c39 100644 --- a/lcms2mt/src/cmsintrp.c +++ b/lcms2mt/src/cmsintrp.c @@ -37,7 +37,7 @@ #endif // Interpolation routines by default -static cmsInterpFunction DefaultInterpolatorsFactory(cmsContext ContextID, cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags); +static cmsInterpFunction DefaultInterpolatorsFactory(cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags); // This is the default factory _cmsInterpPluginChunkType _cmsInterpPluginChunk = { NULL }; @@ -95,7 +95,7 @@ cmsBool _cmsSetInterpolationRoutine(cmsContext ContextID, cmsInterpParams* p) // If unsupported by the plug-in, go for the LittleCMS default. // If happens only if an extern plug-in is being used if (p ->Interpolation.Lerp16 == NULL) - p ->Interpolation = DefaultInterpolatorsFactory(ContextID, p ->nInputs, p ->nOutputs, p ->dwFlags); + p ->Interpolation = DefaultInterpolatorsFactory(p ->nInputs, p ->nOutputs, p ->dwFlags); // Check for valid interpolator (we just check one member of the union) if (p ->Interpolation.Lerp16 == NULL) { @@ -157,8 +157,8 @@ cmsInterpParams* _cmsComputeInterpParamsEx(cmsContext ContextID, // This one is a wrapper on the anterior, but assuming all directions have same number of nodes -cmsInterpParams* _cmsComputeInterpParams(cmsContext ContextID, cmsUInt32Number nSamples, - cmsUInt32Number InputChan, cmsUInt32Number OutputChan, const void* Table, cmsUInt32Number dwFlags) +cmsInterpParams* CMSEXPORT _cmsComputeInterpParams(cmsContext ContextID, cmsUInt32Number nSamples, + cmsUInt32Number InputChan, cmsUInt32Number OutputChan, const void* Table, cmsUInt32Number dwFlags) { int i; cmsUInt32Number Samples[MAX_INPUT_DIMENSIONS]; @@ -173,17 +173,16 @@ cmsInterpParams* _cmsComputeInterpParams(cmsContext ContextID, cmsUInt32Number n // Free all associated memory -void _cmsFreeInterpParams(cmsContext ContextID, cmsInterpParams* p) +void CMSEXPORT _cmsFreeInterpParams(cmsContext ContextID, cmsInterpParams* p) { if (p != NULL) _cmsFree(ContextID, p); } // Inline fixed point interpolation -cmsINLINE cmsUInt16Number LinearInterp(cmsContext ContextID, cmsS15Fixed16Number a, cmsS15Fixed16Number l, cmsS15Fixed16Number h) +cmsINLINE CMS_NO_SANITIZE cmsUInt16Number LinearInterp(cmsS15Fixed16Number a, cmsS15Fixed16Number l, cmsS15Fixed16Number h) { cmsUInt32Number dif = (cmsUInt32Number) (h - l) * a + 0x8000; - cmsUNUSED_PARAMETER(ContextID); dif = (dif >> 16) + l; return (cmsUInt16Number) (dif); } @@ -199,25 +198,26 @@ void LinLerp1D(cmsContext ContextID, register const cmsUInt16Number Value[], int cell0, rest; int val3; const cmsUInt16Number* LutTable = (cmsUInt16Number*) p ->Table; + cmsUNUSED_PARAMETER(ContextID); // if last value... if (Value[0] == 0xffff) { Output[0] = LutTable[p -> Domain[0]]; - return; } + else + { + val3 = p->Domain[0] * Value[0]; + val3 = _cmsToFixedDomain(val3); // To fixed 15.16 - val3 = p -> Domain[0] * Value[0]; - val3 = _cmsToFixedDomain(val3); // To fixed 15.16 - - cell0 = FIXED_TO_INT(val3); // Cell is 16 MSB bits - rest = FIXED_REST_TO_INT(val3); // Rest is 16 LSB bits - - y0 = LutTable[cell0]; - y1 = LutTable[cell0+1]; + cell0 = FIXED_TO_INT(val3); // Cell is 16 MSB bits + rest = FIXED_REST_TO_INT(val3); // Rest is 16 LSB bits + y0 = LutTable[cell0]; + y1 = LutTable[cell0 + 1]; - Output[0] = LinearInterp(ContextID, rest, y0, y1); + Output[0] = LinearInterp(rest, y0, y1); + } } // To prevent out of bounds indexing @@ -243,27 +243,28 @@ void LinLerp1Dfloat(cmsContext ContextID, const cmsFloat32Number Value[], // if last value... if (val2 == 1.0) { Output[0] = LutTable[p -> Domain[0]]; - return; } + else + { + val2 *= p->Domain[0]; - val2 *= p -> Domain[0]; - - cell0 = (int) floor(val2); - cell1 = (int) ceil(val2); + cell0 = (int)floor(val2); + cell1 = (int)ceil(val2); - // Rest is 16 LSB bits - rest = val2 - cell0; + // Rest is 16 LSB bits + rest = val2 - cell0; - y0 = LutTable[cell0] ; - y1 = LutTable[cell1] ; + y0 = LutTable[cell0]; + y1 = LutTable[cell1]; - Output[0] = y0 + (y1 - y0) * rest; + Output[0] = y0 + (y1 - y0) * rest; + } } // Eval gray LUT having only one input channel -static +static CMS_NO_SANITIZE void Eval1Input(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16) @@ -273,6 +274,7 @@ void Eval1Input(cmsContext ContextID, register const cmsUInt16Number Input[], int v; cmsUInt32Number OutChan; const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table; + cmsUNUSED_PARAMETER(ContextID); v = Input[0] * p16 -> Domain[0]; fk = _cmsToFixedDomain(v); @@ -287,7 +289,7 @@ void Eval1Input(cmsContext ContextID, register const cmsUInt16Number Input[], for (OutChan=0; OutChan < p16->nOutputs; OutChan++) { - Output[OutChan] = LinearInterp(ContextID, rk, LutTable[K0+OutChan], LutTable[K1+OutChan]); + Output[OutChan] = LinearInterp(rk, LutTable[K0+OutChan], LutTable[K1+OutChan]); } } @@ -308,30 +310,36 @@ void Eval1InputFloat(cmsContext ContextID, const cmsFloat32Number Value[], val2 = fclamp(Value[0]); - // if last value... - if (val2 == 1.0) { - Output[0] = LutTable[p -> Domain[0]]; - return; - } + // if last value... + if (val2 == 1.0) { - val2 *= p -> Domain[0]; + y0 = LutTable[p->Domain[0]]; - cell0 = (int) floor(val2); - cell1 = (int) ceil(val2); + for (OutChan = 0; OutChan < p->nOutputs; OutChan++) { + Output[OutChan] = y0; + } + } + else + { + val2 *= p->Domain[0]; - // Rest is 16 LSB bits - rest = val2 - cell0; + cell0 = (int)floor(val2); + cell1 = (int)ceil(val2); - cell0 *= p -> opta[0]; - cell1 *= p -> opta[0]; + // Rest is 16 LSB bits + rest = val2 - cell0; - for (OutChan=0; OutChan < p->nOutputs; OutChan++) { + cell0 *= p->opta[0]; + cell1 *= p->opta[0]; - y0 = LutTable[cell0 + OutChan] ; - y1 = LutTable[cell1 + OutChan] ; + for (OutChan = 0; OutChan < p->nOutputs; OutChan++) { + + y0 = LutTable[cell0 + OutChan]; + y1 = LutTable[cell1 + OutChan]; Output[OutChan] = y0 + (y1 - y0) * rest; - } + } + } } // Bilinear interpolation (16 bits) - cmsFloat32Number version @@ -389,7 +397,7 @@ void BilinearInterpFloat(cmsContext ContextID, const cmsFloat32Number Input[], } // Bilinear interpolation (16 bits) - optimized version -static +static CMS_NO_SANITIZE void BilinearInterp16(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p) @@ -522,7 +530,7 @@ void TrilinearInterpFloat(cmsContext ContextID, const cmsFloat32Number Input[], } // Trilinear interpolation (16 bits) - optimized version -static +static CMS_NO_SANITIZE void TrilinearInterp16(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p) @@ -704,7 +712,7 @@ void TetrahedralInterpFloat(cmsContext ContextID, const cmsFloat32Number Input[] -static +static CMS_NO_SANITIZE void TetrahedralInterp16(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p) @@ -839,7 +847,7 @@ void TetrahedralInterp16(cmsContext ContextID, register const cmsUInt16Number In #define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan]) -static +static CMS_NO_SANITIZE void Eval4Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16) @@ -856,6 +864,7 @@ void Eval4Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], cmsS15Fixed16Number c0, c1, c2, c3, Rest; cmsUInt32Number OutChan; cmsUInt16Number Tmp1[MAX_STAGE_CHANNELS], Tmp2[MAX_STAGE_CHANNELS]; + cmsUNUSED_PARAMETER(ContextID); fk = _cmsToFixedDomain((int) Input[0] * p16 -> Domain[0]); @@ -1015,7 +1024,7 @@ void Eval4Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], for (i=0; i < p16 -> nOutputs; i++) { - Output[i] = LinearInterp(ContextID, rk, Tmp1[i], Tmp2[i]); + Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]); } } #undef DENS @@ -1068,10 +1077,9 @@ void Eval4InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[], } -static +static CMS_NO_SANITIZE void Eval5Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], - register const cmsInterpParams* p16) { const cmsUInt16Number* LutTable = (cmsUInt16Number*) p16 -> Table; @@ -1106,7 +1114,7 @@ void Eval5Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], for (i=0; i < p16 -> nOutputs; i++) { - Output[i] = LinearInterp(ContextID, rk, Tmp1[i], Tmp2[i]); + Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]); } } @@ -1157,7 +1165,7 @@ void Eval5InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[], -static +static CMS_NO_SANITIZE void Eval6Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16) @@ -1193,7 +1201,7 @@ void Eval6Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], for (i=0; i < p16 -> nOutputs; i++) { - Output[i] = LinearInterp(ContextID, rk, Tmp1[i], Tmp2[i]); + Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]); } } @@ -1243,7 +1251,7 @@ void Eval6InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[], } -static +static CMS_NO_SANITIZE void Eval7Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16) @@ -1279,7 +1287,7 @@ void Eval7Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], Eval6Inputs(ContextID, Input + 1, Tmp2, &p1); for (i=0; i < p16 -> nOutputs; i++) { - Output[i] = LinearInterp(ContextID, rk, Tmp1[i], Tmp2[i]); + Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]); } } @@ -1329,7 +1337,7 @@ void Eval7InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[], } } -static +static CMS_NO_SANITIZE void Eval8Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const cmsInterpParams* p16) @@ -1363,7 +1371,7 @@ void Eval8Inputs(cmsContext ContextID, register const cmsUInt16Number Input[], Eval7Inputs(ContextID, Input + 1, Tmp2, &p1); for (i=0; i < p16 -> nOutputs; i++) { - Output[i] = LinearInterp(ContextID, rk, Tmp1[i], Tmp2[i]); + Output[i] = LinearInterp(rk, Tmp1[i], Tmp2[i]); } } @@ -1415,13 +1423,12 @@ void Eval8InputsFloat(cmsContext ContextID, const cmsFloat32Number Input[], // The default factory static -cmsInterpFunction DefaultInterpolatorsFactory(cmsContext ContextID, cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags) +cmsInterpFunction DefaultInterpolatorsFactory(cmsUInt32Number nInputChannels, cmsUInt32Number nOutputChannels, cmsUInt32Number dwFlags) { cmsInterpFunction Interpolation; cmsBool IsFloat = (dwFlags & CMS_LERP_FLAGS_FLOAT); cmsBool IsTrilinear = (dwFlags & CMS_LERP_FLAGS_TRILINEAR); - cmsUNUSED_PARAMETER(ContextID); memset(&Interpolation, 0, sizeof(Interpolation)); diff --git a/lcms2mt/src/cmsio0.c b/lcms2mt/src/cmsio0.c index 71a34ce8f..03b35e494 100644 --- a/lcms2mt/src/cmsio0.c +++ b/lcms2mt/src/cmsio0.c @@ -239,7 +239,7 @@ cmsBool MemoryClose(cmsContext ContextID, struct _cms_io_handler* iohandler) // Create a iohandler for memory block. AccessMode=='r' assumes the iohandler is going to read, and makes // a copy of the memory block for letting user to free the memory after invoking open profile. In write -// mode ("w"), Buffere points to the begin of memory block to be written. +// mode ("w"), Buffer points to the begin of memory block to be written. cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode) { cmsIOHANDLER* iohandler = NULL; @@ -629,7 +629,6 @@ cmsBool _cmsNewTag(cmsContext ContextID, _cmsICCPROFILE* Icc, cmsTagSignature si else { // No, make a new one - if (Icc -> TagCount >= MAX_TABLE_TAG) { cmsSignalError(ContextID, cmsERROR_RANGE, "Too many tags (%d)", MAX_TABLE_TAG); return FALSE; @@ -650,8 +649,6 @@ cmsBool CMSEXPORT cmsIsTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTagSig return _cmsSearchTag(ContextID, Icc, sig, FALSE) >= 0; } - - // Enforces that the profile version is per. spec. // Operates on the big endian bytes from the profile. // Called before converting to platform endianness. @@ -694,27 +691,27 @@ cmsBool _cmsReadHeader(cmsContext ContextID, _cmsICCPROFILE* Icc) } // Validate file as an ICC profile - if (_cmsAdjustEndianess32(ContextID, Header.magic) != cmsMagicNumber) { + if (_cmsAdjustEndianess32(Header.magic) != cmsMagicNumber) { cmsSignalError(ContextID, cmsERROR_BAD_SIGNATURE, "not an ICC profile, invalid signature"); return FALSE; } // Adjust endianness of the used parameters - Icc -> DeviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(ContextID, Header.deviceClass); - Icc -> ColorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(ContextID, Header.colorSpace); - Icc -> PCS = (cmsColorSpaceSignature) _cmsAdjustEndianess32(ContextID, Header.pcs); + Icc -> DeviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Header.deviceClass); + Icc -> ColorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Header.colorSpace); + Icc -> PCS = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Header.pcs); - Icc -> RenderingIntent = _cmsAdjustEndianess32(ContextID, Header.renderingIntent); - Icc -> flags = _cmsAdjustEndianess32(ContextID, Header.flags); - Icc -> manufacturer = _cmsAdjustEndianess32(ContextID, Header.manufacturer); - Icc -> model = _cmsAdjustEndianess32(ContextID, Header.model); - Icc -> creator = _cmsAdjustEndianess32(ContextID, Header.creator); + Icc -> RenderingIntent = _cmsAdjustEndianess32(Header.renderingIntent); + Icc -> flags = _cmsAdjustEndianess32(Header.flags); + Icc -> manufacturer = _cmsAdjustEndianess32(Header.manufacturer); + Icc -> model = _cmsAdjustEndianess32(Header.model); + Icc -> creator = _cmsAdjustEndianess32(Header.creator); - _cmsAdjustEndianess64(ContextID, &Icc -> attributes, &Header.attributes); - Icc -> Version = _cmsAdjustEndianess32(ContextID, _validatedVersion(Header.version)); + _cmsAdjustEndianess64(&Icc -> attributes, &Header.attributes); + Icc -> Version = _cmsAdjustEndianess32(_validatedVersion(Header.version)); // Get size as reported in header - HeaderSize = _cmsAdjustEndianess32(ContextID, Header.size); + HeaderSize = _cmsAdjustEndianess32(Header.size); // Make sure HeaderSize is lower than profile size if (HeaderSize >= Icc ->IOhandler ->ReportedSize) @@ -779,41 +776,41 @@ cmsBool _cmsWriteHeader(cmsContext ContextID, _cmsICCPROFILE* Icc, cmsUInt32Numb cmsTagEntry Tag; cmsUInt32Number Count; - Header.size = _cmsAdjustEndianess32(ContextID, UsedSpace); - Header.cmmId = _cmsAdjustEndianess32(ContextID, lcmsSignature); - Header.version = _cmsAdjustEndianess32(ContextID, Icc ->Version); + Header.size = _cmsAdjustEndianess32(UsedSpace); + Header.cmmId = _cmsAdjustEndianess32(lcmsSignature); + Header.version = _cmsAdjustEndianess32(Icc ->Version); - Header.deviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(ContextID, Icc -> DeviceClass); - Header.colorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(ContextID, Icc -> ColorSpace); - Header.pcs = (cmsColorSpaceSignature) _cmsAdjustEndianess32(ContextID, Icc -> PCS); + Header.deviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Icc -> DeviceClass); + Header.colorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> ColorSpace); + Header.pcs = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> PCS); // NOTE: in v4 Timestamp must be in UTC rather than in local time _cmsEncodeDateTimeNumber(ContextID, &Header.date, &Icc ->Created); - Header.magic = _cmsAdjustEndianess32(ContextID, cmsMagicNumber); + Header.magic = _cmsAdjustEndianess32(cmsMagicNumber); #ifdef CMS_IS_WINDOWS_ - Header.platform = (cmsPlatformSignature) _cmsAdjustEndianess32(ContextID, cmsSigMicrosoft); + Header.platform = (cmsPlatformSignature) _cmsAdjustEndianess32(cmsSigMicrosoft); #else - Header.platform = (cmsPlatformSignature) _cmsAdjustEndianess32(ContextID, cmsSigMacintosh); + Header.platform = (cmsPlatformSignature) _cmsAdjustEndianess32(cmsSigMacintosh); #endif - Header.flags = _cmsAdjustEndianess32(ContextID, Icc -> flags); - Header.manufacturer = _cmsAdjustEndianess32(ContextID, Icc -> manufacturer); - Header.model = _cmsAdjustEndianess32(ContextID, Icc -> model); + Header.flags = _cmsAdjustEndianess32(Icc -> flags); + Header.manufacturer = _cmsAdjustEndianess32(Icc -> manufacturer); + Header.model = _cmsAdjustEndianess32(Icc -> model); - _cmsAdjustEndianess64(ContextID, &Header.attributes, &Icc -> attributes); + _cmsAdjustEndianess64(&Header.attributes, &Icc -> attributes); // Rendering intent in the header (for embedded profiles) - Header.renderingIntent = _cmsAdjustEndianess32(ContextID, Icc -> RenderingIntent); + Header.renderingIntent = _cmsAdjustEndianess32(Icc -> RenderingIntent); // Illuminant is always D50 - Header.illuminant.X = (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, cmsD50_XYZ(ContextID)->X)); - Header.illuminant.Y = (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, cmsD50_XYZ(ContextID)->Y)); - Header.illuminant.Z = (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, cmsD50_XYZ(ContextID)->Z)); + Header.illuminant.X = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, cmsD50_XYZ(ContextID)->X)); + Header.illuminant.Y = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, cmsD50_XYZ(ContextID)->Y)); + Header.illuminant.Z = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, cmsD50_XYZ(ContextID)->Z)); // Created by LittleCMS (that's me!) - Header.creator = _cmsAdjustEndianess32(ContextID, lcmsSignature); + Header.creator = _cmsAdjustEndianess32(lcmsSignature); memset(&Header.reserved, 0, sizeof(Header.reserved)); @@ -839,9 +836,9 @@ cmsBool _cmsWriteHeader(cmsContext ContextID, _cmsICCPROFILE* Icc, cmsUInt32Numb if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue; // It is just a placeholder - Tag.sig = (cmsTagSignature) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) Icc -> TagNames[i]); - Tag.offset = _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) Icc -> TagOffsets[i]); - Tag.size = _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) Icc -> TagSizes[i]); + Tag.sig = (cmsTagSignature) _cmsAdjustEndianess32((cmsUInt32Number) Icc -> TagNames[i]); + Tag.offset = _cmsAdjustEndianess32((cmsUInt32Number) Icc -> TagOffsets[i]); + Tag.size = _cmsAdjustEndianess32((cmsUInt32Number) Icc -> TagSizes[i]); if (!Icc ->IOhandler -> Write(ContextID, Icc-> IOhandler, sizeof(cmsTagEntry), &Tag)) return FALSE; } @@ -1050,7 +1047,7 @@ cmsFloat64Number CMSEXPORT cmsGetProfileVersion(cmsContext ContextID, cmsHPROFIL // Create profile from IOhandler -cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandlerTHR(cmsContext ContextID, cmsIOHANDLER* io) +cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler(cmsContext ContextID, cmsIOHANDLER* io) { _cmsICCPROFILE* NewIcc; cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID); @@ -1069,7 +1066,7 @@ Error: } // Create profile from IOhandler -cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2THR(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write) +cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write) { _cmsICCPROFILE* NewIcc; cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID); @@ -1095,7 +1092,7 @@ Error: // Create profile from disk file -cmsHPROFILE CMSEXPORT cmsOpenProfileFromFileTHR(cmsContext ContextID, const char *lpFileName, const char *sAccess) +cmsHPROFILE CMSEXPORT cmsOpenProfileFromFile(cmsContext ContextID, const char *lpFileName, const char *sAccess) { _cmsICCPROFILE* NewIcc; cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID); @@ -1123,13 +1120,7 @@ Error: } -cmsHPROFILE CMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess) -{ - return cmsOpenProfileFromFileTHR(NULL, ICCProfile, sAccess); -} - - -cmsHPROFILE CMSEXPORT cmsOpenProfileFromStreamTHR(cmsContext ContextID, FILE* ICCProfile, const char *sAccess) +cmsHPROFILE CMSEXPORT cmsOpenProfileFromStream(cmsContext ContextID, FILE* ICCProfile, const char *sAccess) { _cmsICCPROFILE* NewIcc; cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID); @@ -1156,14 +1147,9 @@ Error: } -cmsHPROFILE CMSEXPORT cmsOpenProfileFromStream(FILE* ICCProfile, const char *sAccess) -{ - return cmsOpenProfileFromStreamTHR(NULL, ICCProfile, sAccess); -} - // Open from memory block -cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void* MemPtr, cmsUInt32Number dwSize) +cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(cmsContext ContextID, const void* MemPtr, cmsUInt32Number dwSize) { _cmsICCPROFILE* NewIcc; cmsHPROFILE hEmpty; @@ -1187,11 +1173,6 @@ Error: return NULL; } -cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(const void* MemPtr, cmsUInt32Number dwSize) -{ - return cmsOpenProfileFromMemTHR(NULL, MemPtr, dwSize); -} - // Dump tag contents. If the profile is being modified, untouched tags are copied from FileOrig @@ -1286,7 +1267,7 @@ cmsBool SaveTags(cmsContext ContextID, _cmsICCPROFILE* Icc, _cmsICCPROFILE* File char String[5]; - _cmsTagSignature2String(ContextID, String, (cmsTagSignature) TypeBase); + _cmsTagSignature2String(String, (cmsTagSignature) TypeBase); cmsSignalError(ContextID, cmsERROR_WRITE, "Couldn't write type '%s'", String); return FALSE; } @@ -1565,7 +1546,7 @@ void* CMSEXPORT cmsReadTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTagSig char String[5]; - _cmsTagSignature2String(ContextID, String, sig); + _cmsTagSignature2String(String, sig); // An unknown element was found. cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown tag type '%s' found.", String); @@ -1578,7 +1559,7 @@ void* CMSEXPORT cmsReadTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTagSig if (!IsTypeSupported(TagDescriptor, BaseType)) goto Error; - TagSize -= 8; // Alredy read by the type base logic + TagSize -= 8; // Already read by the type base logic // Get type handler TypeHandler = _cmsGetTagTypeHandler(ContextID, BaseType); @@ -1598,7 +1579,7 @@ void* CMSEXPORT cmsReadTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTagSig char String[5]; - _cmsTagSignature2String(ContextID, String, sig); + _cmsTagSignature2String(String, sig); cmsSignalError(ContextID, cmsERROR_CORRUPTION_DETECTED, "Corrupted tag '%s'", String); goto Error; } @@ -1609,9 +1590,10 @@ void* CMSEXPORT cmsReadTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTagSig char String[5]; - _cmsTagSignature2String(ContextID, String, sig); + _cmsTagSignature2String(String, sig); cmsSignalError(ContextID, cmsERROR_CORRUPTION_DETECTED, "'%s' Inconsistent number of items: expected %d, got %d", String, TagDescriptor ->ElemCount, ElemCount); + goto Error; } @@ -1712,8 +1694,8 @@ cmsBool CMSEXPORT cmsWriteTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTag // Does the tag support this type? if (!IsTypeSupported(TagDescriptor, Type)) { - _cmsTagSignature2String(ContextID, TypeString, (cmsTagSignature) Type); - _cmsTagSignature2String(ContextID, SigString, sig); + _cmsTagSignature2String(TypeString, (cmsTagSignature) Type); + _cmsTagSignature2String(SigString, sig); cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", TypeString, SigString); goto Error; @@ -1723,8 +1705,8 @@ cmsBool CMSEXPORT cmsWriteTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTag TypeHandler = _cmsGetTagTypeHandler(ContextID, Type); if (TypeHandler == NULL) { - _cmsTagSignature2String(ContextID, TypeString, (cmsTagSignature) Type); - _cmsTagSignature2String(ContextID, SigString, sig); + _cmsTagSignature2String(TypeString, (cmsTagSignature) Type); + _cmsTagSignature2String(SigString, sig); cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", TypeString, SigString); goto Error; // Should never happen @@ -1743,8 +1725,8 @@ cmsBool CMSEXPORT cmsWriteTag(cmsContext ContextID, cmsHPROFILE hProfile, cmsTag if (Icc ->TagPtrs[i] == NULL) { - _cmsTagSignature2String(ContextID, TypeString, (cmsTagSignature) Type); - _cmsTagSignature2String(ContextID, SigString, sig); + _cmsTagSignature2String(TypeString, (cmsTagSignature) Type); + _cmsTagSignature2String(SigString, sig); cmsSignalError(ContextID, cmsERROR_CORRUPTION_DETECTED, "Malformed struct in type '%s' for tag '%s'", TypeString, SigString); goto Error; @@ -1807,7 +1789,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsContext ContextID, cmsHPROFILE hProfi return Icc ->TagSizes[i]; } - // The data has been already read, or written. But wait!, maybe the user choosed to save as + // The data has been already read, or written. But wait!, maybe the user chose to save as // raw data. In this case, return the raw data directly if (Icc ->TagSaveAsRaw[i]) { @@ -1827,7 +1809,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsContext ContextID, cmsHPROFILE hProfi return Icc ->TagSizes[i]; } - // Already readed, or previously set by cmsWriteTag(). We need to serialize that + // Already read, or previously set by cmsWriteTag(). We need to serialize that // data to raw in order to maintain consistency. _cmsUnlockMutex(ContextID, Icc ->UsrMutex); diff --git a/lcms2mt/src/cmsio1.c b/lcms2mt/src/cmsio1.c index 67ed24404..f95a19be1 100644 --- a/lcms2mt/src/cmsio1.c +++ b/lcms2mt/src/cmsio1.c @@ -303,7 +303,7 @@ Error: // Read and create a BRAND NEW MPE LUT from a given profile. All stuff dependent of version, etc // is adjusted here in order to create a LUT that takes care of all those details. // We add intent = 0xffffffff as a way to read matrix shaper always, no matter of other LUT -cmsPipeline* _cmsReadInputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) +cmsPipeline* CMSEXPORT _cmsReadInputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) { cmsTagTypeSignature OriginalType; cmsTagSignature tag16; @@ -575,7 +575,7 @@ Error: } // Create an output MPE LUT from agiven profile. Version mismatches are handled here -cmsPipeline* _cmsReadOutputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) +cmsPipeline* CMSEXPORT _cmsReadOutputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) { cmsTagTypeSignature OriginalType; cmsTagSignature tag16; @@ -695,7 +695,7 @@ Error: // This one includes abstract profiles as well. Matrix-shaper cannot be obtained on that device class. The // tag name here may default to AToB0 -cmsPipeline* _cmsReadDevicelinkLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) +cmsPipeline* CMSEXPORT _cmsReadDevicelinkLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) { cmsPipeline* Lut; cmsTagTypeSignature OriginalType; diff --git a/lcms2mt/src/cmslut.c b/lcms2mt/src/cmslut.c index 1342bca30..ae4d57d8e 100644 --- a/lcms2mt/src/cmslut.c +++ b/lcms2mt/src/cmslut.c @@ -290,7 +290,7 @@ cmsStage* CMSEXPORT cmsStageAllocToneCurves(cmsContext ContextID, cmsUInt32Numbe // Create a bunch of identity curves -cmsStage* _cmsStageAllocIdentityCurves(cmsContext ContextID, cmsUInt32Number nChannels) +cmsStage* CMSEXPORT _cmsStageAllocIdentityCurves(cmsContext ContextID, cmsUInt32Number nChannels) { cmsStage* mpe = cmsStageAllocToneCurves(ContextID, nChannels, NULL); @@ -709,7 +709,7 @@ int IdentitySampler(cmsContext ContextID, register const cmsUInt16Number In[], r } // Creates an MPE that just copies input to output -cmsStage* _cmsStageAllocIdentityCLut(cmsContext ContextID, cmsUInt32Number nChan) +cmsStage* CMSEXPORT _cmsStageAllocIdentityCLut(cmsContext ContextID, cmsUInt32Number nChan) { cmsUInt32Number Dimensions[MAX_INPUT_DIMENSIONS]; cmsStage* mpe ; @@ -733,7 +733,7 @@ cmsStage* _cmsStageAllocIdentityCLut(cmsContext ContextID, cmsUInt32Number nChan // Quantize a value 0 <= i < MaxSamples to 0..0xffff -cmsUInt16Number _cmsQuantizeVal(cmsFloat64Number i, cmsUInt32Number MaxSamples) +cmsUInt16Number CMSEXPORT _cmsQuantizeVal(cmsFloat64Number i, cmsUInt32Number MaxSamples) { cmsFloat64Number x; @@ -966,7 +966,7 @@ void EvaluateLab2XYZ(cmsContext ContextID, const cmsFloat32Number In[], // No dup or free routines needed, as the structure has no pointers in it. -cmsStage* _cmsStageAllocLab2XYZ(cmsContext ContextID) +cmsStage* CMSEXPORT _cmsStageAllocLab2XYZ(cmsContext ContextID) { return _cmsStageAllocPlaceholder(ContextID, cmsSigLab2XYZElemType, 3, 3, EvaluateLab2XYZ, NULL, NULL, NULL); } @@ -1017,7 +1017,7 @@ cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID) // ******************************************************************************** // Matrix-based conversion, which is more accurate, but slower and cannot properly be saved in devicelink profiles -cmsStage* _cmsStageAllocLabV2ToV4(cmsContext ContextID) +cmsStage* CMSEXPORT _cmsStageAllocLabV2ToV4(cmsContext ContextID) { static const cmsFloat64Number V2ToV4[] = { 65535.0/65280.0, 0, 0, 0, 65535.0/65280.0, 0, @@ -1033,7 +1033,7 @@ cmsStage* _cmsStageAllocLabV2ToV4(cmsContext ContextID) // Reverse direction -cmsStage* _cmsStageAllocLabV4ToV2(cmsContext ContextID) +cmsStage* CMSEXPORT _cmsStageAllocLabV4ToV2(cmsContext ContextID) { static const cmsFloat64Number V4ToV2[] = { 65280.0/65535.0, 0, 0, 0, 65280.0/65535.0, 0, @@ -1177,7 +1177,7 @@ void EvaluateXYZ2Lab(cmsContext ContextID, const cmsFloat32Number In[], cmsFloat cmsUNUSED_PARAMETER(mpe); } -cmsStage* _cmsStageAllocXYZ2Lab(cmsContext ContextID) +cmsStage* CMSEXPORT _cmsStageAllocXYZ2Lab(cmsContext ContextID) { return _cmsStageAllocPlaceholder(ContextID, cmsSigXYZ2LabElemType, 3, 3, EvaluateXYZ2Lab, NULL, NULL, NULL); diff --git a/lcms2mt/src/cmsmd5.c b/lcms2mt/src/cmsmd5.c index 678ffe129..d3017ab32 100644 --- a/lcms2mt/src/cmsmd5.c +++ b/lcms2mt/src/cmsmd5.c @@ -29,11 +29,11 @@ #ifdef CMS_USE_BIG_ENDIAN static -void byteReverse(cmsContext ContextID, cmsUInt8Number * buf, cmsUInt32Number longs) +void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs) { do { - cmsUInt32Number t = _cmsAdjustEndianess32(ContextID, *(cmsUInt32Number *) buf); + cmsUInt32Number t = _cmsAdjustEndianess32(*(cmsUInt32Number *) buf); *(cmsUInt32Number *) buf = t; buf += sizeof(cmsUInt32Number); @@ -42,7 +42,7 @@ void byteReverse(cmsContext ContextID, cmsUInt8Number * buf, cmsUInt32Number lon } #else -#define byteReverse(ContextID, buf, len) +#define byteReverse(buf, len) #endif @@ -51,7 +51,6 @@ typedef struct { cmsUInt32Number buf[4]; cmsUInt32Number bits[2]; cmsUInt8Number in[64]; - cmsContext ContextID; } _cmsMD5; @@ -157,8 +156,6 @@ cmsHANDLE MD5alloc(cmsContext ContextID) _cmsMD5* ctx = (_cmsMD5*) _cmsMallocZero(ContextID, sizeof(_cmsMD5)); if (ctx == NULL) return NULL; - ctx ->ContextID = ContextID; - ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; @@ -196,7 +193,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len) } memmove(p, buf, t); - byteReverse(ctx->ContextID, ctx->in, 16); + byteReverse(ctx->in, 16); MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in); buf += t; @@ -205,7 +202,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len) while (len >= 64) { memmove(ctx->in, buf, 64); - byteReverse(ctx->ContextID, ctx->in, 16); + byteReverse(ctx->in, 16); MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in); buf += 64; len -= 64; @@ -216,7 +213,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len) // Destroy the object and return the checksum static -void MD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle) +void MD5finish(cmsContext ContextID, cmsProfileID* ProfileID, cmsHANDLE Handle) { _cmsMD5* ctx = (_cmsMD5*) Handle; cmsUInt32Number count; @@ -232,24 +229,24 @@ void MD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle) if (count < 8) { memset(p, 0, count); - byteReverse(ctx->ContextID, ctx->in, 16); + byteReverse(ctx->in, 16); MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in); memset(ctx->in, 0, 56); } else { memset(p, 0, count - 8); } - byteReverse(ctx->ContextID, ctx->in, 14); + byteReverse(ctx->in, 14); ((cmsUInt32Number *) ctx->in)[14] = ctx->bits[0]; ((cmsUInt32Number *) ctx->in)[15] = ctx->bits[1]; MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in); - byteReverse(ctx->ContextID, (cmsUInt8Number *) ctx->buf, 4); + byteReverse((cmsUInt8Number *) ctx->buf, 4); memmove(ProfileID ->ID8, ctx->buf, 16); - _cmsFree(ctx ->ContextID, ctx); + _cmsFree(ContextID, ctx); } @@ -300,7 +297,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile) memmove(Icc, &Keep, sizeof(_cmsICCPROFILE)); // And store the ID - MD5finish(&Icc ->ProfileID, MD5); + MD5finish(ContextID, &Icc ->ProfileID, MD5); return TRUE; Error: diff --git a/lcms2mt/src/cmsnamed.c b/lcms2mt/src/cmsnamed.c index 69bb79708..aac045b25 100644 --- a/lcms2mt/src/cmsnamed.c +++ b/lcms2mt/src/cmsnamed.c @@ -180,28 +180,20 @@ cmsBool AddMLUBlock(cmsContext ContextID, cmsMLU* mlu, cmsUInt32Number size, con // compilers don't properly align beginning of strings static -cmsUInt16Number strTo16(cmsContext ContextID, const char str[3]) +cmsUInt16Number strTo16(const char str[3]) { const cmsUInt8Number* ptr8 = (const cmsUInt8Number*)str; - cmsUInt16Number n = (cmsUInt16Number) (((cmsUInt16Number) ptr8[1] << 8) | ptr8[0]); + cmsUInt16Number n = (cmsUInt16Number)(((cmsUInt16Number)ptr8[0] << 8) | ptr8[1]); - return _cmsAdjustEndianess16(ContextID, n); + return n; } static -void strFrom16(cmsContext ContextID, char str[3], cmsUInt16Number n) +void strFrom16(char str[3], cmsUInt16Number n) { - // Assuming this would be aligned - union { - - cmsUInt16Number n; - cmsUInt8Number str[2]; - - } c; - - c.n = _cmsAdjustEndianess16(ContextID, n); - - str[0] = (char) c.str[0]; str[1] = (char) c.str[1]; str[2] = (char) 0; + str[0] = (char)(n >> 8); + str[1] = (char)n; + str[2] = (char)0; } @@ -211,8 +203,8 @@ cmsBool CMSEXPORT cmsMLUsetASCII(cmsContext ContextID, cmsMLU* mlu, const char L cmsUInt32Number i, len = (cmsUInt32Number) strlen(ASCIIString); wchar_t* WStr; cmsBool rc; - cmsUInt16Number Lang = strTo16(ContextID, LanguageCode); - cmsUInt16Number Cntry = strTo16(ContextID, CountryCode); + cmsUInt16Number Lang = strTo16(LanguageCode); + cmsUInt16Number Cntry = strTo16(CountryCode); if (mlu == NULL) return FALSE; @@ -245,8 +237,8 @@ cmsUInt32Number mywcslen(const wchar_t *s) // Add a wide entry. Do not add any \0 terminator (ICC1v43_2010-12.pdf page 61) cmsBool CMSEXPORT cmsMLUsetWide(cmsContext ContextID, cmsMLU* mlu, const char Language[3], const char Country[3], const wchar_t* WideString) { - cmsUInt16Number Lang = strTo16(ContextID, Language); - cmsUInt16Number Cntry = strTo16(ContextID, Country); + cmsUInt16Number Lang = strTo16(Language); + cmsUInt16Number Cntry = strTo16(Country); cmsUInt32Number len; if (mlu == NULL) return FALSE; @@ -375,8 +367,9 @@ cmsUInt32Number CMSEXPORT cmsMLUgetASCII(cmsContext ContextID, const cmsMLU* mlu cmsUInt32Number StrLen = 0; cmsUInt32Number ASCIIlen, i; - cmsUInt16Number Lang = strTo16(ContextID, LanguageCode); - cmsUInt16Number Cntry = strTo16(ContextID, CountryCode); + cmsUInt16Number Lang = strTo16(LanguageCode); + cmsUInt16Number Cntry = strTo16(CountryCode); + cmsUNUSED_PARAMETER(ContextID); // Sanitize if (mlu == NULL) return 0; @@ -419,8 +412,9 @@ cmsUInt32Number CMSEXPORT cmsMLUgetWide(cmsContext ContextID, const cmsMLU* mlu, const wchar_t *Wide; cmsUInt32Number StrLen = 0; - cmsUInt16Number Lang = strTo16(ContextID, LanguageCode); - cmsUInt16Number Cntry = strTo16(ContextID, CountryCode); + cmsUInt16Number Lang = strTo16(LanguageCode); + cmsUInt16Number Cntry = strTo16(CountryCode); + cmsUNUSED_PARAMETER(ContextID); // Sanitize if (mlu == NULL) return 0; @@ -452,9 +446,10 @@ CMSAPI cmsBool CMSEXPORT cmsMLUgetTranslation(cmsContext ContextID, const cmsMLU { const wchar_t *Wide; - cmsUInt16Number Lang = strTo16(ContextID, LanguageCode); - cmsUInt16Number Cntry = strTo16(ContextID, CountryCode); + cmsUInt16Number Lang = strTo16(LanguageCode); + cmsUInt16Number Cntry = strTo16(CountryCode); cmsUInt16Number ObtLang, ObtCode; + cmsUNUSED_PARAMETER(ContextID); // Sanitize if (mlu == NULL) return FALSE; @@ -463,8 +458,8 @@ CMSAPI cmsBool CMSEXPORT cmsMLUgetTranslation(cmsContext ContextID, const cmsMLU if (Wide == NULL) return FALSE; // Get used language and code - strFrom16(ContextID, ObtainedLanguage, ObtLang); - strFrom16(ContextID, ObtainedCountry, ObtCode); + strFrom16(ObtainedLanguage, ObtLang); + strFrom16(ObtainedCountry, ObtCode); return TRUE; } @@ -487,6 +482,7 @@ cmsBool CMSEXPORT cmsMLUtranslationsCodes(cmsContext ContextID, char CountryCode[3]) { _cmsMLUentry *entry; + cmsUNUSED_PARAMETER(ContextID); if (mlu == NULL) return FALSE; @@ -494,8 +490,8 @@ cmsBool CMSEXPORT cmsMLUtranslationsCodes(cmsContext ContextID, entry = &mlu->Entries[idx]; - strFrom16(ContextID, LanguageCode, entry->Language); - strFrom16(ContextID, CountryCode, entry->Country); + strFrom16(LanguageCode, entry->Language); + strFrom16(CountryCode, entry->Country); return TRUE; } @@ -729,7 +725,7 @@ void EvalNamedColor(cmsContext ContextID, const cmsFloat32Number In[], cmsFloat3 // Named color lookup element -cmsStage* _cmsStageAllocNamedColor(cmsContext ContextID, cmsNAMEDCOLORLIST* NamedColorList, cmsBool UsePCS) +cmsStage* CMSEXPORT _cmsStageAllocNamedColor(cmsContext ContextID, cmsNAMEDCOLORLIST* NamedColorList, cmsBool UsePCS) { return _cmsStageAllocPlaceholder(ContextID, cmsSigNamedColorElemType, diff --git a/lcms2mt/src/cmsopt.c b/lcms2mt/src/cmsopt.c index ce764b48e..0516da0ee 100644 --- a/lcms2mt/src/cmsopt.c +++ b/lcms2mt/src/cmsopt.c @@ -642,7 +642,7 @@ cmsBool OptimizeByResampling(cmsContext ContextID, cmsPipeline** Lut, cmsUInt32N cmsToneCurve** DataSetOut; Prelin16Data* p16; - // This is a loosy optimization! does not apply in floating-point cases + // This is a lossy optimization! does not apply in floating-point cases if (_cmsFormatterIsFloat(*InputFormat) || _cmsFormatterIsFloat(*OutputFormat)) return FALSE; ColorSpace = _cmsICCcolorSpace(ContextID, (int) T_COLORSPACE(*InputFormat)); @@ -906,7 +906,7 @@ void* Prelin8dup(cmsContext ContextID, const void* ptr) // A optimized interpolation for 8-bit input. #define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan]) -static +static CMS_NO_SANITIZE void PrelinEval8(cmsContext ContextID, register const cmsUInt16Number Input[], register cmsUInt16Number Output[], register const void* D) @@ -1039,7 +1039,7 @@ cmsBool OptimizeByComputingLinearization(cmsContext ContextID, cmsPipeline** Lut _cmsStageCLutData* OptimizedPrelinCLUT; - // This is a loosy optimization! does not apply in floating-point cases + // This is a lossy optimization! does not apply in floating-point cases if (_cmsFormatterIsFloat(*InputFormat) || _cmsFormatterIsFloat(*OutputFormat)) return FALSE; // Only on chunky RGB @@ -1389,7 +1389,7 @@ cmsBool OptimizeByJoiningCurves(cmsContext ContextID, cmsPipeline** Lut, cmsUInt cmsStage* ObtainedCurves = NULL; - // This is a loosy optimization! does not apply in floating-point cases + // This is a lossy optimization! does not apply in floating-point cases if (_cmsFormatterIsFloat(*InputFormat) || _cmsFormatterIsFloat(*OutputFormat)) return FALSE; // Only curves in this LUT? @@ -1764,8 +1764,8 @@ cmsBool OptimizeMatrixShaper(cmsContext ContextID, cmsPipeline** Lut, cmsUInt32N _cmsStageToneCurvesData* mpeC1 = (_cmsStageToneCurvesData*) cmsStageData(ContextID, Curve1); _cmsStageToneCurvesData* mpeC2 = (_cmsStageToneCurvesData*) cmsStageData(ContextID, Curve2); - // In this particular optimization, caché does not help as it takes more time to deal with - // the caché that with the pixel handling + // In this particular optimization, cache does not help as it takes more time to deal with + // the cache that with the pixel handling *dwFlags |= cmsFLAGS_NOCACHE; // Setup the optimizarion routines diff --git a/lcms2mt/src/cmspack.c b/lcms2mt/src/cmspack.c index 0b2b4e035..c9ded3899 100644 --- a/lcms2mt/src/cmspack.c +++ b/lcms2mt/src/cmspack.c @@ -531,7 +531,7 @@ cmsUInt8Number* UnrollPlanarWords(cmsContext ContextID, register _cmsTRANSFORM* cmsUInt8Number* Init = accum; if (DoSwap) { - accum += T_EXTRA(info -> InputFormat) * Stride * sizeof(cmsUInt16Number); + accum += T_EXTRA(info -> InputFormat) * Stride; } for (i=0; i < nChan; i++) { @@ -544,7 +544,7 @@ cmsUInt8Number* UnrollPlanarWords(cmsContext ContextID, register _cmsTRANSFORM* wIn[index] = Reverse ? REVERSE_FLAVOR_16(v) : v; - accum += Stride * sizeof(cmsUInt16Number); + accum += Stride; } return (Init + sizeof(cmsUInt16Number)); @@ -772,13 +772,18 @@ cmsUInt8Number* UnrollLabDoubleTo16(cmsContext ContextID, register _cmsTRANSFORM { if (T_PLANAR(info -> InputFormat)) { - cmsFloat64Number* Pt = (cmsFloat64Number*) accum; - cmsCIELab Lab; + cmsUInt8Number* pos_L; + cmsUInt8Number* pos_a; + cmsUInt8Number* pos_b; + + pos_L = accum; + pos_a = accum + Stride; + pos_b = accum + Stride * 2; - Lab.L = Pt[0]; - Lab.a = Pt[Stride]; - Lab.b = Pt[Stride*2]; + Lab.L = *(cmsFloat64Number*) pos_L; + Lab.a = *(cmsFloat64Number*) pos_a; + Lab.b = *(cmsFloat64Number*) pos_b; cmsFloat2LabEncoded(ContextID, wIn, &Lab); return accum + sizeof(cmsFloat64Number); @@ -803,12 +808,17 @@ cmsUInt8Number* UnrollLabFloatTo16(cmsContext ContextID, register _cmsTRANSFORM* if (T_PLANAR(info -> InputFormat)) { - cmsFloat32Number* Pt = (cmsFloat32Number*) accum; + cmsUInt8Number* pos_L; + cmsUInt8Number* pos_a; + cmsUInt8Number* pos_b; + pos_L = accum; + pos_a = accum + Stride; + pos_b = accum + Stride * 2; - Lab.L = Pt[0]; - Lab.a = Pt[Stride]; - Lab.b = Pt[Stride*2]; + Lab.L = *(cmsFloat32Number*)pos_L; + Lab.a = *(cmsFloat32Number*)pos_a; + Lab.b = *(cmsFloat32Number*)pos_b; cmsFloat2LabEncoded(ContextID, wIn, &Lab); return accum + sizeof(cmsFloat32Number); @@ -834,12 +844,19 @@ cmsUInt8Number* UnrollXYZDoubleTo16(cmsContext ContextID, register _cmsTRANSFORM { if (T_PLANAR(info -> InputFormat)) { - cmsFloat64Number* Pt = (cmsFloat64Number*) accum; cmsCIEXYZ XYZ; + cmsUInt8Number* pos_X; + cmsUInt8Number* pos_Y; + cmsUInt8Number* pos_Z; + + pos_X = accum; + pos_Y = accum + Stride; + pos_Z = accum + Stride * 2; + + XYZ.X = *(cmsFloat64Number*)pos_X; + XYZ.Y = *(cmsFloat64Number*)pos_Y; + XYZ.Z = *(cmsFloat64Number*)pos_Z; - XYZ.X = Pt[0]; - XYZ.Y = Pt[Stride]; - XYZ.Z = Pt[Stride*2]; cmsFloat2XYZEncoded(ContextID, wIn, &XYZ); return accum + sizeof(cmsFloat64Number); @@ -863,12 +880,19 @@ cmsUInt8Number* UnrollXYZFloatTo16(cmsContext ContextID, register _cmsTRANSFORM* { if (T_PLANAR(info -> InputFormat)) { - cmsFloat32Number* Pt = (cmsFloat32Number*) accum; cmsCIEXYZ XYZ; + cmsUInt8Number* pos_X; + cmsUInt8Number* pos_Y; + cmsUInt8Number* pos_Z; + + pos_X = accum; + pos_Y = accum + Stride; + pos_Z = accum + Stride * 2; + + XYZ.X = *(cmsFloat32Number*)pos_X; + XYZ.Y = *(cmsFloat32Number*)pos_Y; + XYZ.Z = *(cmsFloat32Number*)pos_Z; - XYZ.X = Pt[0]; - XYZ.Y = Pt[Stride]; - XYZ.Z = Pt[Stride*2]; cmsFloat2XYZEncoded(ContextID, wIn, &XYZ); return accum + sizeof(cmsFloat32Number); @@ -913,6 +937,20 @@ cmsINLINE cmsBool IsInkSpace(cmsUInt32Number Type) } } +// Return the size in bytes of a given formatter +static +cmsUInt32Number PixelSize(cmsUInt32Number Format) +{ + cmsUInt32Number fmt_bytes = T_BYTES(Format); + + // For double, the T_BYTES field is zero + if (fmt_bytes == 0) + return sizeof(cmsUInt64Number); + + // Otherwise, it is already correct for all formats + return fmt_bytes; +} + // Inks does come in percentage, remaining cases are between 0..1.0, again to 16 bits static cmsUInt8Number* UnrollDoubleTo16(cmsContext ContextID, register _cmsTRANSFORM* info, @@ -934,6 +972,8 @@ cmsUInt8Number* UnrollDoubleTo16(cmsContext ContextID, register _cmsTRANSFORM* i cmsFloat64Number maximum = IsInkSpace(info ->InputFormat) ? 655.35 : 65535.0; + Stride /= PixelSize(info->InputFormat); + if (ExtraFirst) start = Extra; @@ -989,6 +1029,7 @@ cmsUInt8Number* UnrollFloatTo16(cmsContext ContextID, register _cmsTRANSFORM* in cmsUInt32Number i, start = 0; cmsFloat64Number maximum = IsInkSpace(info ->InputFormat) ? 655.35 : 65535.0; + Stride /= PixelSize(info->InputFormat); if (ExtraFirst) start = Extra; @@ -1065,6 +1106,7 @@ cmsUInt8Number* UnrollFloatsToFloat(cmsContext ContextID, _cmsTRANSFORM* info, cmsUInt32Number i, start = 0; cmsFloat32Number maximum = IsInkSpace(info ->InputFormat) ? 100.0F : 1.0F; + Stride /= PixelSize(info->InputFormat); if (ExtraFirst) start = Extra; @@ -1117,6 +1159,7 @@ cmsUInt8Number* UnrollDoublesToFloat(cmsContext ContextID, _cmsTRANSFORM* info, cmsUInt32Number i, start = 0; cmsFloat64Number maximum = IsInkSpace(info ->InputFormat) ? 100.0 : 1.0; + Stride /= PixelSize(info->InputFormat); if (ExtraFirst) start = Extra; @@ -1162,7 +1205,9 @@ cmsUInt8Number* UnrollLabDoubleToFloat(cmsContext ContextID, _cmsTRANSFORM* info if (T_PLANAR(info -> InputFormat)) { - wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0); // from 0..100 to 0..1 + Stride /= PixelSize(info->InputFormat); + + wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0); // from 0..100 to 0..1 wIn[1] = (cmsFloat32Number) ((Pt[Stride] + 128) / 255.0); // form -128..+127 to 0..1 wIn[2] = (cmsFloat32Number) ((Pt[Stride*2] + 128) / 255.0); @@ -1190,6 +1235,8 @@ cmsUInt8Number* UnrollLabFloatToFloat(cmsContext ContextID, _cmsTRANSFORM* info, if (T_PLANAR(info -> InputFormat)) { + Stride /= PixelSize(info->InputFormat); + wIn[0] = (cmsFloat32Number) (Pt[0] / 100.0); // from 0..100 to 0..1 wIn[1] = (cmsFloat32Number) ((Pt[Stride] + 128) / 255.0); // form -128..+127 to 0..1 wIn[2] = (cmsFloat32Number) ((Pt[Stride*2] + 128) / 255.0); @@ -1220,6 +1267,8 @@ cmsUInt8Number* UnrollXYZDoubleToFloat(cmsContext ContextID, _cmsTRANSFORM* info if (T_PLANAR(info -> InputFormat)) { + Stride /= PixelSize(info->InputFormat); + wIn[0] = (cmsFloat32Number) (Pt[0] / MAX_ENCODEABLE_XYZ); wIn[1] = (cmsFloat32Number) (Pt[Stride] / MAX_ENCODEABLE_XYZ); wIn[2] = (cmsFloat32Number) (Pt[Stride*2] / MAX_ENCODEABLE_XYZ); @@ -1247,6 +1296,8 @@ cmsUInt8Number* UnrollXYZFloatToFloat(cmsContext ContextID, _cmsTRANSFORM* info, if (T_PLANAR(info -> InputFormat)) { + Stride /= PixelSize(info->InputFormat); + wIn[0] = (cmsFloat32Number) (Pt[0] / MAX_ENCODEABLE_XYZ); wIn[1] = (cmsFloat32Number) (Pt[Stride] / MAX_ENCODEABLE_XYZ); wIn[2] = (cmsFloat32Number) (Pt[Stride*2] / MAX_ENCODEABLE_XYZ); @@ -1429,7 +1480,7 @@ cmsUInt8Number* PackPlanarWords(cmsContext ContextID, register _cmsTRANSFORM* in cmsUInt16Number v; if (DoSwap) { - output += T_EXTRA(info -> OutputFormat) * Stride * sizeof(cmsUInt16Number); + output += T_EXTRA(info -> OutputFormat) * Stride; } for (i=0; i < nChan; i++) { @@ -1445,7 +1496,7 @@ cmsUInt8Number* PackPlanarWords(cmsContext ContextID, register _cmsTRANSFORM* in v = REVERSE_FLAVOR_16(v); *(cmsUInt16Number*) output = v; - output += (Stride * sizeof(cmsUInt16Number)); + output += Stride; } return (Init + sizeof(cmsUInt16Number)); @@ -2297,6 +2348,8 @@ cmsUInt8Number* PackLabFloatFrom16(cmsContext ContextID, register _cmsTRANSFORM* cmsFloat32Number* Out = (cmsFloat32Number*) output; + Stride /= PixelSize(info->OutputFormat); + Out[0] = (cmsFloat32Number)Lab.L; Out[Stride] = (cmsFloat32Number)Lab.a; Out[Stride*2] = (cmsFloat32Number)Lab.b; @@ -2325,6 +2378,8 @@ cmsUInt8Number* PackXYZDoubleFrom16(cmsContext ContextID, register _cmsTRANSFORM cmsFloat64Number* Out = (cmsFloat64Number*) output; cmsXYZEncoded2Float(ContextID, &XYZ, wOut); + Stride /= PixelSize(Info->OutputFormat); + Out[0] = XYZ.X; Out[Stride] = XYZ.Y; Out[Stride*2] = XYZ.Z; @@ -2352,6 +2407,8 @@ cmsUInt8Number* PackXYZFloatFrom16(cmsContext ContextID, register _cmsTRANSFORM* cmsFloat32Number* Out = (cmsFloat32Number*) output; cmsXYZEncoded2Float(ContextID, &XYZ, wOut); + Stride /= PixelSize(Info->OutputFormat); + Out[0] = (cmsFloat32Number) XYZ.X; Out[Stride] = (cmsFloat32Number) XYZ.Y; Out[Stride*2] = (cmsFloat32Number) XYZ.Z; @@ -2391,6 +2448,8 @@ cmsUInt8Number* PackDoubleFrom16(cmsContext ContextID, register _cmsTRANSFORM* i cmsFloat64Number* swap1 = (cmsFloat64Number*) output; cmsUInt32Number i, start = 0; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -2442,6 +2501,8 @@ cmsUInt8Number* PackFloatFrom16(cmsContext ContextID, register _cmsTRANSFORM* in cmsFloat32Number* swap1 = (cmsFloat32Number*)output; cmsUInt32Number i, start = 0; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -2495,6 +2556,8 @@ cmsUInt8Number* PackFloatsFromFloat(cmsContext ContextID, _cmsTRANSFORM* info, cmsFloat64Number v = 0; cmsUInt32Number i, start = 0; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -2544,6 +2607,8 @@ cmsUInt8Number* PackDoublesFromFloat(cmsContext ContextID, _cmsTRANSFORM* info, cmsFloat64Number* swap1 = (cmsFloat64Number*)output; cmsUInt32Number i, start = 0; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -2590,6 +2655,8 @@ cmsUInt8Number* PackLabFloatFromFloat(cmsContext ContextID, _cmsTRANSFORM* Info, if (T_PLANAR(Info -> OutputFormat)) { + Stride /= PixelSize(Info->OutputFormat); + Out[0] = (cmsFloat32Number) (wOut[0] * 100.0); Out[Stride] = (cmsFloat32Number) (wOut[1] * 255.0 - 128.0); Out[Stride*2] = (cmsFloat32Number) (wOut[2] * 255.0 - 128.0); @@ -2618,6 +2685,8 @@ cmsUInt8Number* PackLabDoubleFromFloat(cmsContext ContextID, _cmsTRANSFORM* Info if (T_PLANAR(Info -> OutputFormat)) { + Stride /= PixelSize(Info->OutputFormat); + Out[0] = (cmsFloat64Number) (wOut[0] * 100.0); Out[Stride] = (cmsFloat64Number) (wOut[1] * 255.0 - 128.0); Out[Stride*2] = (cmsFloat64Number) (wOut[2] * 255.0 - 128.0); @@ -2647,6 +2716,8 @@ cmsUInt8Number* PackXYZFloatFromFloat(cmsContext ContextID, _cmsTRANSFORM* Info, if (T_PLANAR(Info -> OutputFormat)) { + Stride /= PixelSize(Info->OutputFormat); + Out[0] = (cmsFloat32Number) (wOut[0] * MAX_ENCODEABLE_XYZ); Out[Stride] = (cmsFloat32Number) (wOut[1] * MAX_ENCODEABLE_XYZ); Out[Stride*2] = (cmsFloat32Number) (wOut[2] * MAX_ENCODEABLE_XYZ); @@ -2675,6 +2746,8 @@ cmsUInt8Number* PackXYZDoubleFromFloat(cmsContext ContextID, _cmsTRANSFORM* Info if (T_PLANAR(Info -> OutputFormat)) { + Stride /= PixelSize(Info->OutputFormat); + Out[0] = (cmsFloat64Number) (wOut[0] * MAX_ENCODEABLE_XYZ); Out[Stride] = (cmsFloat64Number) (wOut[1] * MAX_ENCODEABLE_XYZ); Out[Stride*2] = (cmsFloat64Number) (wOut[2] * MAX_ENCODEABLE_XYZ); @@ -2718,6 +2791,8 @@ cmsUInt8Number* UnrollHalfTo16(cmsContext ContextID, register _cmsTRANSFORM* inf cmsFloat32Number maximum = IsInkSpace(info ->InputFormat) ? 655.35F : 65535.0F; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -2769,6 +2844,7 @@ cmsUInt8Number* UnrollHalfToFloat(cmsContext ContextID, _cmsTRANSFORM* info, cmsUInt32Number i, start = 0; cmsFloat32Number maximum = IsInkSpace(info ->InputFormat) ? 100.0F : 1.0F; + Stride /= PixelSize(info->OutputFormat); if (ExtraFirst) start = Extra; @@ -2820,6 +2896,8 @@ cmsUInt8Number* PackHalfFrom16(cmsContext ContextID, register _cmsTRANSFORM* inf cmsUInt16Number* swap1 = (cmsUInt16Number*)output; cmsUInt32Number i, start = 0; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -2871,6 +2949,8 @@ cmsUInt8Number* PackHalfFromFloat(cmsContext ContextID, _cmsTRANSFORM* info, cmsFloat32Number v = 0; cmsUInt32Number i, start = 0; + Stride /= PixelSize(info->OutputFormat); + if (ExtraFirst) start = Extra; @@ -3288,10 +3368,10 @@ cmsBool _cmsRegisterFormattersPlugin(cmsContext ContextID, cmsPluginBase* Data) return TRUE; } -cmsFormatter _cmsGetFormatter(cmsContext ContextID, - cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 - cmsFormatterDirection Dir, - cmsUInt32Number dwFlags) +cmsFormatter CMSEXPORT _cmsGetFormatter(cmsContext ContextID, + cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 + cmsFormatterDirection Dir, + cmsUInt32Number dwFlags) { _cmsFormattersPluginChunkType* ctx = ( _cmsFormattersPluginChunkType*) _cmsContextGetClientChunk(ContextID, FormattersPlugin); cmsFormattersFactoryList* f; diff --git a/lcms2mt/src/cmsplugin.c b/lcms2mt/src/cmsplugin.c index 8ad8538c9..abc18ceda 100644 --- a/lcms2mt/src/cmsplugin.c +++ b/lcms2mt/src/cmsplugin.c @@ -33,14 +33,13 @@ // Little-Endian to Big-Endian -// Adjust a word value after being readed/ before being written from/to an ICC profile -cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsContext ContextID, cmsUInt16Number Word) +// Adjust a word value after being read/ before being written from/to an ICC profile +cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsUInt16Number Word) { #ifndef CMS_USE_BIG_ENDIAN cmsUInt8Number* pByte = (cmsUInt8Number*) &Word; cmsUInt8Number tmp; - cmsUNUSED_PARAMETER(ContextID); tmp = pByte[0]; pByte[0] = pByte[1]; @@ -56,13 +55,12 @@ cmsUInt16Number CMSEXPORT _cmsAdjustEndianess16(cmsContext ContextID, cmsUInt16 // 1 2 3 4 // 4 3 2 1 -cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsContext ContextID, cmsUInt32Number DWord) +cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsUInt32Number DWord) { #ifndef CMS_USE_BIG_ENDIAN cmsUInt8Number* pByte = (cmsUInt8Number*) &DWord; cmsUInt8Number temp1; cmsUInt8Number temp2; - cmsUNUSED_PARAMETER(ContextID); temp1 = *pByte++; temp2 = *pByte++; @@ -77,14 +75,13 @@ cmsUInt32Number CMSEXPORT _cmsAdjustEndianess32(cmsContext ContextID, cmsUInt32 // 1 2 3 4 5 6 7 8 // 8 7 6 5 4 3 2 1 -void CMSEXPORT _cmsAdjustEndianess64(cmsContext ContextID, cmsUInt64Number* Result, cmsUInt64Number* QWord) +void CMSEXPORT _cmsAdjustEndianess64(cmsUInt64Number* Result, cmsUInt64Number* QWord) { #ifndef CMS_USE_BIG_ENDIAN cmsUInt8Number* pIn = (cmsUInt8Number*) QWord; cmsUInt8Number* pOut = (cmsUInt8Number*) Result; - cmsUNUSED_PARAMETER(ContextID); _cmsAssert(Result != NULL); @@ -101,8 +98,8 @@ void CMSEXPORT _cmsAdjustEndianess64(cmsContext ContextID, cmsUInt64Number* Res _cmsAssert(Result != NULL); # ifdef CMS_DONT_USE_INT64 - (*Result)[0] = QWord[0]; - (*Result)[1] = QWord[1]; + (*Result)[0] = (*QWord)[0]; + (*Result)[1] = (*QWord)[1]; # else *Result = *QWord; # endif @@ -132,7 +129,7 @@ cmsBool CMSEXPORT _cmsReadUInt16Number(cmsContext ContextID, cmsIOHANDLER* io, if (io -> Read(ContextID, io, &tmp, sizeof(cmsUInt16Number), 1) != 1) return FALSE; - if (n != NULL) *n = _cmsAdjustEndianess16(ContextID, tmp); + if (n != NULL) *n = _cmsAdjustEndianess16(tmp); return TRUE; } @@ -164,7 +161,7 @@ cmsBool CMSEXPORT _cmsReadUInt32Number(cmsContext ContextID, cmsIOHANDLER* io, if (io -> Read(ContextID, io, &tmp, sizeof(cmsUInt32Number), 1) != 1) return FALSE; - if (n != NULL) *n = _cmsAdjustEndianess32(ContextID, tmp); + if (n != NULL) *n = _cmsAdjustEndianess32(tmp); return TRUE; } @@ -179,7 +176,7 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsContext ContextID, cmsIOHANDLER* io, if (n != NULL) { - tmp = _cmsAdjustEndianess32(ContextID, tmp); + tmp = _cmsAdjustEndianess32(tmp); *n = *(cmsFloat32Number*)(void*)&tmp; // Safeguard which covers against absurd values @@ -213,7 +210,7 @@ cmsBool CMSEXPORT _cmsReadUInt64Number(cmsContext ContextID, cmsIOHANDLER* io, if (n != NULL) { - _cmsAdjustEndianess64(ContextID, n, &tmp); + _cmsAdjustEndianess64(n, &tmp); } return TRUE; @@ -230,7 +227,7 @@ cmsBool CMSEXPORT _cmsRead15Fixed16Number(cmsContext ContextID, cmsIOHANDLER* i return FALSE; if (n != NULL) { - *n = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, tmp)); + *n = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32(tmp)); } return TRUE; @@ -247,9 +244,9 @@ cmsBool CMSEXPORT _cmsReadXYZNumber(cmsContext ContextID, cmsIOHANDLER* io, cms if (XYZ != NULL) { - XYZ->X = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) xyz.X)); - XYZ->Y = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) xyz.Y)); - XYZ->Z = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) xyz.Z)); + XYZ->X = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) xyz.X)); + XYZ->Y = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) xyz.Y)); + XYZ->Z = _cms15Fixed16toDouble(ContextID, (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) xyz.Z)); } return TRUE; } @@ -270,7 +267,7 @@ cmsBool CMSEXPORT _cmsWriteUInt16Number(cmsContext ContextID, cmsIOHANDLER* io, _cmsAssert(io != NULL); - tmp = _cmsAdjustEndianess16(ContextID, n); + tmp = _cmsAdjustEndianess16(n); if (io -> Write(ContextID, io, sizeof(cmsUInt16Number), &tmp) != 1) return FALSE; @@ -297,7 +294,7 @@ cmsBool CMSEXPORT _cmsWriteUInt32Number(cmsContext ContextID, cmsIOHANDLER* io, _cmsAssert(io != NULL); - tmp = _cmsAdjustEndianess32(ContextID, n); + tmp = _cmsAdjustEndianess32(n); if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp) != 1) return FALSE; @@ -312,7 +309,7 @@ cmsBool CMSEXPORT _cmsWriteFloat32Number(cmsContext ContextID, cmsIOHANDLER* io _cmsAssert(io != NULL); tmp = *(cmsUInt32Number*) (void*) &n; - tmp = _cmsAdjustEndianess32(ContextID, tmp); + tmp = _cmsAdjustEndianess32(tmp); if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp) != 1) return FALSE; @@ -325,7 +322,7 @@ cmsBool CMSEXPORT _cmsWriteUInt64Number(cmsContext ContextID, cmsIOHANDLER* io, _cmsAssert(io != NULL); - _cmsAdjustEndianess64(ContextID, &tmp, n); + _cmsAdjustEndianess64(&tmp, n); if (io -> Write(ContextID, io, sizeof(cmsUInt64Number), &tmp) != 1) return FALSE; @@ -338,7 +335,7 @@ cmsBool CMSEXPORT _cmsWrite15Fixed16Number(cmsContext ContextID, cmsIOHANDLER* _cmsAssert(io != NULL); - tmp = _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, n)); + tmp = _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, n)); if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp) != 1) return FALSE; @@ -352,9 +349,9 @@ cmsBool CMSEXPORT _cmsWriteXYZNumber(cmsContext ContextID, cmsIOHANDLER* io, co _cmsAssert(io != NULL); _cmsAssert(XYZ != NULL); - xyz.X = (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, XYZ->X)); - xyz.Y = (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, XYZ->Y)); - xyz.Z = (cmsS15Fixed16Number) _cmsAdjustEndianess32(ContextID, (cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, XYZ->Z)); + xyz.X = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, XYZ->X)); + xyz.Y = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, XYZ->Y)); + xyz.Z = (cmsS15Fixed16Number) _cmsAdjustEndianess32((cmsUInt32Number) _cmsDoubleTo15Fixed16(ContextID, XYZ->Z)); return io -> Write(ContextID, io, sizeof(cmsEncodedXYZNumber), &xyz); } @@ -407,16 +404,17 @@ cmsS15Fixed16Number CMSEXPORT _cmsDoubleTo15Fixed16(cmsContext ContextID, cmsFlo void CMSEXPORT _cmsDecodeDateTimeNumber(cmsContext ContextID, const cmsDateTimeNumber *Source, struct tm *Dest) { + cmsUNUSED_PARAMETER(ContextID); _cmsAssert(Dest != NULL); _cmsAssert(Source != NULL); - Dest->tm_sec = _cmsAdjustEndianess16(ContextID, Source->seconds); - Dest->tm_min = _cmsAdjustEndianess16(ContextID, Source->minutes); - Dest->tm_hour = _cmsAdjustEndianess16(ContextID, Source->hours); - Dest->tm_mday = _cmsAdjustEndianess16(ContextID, Source->day); - Dest->tm_mon = _cmsAdjustEndianess16(ContextID, Source->month) - 1; - Dest->tm_year = _cmsAdjustEndianess16(ContextID, Source->year) - 1900; + Dest->tm_sec = _cmsAdjustEndianess16(Source->seconds); + Dest->tm_min = _cmsAdjustEndianess16(Source->minutes); + Dest->tm_hour = _cmsAdjustEndianess16(Source->hours); + Dest->tm_mday = _cmsAdjustEndianess16(Source->day); + Dest->tm_mon = _cmsAdjustEndianess16(Source->month) - 1; + Dest->tm_year = _cmsAdjustEndianess16(Source->year) - 1900; Dest->tm_wday = -1; Dest->tm_yday = -1; Dest->tm_isdst = 0; @@ -424,15 +422,17 @@ void CMSEXPORT _cmsDecodeDateTimeNumber(cmsContext ContextID, const cmsDateTimeN void CMSEXPORT _cmsEncodeDateTimeNumber(cmsContext ContextID, cmsDateTimeNumber *Dest, const struct tm *Source) { + cmsUNUSED_PARAMETER(ContextID); + _cmsAssert(Dest != NULL); _cmsAssert(Source != NULL); - Dest->seconds = _cmsAdjustEndianess16(ContextID, (cmsUInt16Number) Source->tm_sec); - Dest->minutes = _cmsAdjustEndianess16(ContextID, (cmsUInt16Number) Source->tm_min); - Dest->hours = _cmsAdjustEndianess16(ContextID, (cmsUInt16Number) Source->tm_hour); - Dest->day = _cmsAdjustEndianess16(ContextID, (cmsUInt16Number) Source->tm_mday); - Dest->month = _cmsAdjustEndianess16(ContextID, (cmsUInt16Number) (Source->tm_mon + 1)); - Dest->year = _cmsAdjustEndianess16(ContextID, (cmsUInt16Number) (Source->tm_year + 1900)); + Dest->seconds = _cmsAdjustEndianess16((cmsUInt16Number) Source->tm_sec); + Dest->minutes = _cmsAdjustEndianess16((cmsUInt16Number) Source->tm_min); + Dest->hours = _cmsAdjustEndianess16((cmsUInt16Number) Source->tm_hour); + Dest->day = _cmsAdjustEndianess16((cmsUInt16Number) Source->tm_mday); + Dest->month = _cmsAdjustEndianess16((cmsUInt16Number) (Source->tm_mon + 1)); + Dest->year = _cmsAdjustEndianess16((cmsUInt16Number) (Source->tm_year + 1900)); } // Read base and return type base @@ -445,7 +445,7 @@ cmsTagTypeSignature CMSEXPORT _cmsReadTypeBase(cmsContext ContextID, cmsIOHANDLE if (io -> Read(ContextID, io, &Base, sizeof(_cmsTagBase), 1) != 1) return (cmsTagTypeSignature) 0; - return (cmsTagTypeSignature) _cmsAdjustEndianess32(ContextID, Base.sig); + return (cmsTagTypeSignature) _cmsAdjustEndianess32(Base.sig); } // Setup base marker @@ -455,7 +455,7 @@ cmsBool CMSEXPORT _cmsWriteTypeBase(cmsContext ContextID, cmsIOHANDLER* io, cms _cmsAssert(io != NULL); - Base.sig = (cmsTagTypeSignature) _cmsAdjustEndianess32(ContextID, sig); + Base.sig = (cmsTagTypeSignature) _cmsAdjustEndianess32(sig); memset(&Base.reserved, 0, sizeof(Base.reserved)); return io -> Write(ContextID, io, sizeof(_cmsTagBase), &Base); } @@ -548,12 +548,7 @@ void* _cmsPluginMalloc(cmsContext ContextID, cmsUInt32Number size) // Main plug-in dispatcher -cmsBool CMSEXPORT cmsPlugin(void* Plug_in) -{ - return cmsPluginTHR(NULL, Plug_in); -} - -cmsBool CMSEXPORT cmsPluginTHR(cmsContext id, void* Plug_in) +cmsBool CMSEXPORT cmsPlugin(cmsContext id, void* Plug_in) { cmsPluginBase* Plugin; @@ -636,14 +631,6 @@ cmsBool CMSEXPORT cmsPluginTHR(cmsContext id, void* Plug_in) } -// Revert all plug-ins to default -void CMSEXPORT cmsUnregisterPlugins(cmsContext ContextID) -{ - cmsUNUSED_PARAMETER(ContextID); - cmsUnregisterPluginsTHR(NULL); -} - - // The Global storage for system context. This is the one and only global variable // pointers structure. All global vars are referenced here. static struct _cmsContext_struct globalContext = { @@ -733,10 +720,10 @@ void* _cmsContextGetClientChunk(cmsContext ContextID, _cmsMemoryClient mc) // This function returns the given context its default pristine state, // as no plug-ins were declared. There is no way to unregister a single -// plug-in, as a single call to cmsPluginTHR() function may register +// plug-in, as a single call to cmsPlugin() function may register // many different plug-ins simultaneously, then there is no way to // identify which plug-in to unregister. -void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID) +void CMSEXPORT cmsUnregisterPlugins(cmsContext ContextID) { _cmsRegisterMemHandlerPlugin(ContextID, NULL); _cmsRegisterInterpPlugin(ContextID, NULL); @@ -856,7 +843,7 @@ cmsContext CMSEXPORT cmsCreateContext(void* Plugin, void* UserData) _cmsAllocMutexPluginChunk(ctx, NULL); // Setup the plug-ins - if (!cmsPluginTHR(ctx, Plugin)) { + if (!cmsPlugin(ctx, Plugin)) { cmsDeleteContext(ctx); return NULL; @@ -965,7 +952,7 @@ void CMSEXPORT cmsDeleteContext(cmsContext ContextID) fakeContext.chunks[MemPlugin] = &fakeContext.DefaultMemoryManager; // Get rid of plugins - cmsUnregisterPluginsTHR(ContextID); + cmsUnregisterPlugins(ContextID); // Since all memory is allocated in the private pool, all what we need to do is destroy the pool if (ctx -> MemPool != NULL) diff --git a/lcms2mt/src/cmsps2.c b/lcms2mt/src/cmsps2.c index 78b65393a..179a0467d 100644 --- a/lcms2mt/src/cmsps2.c +++ b/lcms2mt/src/cmsps2.c @@ -78,8 +78,8 @@ Matrix-shaper based ------------------- - This is implemented both with /CIEBasedABC or /CIEBasedDEF on dependig - of profile implementation. Since here there are no interpolation tables, I do + This is implemented both with /CIEBasedABC or /CIEBasedDEF depending on the + profile implementation. Since here there are no interpolation tables, I do the conversion directly to XYZ @@ -328,11 +328,10 @@ void WriteByte(cmsContext ContextID, cmsIOHANDLER* m, cmsUInt8Number b) // Removes offending Carriage returns static -char* RemoveCR(cmsContext ContextID, const char* txt) +char* RemoveCR(const char* txt) { static char Buffer[2048]; char* pt; - cmsUNUSED_PARAMETER(ContextID); strncpy(Buffer, txt, 2047); Buffer[2047] = 0; @@ -364,8 +363,8 @@ void EmitHeader(cmsContext ContextID, cmsIOHANDLER* m, const char* Title, cmsHPR _cmsIOPrintf(ContextID, m, "%%!PS-Adobe-3.0\n"); _cmsIOPrintf(ContextID, m, "%%\n"); _cmsIOPrintf(ContextID, m, "%% %s\n", Title); - _cmsIOPrintf(ContextID, m, "%% Source: %s\n", RemoveCR(ContextID, DescASCII)); - _cmsIOPrintf(ContextID, m, "%% %s\n", RemoveCR(ContextID, CopyrightASCII)); + _cmsIOPrintf(ContextID, m, "%% Source: %s\n", RemoveCR(DescASCII)); + _cmsIOPrintf(ContextID, m, "%% %s\n", RemoveCR(CopyrightASCII)); _cmsIOPrintf(ContextID, m, "%% Created: %s", ctime(&timer)); // ctime appends a \n!!! _cmsIOPrintf(ContextID, m, "%%\n"); _cmsIOPrintf(ContextID, m, "%%%%BeginResource\n"); @@ -535,9 +534,8 @@ void Emit1Gamma(cmsContext ContextID, cmsIOHANDLER* m, cmsToneCurve* Table) // Compare gamma table static -cmsBool GammaTableEquals(cmsContext ContextID, cmsUInt16Number* g1, cmsUInt16Number* g2, cmsUInt32Number nEntries) +cmsBool GammaTableEquals(cmsUInt16Number* g1, cmsUInt16Number* g2, cmsUInt32Number nEntries) { - cmsUNUSED_PARAMETER(ContextID); return memcmp(g1, g2, nEntries* sizeof(cmsUInt16Number)) == 0; } @@ -553,7 +551,7 @@ void EmitNGamma(cmsContext ContextID, cmsIOHANDLER* m, cmsUInt32Number n, cmsTon { if (g[i] == NULL) return; // Error - if (i > 0 && GammaTableEquals(ContextID, g[i-1]->Table16, g[i]->Table16, g[i]->nEntries)) { + if (i > 0 && GammaTableEquals(g[i-1]->Table16, g[i]->Table16, g[i]->nEntries)) { _cmsIOPrintf(ContextID, m, "dup "); } @@ -833,8 +831,8 @@ static cmsToneCurve* ExtractGray2Y(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent) { cmsToneCurve* Out = cmsBuildTabulatedToneCurve16(ContextID, 256, NULL); - cmsHPROFILE hXYZ = cmsCreateXYZProfile(); - cmsHTRANSFORM xform = cmsCreateTransformTHR(ContextID, hProfile, TYPE_GRAY_8, hXYZ, TYPE_XYZ_DBL, Intent, cmsFLAGS_NOOPTIMIZE); + cmsHPROFILE hXYZ = cmsCreateXYZProfile(ContextID); + cmsHTRANSFORM xform = cmsCreateTransform(ContextID, hProfile, TYPE_GRAY_8, hXYZ, TYPE_XYZ_DBL, Intent, cmsFLAGS_NOOPTIMIZE); int i; if (Out != NULL && xform != NULL) { @@ -880,12 +878,12 @@ int WriteInputLUT(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hProfile, c cmsDetectBlackPoint(ContextID, &BlackPointAdaptedToD50, hProfile, Intent, 0); // Adjust output to Lab4 - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); + hLab = cmsCreateLab4Profile(ContextID, NULL); Profiles[0] = hProfile; Profiles[1] = hLab; - xform = cmsCreateMultiprofileTransform(Profiles, 2, InputFormat, TYPE_Lab_DBL, Intent, 0); + xform = cmsCreateMultiprofileTransform(ContextID, Profiles, 2, InputFormat, TYPE_Lab_DBL, Intent, 0); cmsCloseProfile(ContextID, hLab); if (xform == NULL) { @@ -936,10 +934,9 @@ int WriteInputLUT(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hProfile, c } static -cmsFloat64Number* GetPtrToMatrix(cmsContext ContextID, const cmsStage* mpe) +cmsFloat64Number* GetPtrToMatrix(const cmsStage* mpe) { _cmsStageMatrixData* Data = (_cmsStageMatrixData*) mpe ->Data; - cmsUNUSED_PARAMETER(ContextID); return Data -> Double; } @@ -969,7 +966,7 @@ int WriteInputMatrixShaper(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hP cmsMAT3 Mat; int i, j; - memmove(&Mat, GetPtrToMatrix(ContextID, Matrix), sizeof(Mat)); + memmove(&Mat, GetPtrToMatrix(Matrix), sizeof(Mat)); for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) @@ -1002,8 +999,8 @@ int WriteNamedColorCSA(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hNamed char ColorName[cmsMAX_PATH]; cmsNAMEDCOLORLIST* NamedColorList; - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); - xform = cmsCreateTransform(hNamedColor, TYPE_NAMED_COLOR_INDEX, hLab, TYPE_Lab_DBL, Intent, 0); + hLab = cmsCreateLab4Profile(ContextID, NULL); + xform = cmsCreateTransform(ContextID, hNamedColor, TYPE_NAMED_COLOR_INDEX, hLab, TYPE_Lab_DBL, Intent, 0); if (xform == NULL) return 0; NamedColorList = cmsGetNamedColorList(xform); @@ -1273,7 +1270,7 @@ void EmitXYZ2Lab(cmsContext ContextID, cmsIOHANDLER* m) // Due to impedance mismatch between XYZ and almost all RGB and CMYK spaces // I choose to dump LUTS in Lab instead of XYZ. There is still a lot of wasted // space on 3D CLUT, but since space seems not to be a problem here, 33 points -// would give a reasonable accurancy. Note also that CRD tables must operate in +// would give a reasonable accuracy. Note also that CRD tables must operate in // 8 bits. static @@ -1294,7 +1291,7 @@ int WriteOutputLUT(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hProfile, cmsColorSpaceSignature ColorSpace; - hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); + hLab = cmsCreateLab4Profile(ContextID, NULL); if (hLab == NULL) return 0; OutputFormat = cmsFormatterForColorspaceOfProfile(ContextID, hProfile, 2, FALSE); @@ -1313,7 +1310,7 @@ int WriteOutputLUT(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hProfile, Profiles[0] = hLab; Profiles[1] = hProfile; - xform = cmsCreateMultiprofileTransformTHR(ContextID, + xform = cmsCreateMultiprofileTransform(ContextID, Profiles, 2, TYPE_Lab_DBL, OutputFormat, RelativeEncodingIntent, 0); cmsCloseProfile(ContextID, hLab); @@ -1386,11 +1383,10 @@ int WriteOutputLUT(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hProfile, // Builds a ASCII string containing colorant list in 0..1.0 range static -void BuildColorantList(cmsContext ContextID, char *Colorant, cmsUInt32Number nColorant, cmsUInt16Number Out[]) +void BuildColorantList(char *Colorant, cmsUInt32Number nColorant, cmsUInt16Number Out[]) { char Buff[32]; cmsUInt32Number j; - cmsUNUSED_PARAMETER(ContextID); Colorant[0] = 0; if (nColorant > cmsMAXCHANNELS) @@ -1426,7 +1422,7 @@ int WriteNamedColorCRD(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hNamed nColorant = T_CHANNELS(OutputFormat); - xform = cmsCreateTransform(hNamedColor, TYPE_NAMED_COLOR_INDEX, NULL, OutputFormat, Intent, dwFlags); + xform = cmsCreateTransform(ContextID, hNamedColor, TYPE_NAMED_COLOR_INDEX, NULL, OutputFormat, Intent, dwFlags); if (xform == NULL) return 0; @@ -1451,7 +1447,7 @@ int WriteNamedColorCRD(cmsContext ContextID, cmsIOHANDLER* m, cmsHPROFILE hNamed continue; cmsDoTransform(ContextID, xform, In, Out, 1); - BuildColorantList(ContextID, Colorant, nColorant, Out); + BuildColorantList(Colorant, nColorant, Out); _cmsIOPrintf(ContextID, m, " (%s) [ %s ]\n", ColorName, Colorant); } @@ -1513,8 +1509,6 @@ cmsUInt32Number GenerateCRD(cmsContext ContextID, // Finally, return used byte count return dwBytesUsed; - - cmsUNUSED_PARAMETER(ContextID); } diff --git a/lcms2mt/src/cmssamp.c b/lcms2mt/src/cmssamp.c index 196b1de3c..b6fbdbe80 100644 --- a/lcms2mt/src/cmssamp.c +++ b/lcms2mt/src/cmssamp.c @@ -40,7 +40,7 @@ static cmsHTRANSFORM CreateRoundtripXForm(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number nIntent) { - cmsHPROFILE hLab = cmsCreateLab4ProfileTHR(ContextID, NULL); + cmsHPROFILE hLab = cmsCreateLab4Profile(ContextID, NULL); cmsHTRANSFORM xform; cmsBool BPC[4] = { FALSE, FALSE, FALSE, FALSE }; cmsFloat64Number States[4] = { 1.0, 1.0, 1.0, 1.0 }; @@ -101,14 +101,14 @@ cmsBool BlackPointAsDarkerColorant(cmsContext ContextID, } // Lab will be used as the output space, but lab2 will avoid recursion - hLab = cmsCreateLab2ProfileTHR(ContextID, NULL); + hLab = cmsCreateLab2Profile(ContextID, NULL); if (hLab == NULL) { BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0; return FALSE; } // Create the transform - xform = cmsCreateTransformTHR(ContextID, hInput, dwFormat, + xform = cmsCreateTransform(ContextID, hInput, dwFormat, hLab, TYPE_Lab_DBL, Intent, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); cmsCloseProfile(ContextID, hLab); diff --git a/lcms2mt/src/cmssm.c b/lcms2mt/src/cmssm.c index 656126efa..2c77587a5 100644 --- a/lcms2mt/src/cmssm.c +++ b/lcms2mt/src/cmssm.c @@ -97,10 +97,9 @@ typedef struct { // ATAN2() which always returns degree positive numbers static -cmsFloat64Number _cmsAtan2(cmsContext ContextID, cmsFloat64Number y, cmsFloat64Number x) +cmsFloat64Number _cmsAtan2(cmsFloat64Number y, cmsFloat64Number x) { cmsFloat64Number a; - cmsUNUSED_PARAMETER(ContextID); // Deal with undefined case if (x == 0.0 && y == 0.0) return 0; @@ -116,7 +115,7 @@ cmsFloat64Number _cmsAtan2(cmsContext ContextID, cmsFloat64Number y, cmsFloat64N // Convert to spherical coordinates static -void ToSpherical(cmsContext ContextID, cmsSpherical* sp, const cmsVEC3* v) +void ToSpherical(cmsSpherical* sp, const cmsVEC3* v) { cmsFloat64Number L, a, b; @@ -132,21 +131,20 @@ void ToSpherical(cmsContext ContextID, cmsSpherical* sp, const cmsVEC3* v) return; } - sp ->alpha = _cmsAtan2(ContextID, a, b); - sp ->theta = _cmsAtan2(ContextID, sqrt(a*a + b*b), L); + sp ->alpha = _cmsAtan2(a, b); + sp ->theta = _cmsAtan2(sqrt(a*a + b*b), L); } // Convert to cartesian from spherical static -void ToCartesian(cmsContext ContextID, cmsVEC3* v, const cmsSpherical* sp) +void ToCartesian(cmsVEC3* v, const cmsSpherical* sp) { cmsFloat64Number sin_alpha; cmsFloat64Number cos_alpha; cmsFloat64Number sin_theta; cmsFloat64Number cos_theta; cmsFloat64Number L, a, b; - cmsUNUSED_PARAMETER(ContextID); sin_alpha = sin((M_PI * sp ->alpha) / 180.0); cos_alpha = cos((M_PI * sp ->alpha) / 180.0); @@ -166,9 +164,8 @@ void ToCartesian(cmsContext ContextID, cmsVEC3* v, const cmsSpherical* sp) // Quantize sector of a spherical coordinate. Saturate 360, 180 to last sector // The limits are the centers of each sector, so static -void QuantizeToSector(cmsContext ContextID, const cmsSpherical* sp, int* alpha, int* theta) +void QuantizeToSector(const cmsSpherical* sp, int* alpha, int* theta) { - cmsUNUSED_PARAMETER(ContextID); *alpha = (int) floor(((sp->alpha * (SECTORS)) / 360.0) ); *theta = (int) floor(((sp->theta * (SECTORS)) / 180.0) ); @@ -193,9 +190,8 @@ void LineOf2Points(cmsContext ContextID, cmsLine* line, cmsVEC3* a, cmsVEC3* b) // Evaluate parametric line static -void GetPointOfLine(cmsContext ContextID, cmsVEC3* p, const cmsLine* line, cmsFloat64Number t) +void GetPointOfLine(cmsVEC3* p, const cmsLine* line, cmsFloat64Number t) { - cmsUNUSED_PARAMETER(ContextID); p ->n[VX] = line ->a.n[VX] + t * line->u.n[VX]; p ->n[VY] = line ->a.n[VY] + t * line->u.n[VY]; p ->n[VZ] = line ->a.n[VZ] + t * line->u.n[VZ]; @@ -292,7 +288,7 @@ cmsBool ClosestLineToLine(cmsContext ContextID, cmsVEC3* r, const cmsLine* line1 sc = (fabs(sN) < MATRIX_DET_TOLERANCE ? 0.0 : sN / sD); //tc = (fabs(tN) < MATRIX_DET_TOLERANCE ? 0.0 : tN / tD); // left for future use. - GetPointOfLine(ContextID, r, line1, sc); + GetPointOfLine(r, line1, sc); return TRUE; } @@ -335,7 +331,7 @@ cmsGDBPoint* GetPoint(cmsContext ContextID, cmsGDB* gbd, const cmsCIELab* Lab, c _cmsVEC3init(ContextID, &v, Lab ->L - 50.0, Lab ->a, Lab ->b); // Convert to spherical coordinates - ToSpherical(ContextID, sp, &v); + ToSpherical(sp, &v); if (sp ->r < 0 || sp ->alpha < 0 || sp->theta < 0) { cmsSignalError(ContextID, cmsERROR_RANGE, "spherical value out of range"); @@ -343,7 +339,7 @@ cmsGDBPoint* GetPoint(cmsContext ContextID, cmsGDB* gbd, const cmsCIELab* Lab, c } // On which sector it falls? - QuantizeToSector(ContextID, sp, &alpha, &theta); + QuantizeToSector(sp, &alpha, &theta); if (alpha < 0 || theta < 0 || alpha >= SECTORS || theta >= SECTORS) { cmsSignalError(ContextID, cmsERROR_RANGE, " quadrant out of range"); @@ -438,13 +434,12 @@ const struct _spiral { #define NSTEPS (sizeof(Spiral) / sizeof(struct _spiral)) static -int FindNearSectors(cmsContext ContextID, cmsGDB* gbd, int alpha, int theta, cmsGDBPoint* Close[]) +int FindNearSectors(cmsGDB* gbd, int alpha, int theta, cmsGDBPoint* Close[]) { int nSectors = 0; int a, t; cmsUInt32Number i; cmsGDBPoint* pt; - cmsUNUSED_PARAMETER(ContextID); for (i=0; i < NSTEPS; i++) { @@ -489,7 +484,7 @@ cmsBool InterpolateMissingSector(cmsContext ContextID, cmsGDB* gbd, int alpha, i if (gbd ->Gamut[theta][alpha].Type != GP_EMPTY) return TRUE; // Fill close points - nCloseSectors = FindNearSectors(ContextID, gbd, alpha, theta, Close); + nCloseSectors = FindNearSectors(gbd, alpha, theta, Close); // Find a central point on the sector @@ -498,7 +493,7 @@ cmsBool InterpolateMissingSector(cmsContext ContextID, cmsGDB* gbd, int alpha, i sp.r = 50.0; // Convert to Cartesian - ToCartesian(ContextID, &Lab, &sp); + ToCartesian(&Lab, &sp); // Create a ray line from centre to this point _cmsVEC3init(ContextID, &Centre, 50.0, 0, 0); @@ -516,8 +511,8 @@ cmsBool InterpolateMissingSector(cmsContext ContextID, cmsGDB* gbd, int alpha, i cmsVEC3 temp, a1, a2; // A line from sector to sector - ToCartesian(ContextID, &a1, &Close[k]->p); - ToCartesian(ContextID, &a2, &Close[m]->p); + ToCartesian(&a1, &Close[k]->p); + ToCartesian(&a2, &Close[m]->p); LineOf2Points(ContextID, &edge, &a1, &a2); @@ -525,7 +520,7 @@ cmsBool InterpolateMissingSector(cmsContext ContextID, cmsGDB* gbd, int alpha, i ClosestLineToLine(ContextID, &temp, &ray, &edge); // Convert to spherical - ToSpherical(ContextID, &templ, &temp); + ToSpherical(&templ, &temp); if ( templ.r > closel.r && diff --git a/lcms2mt/src/cmstypes.c b/lcms2mt/src/cmstypes.c index 62e92b4d8..9b21c39c2 100644 --- a/lcms2mt/src/cmstypes.c +++ b/lcms2mt/src/cmstypes.c @@ -166,7 +166,7 @@ typedef cmsBool (* PositionTableEntryFn)(cmsContext ContextID, struct _cms_typeh cmsUInt32Number SizeOfTag); // Helper function to deal with position tables as described in ICC spec 4.3 -// A table of n elements is readed, where first comes n records containing offsets and sizes and +// A table of n elements is read, where first comes n records containing offsets and sizes and // then a block containing the data itself. This allows to reuse same data in more than one entry static cmsBool ReadPositionTable(cmsContext ContextID, struct _cms_typehandler_struct* self, @@ -1001,7 +1001,7 @@ cmsBool Type_Text_Description_Write(cmsContext ContextID, struct _cms_typehandl len = cmsMLUgetASCII(ContextID, mlu, cmsNoLanguage, cmsNoCountry, NULL, 0); // Specification ICC.1:2001-04 (v2.4.0): It has been found that textDescriptionType can contain misaligned data - //(see clause 4.1 for the definition of “aligned”). Because the Unicode language + //(see clause 4.1 for the definition of 'aligned'). Because the Unicode language // code and Unicode count immediately follow the ASCII description, their // alignment is not correct if the ASCII count is not a multiple of four. The // ScriptCode code is misaligned when the ASCII count is odd. Profile reading and @@ -1517,7 +1517,7 @@ void *Type_MLU_Read(cmsContext ContextID, struct _cms_typehandler_struct* self, // True begin of the string BeginOfThisString = Offset - SizeOfHeader - 8; - // Ajust to wchar_t elements + // Adjust to wchar_t elements mlu ->Entries[i].Len = (Len * sizeof(wchar_t)) / sizeof(cmsUInt16Number); mlu ->Entries[i].StrW = (BeginOfThisString * sizeof(wchar_t)) / sizeof(cmsUInt16Number); @@ -1761,10 +1761,9 @@ cmsBool Write8bitTables(cmsContext ContextID, cmsIOHANDLER* io, cmsUInt32Number // Check overflow static -cmsUInt32Number uipow(cmsContext ContextID, cmsUInt32Number n, cmsUInt32Number a, cmsUInt32Number b) +cmsUInt32Number uipow(cmsUInt32Number n, cmsUInt32Number a, cmsUInt32Number b) { cmsUInt32Number rv = 1, rc; - cmsUNUSED_PARAMETER(ContextID); if (a == 0) return 0; if (n == 0) return 0; @@ -1841,7 +1840,7 @@ void *Type_LUT8_Read(cmsContext ContextID, struct _cms_typehandler_struct* self, if (!Read8bitTables(ContextID, io, NewLUT, InputChannels)) goto Error; // Get 3D CLUT. Check the overflow.... - nTabSize = uipow(ContextID, OutputChannels, CLUTpoints, InputChannels); + nTabSize = uipow(OutputChannels, CLUTpoints, InputChannels); if (nTabSize == (cmsUInt32Number) -1) goto Error; if (nTabSize > 0) { @@ -1974,7 +1973,7 @@ cmsBool Type_LUT8_Write(cmsContext ContextID, struct _cms_typehandler_struct* s // The prelinearization table if (!Write8bitTables(ContextID, io, NewLUT ->InputChannels, PreMPE)) return FALSE; - nTabSize = uipow(ContextID, NewLUT->OutputChannels, clutPoints, NewLUT ->InputChannels); + nTabSize = uipow(NewLUT->OutputChannels, clutPoints, NewLUT ->InputChannels); if (nTabSize == (cmsUInt32Number) -1) return FALSE; if (nTabSize > 0) { @@ -2085,8 +2084,6 @@ cmsBool Write16bitTables(cmsContext ContextID, cmsIOHANDLER* io, _cmsStageToneCu } } return TRUE; - - cmsUNUSED_PARAMETER(ContextID); } static @@ -2145,7 +2142,7 @@ void *Type_LUT16_Read(cmsContext ContextID, struct _cms_typehandler_struct* self if (!Read16bitTables(ContextID, io, NewLUT, InputChannels, InputEntries)) goto Error; // Get 3D CLUT - nTabSize = uipow(ContextID, OutputChannels, CLUTpoints, InputChannels); + nTabSize = uipow(OutputChannels, CLUTpoints, InputChannels); if (nTabSize == (cmsUInt32Number) -1) goto Error; if (nTabSize > 0) { @@ -2291,7 +2288,7 @@ cmsBool Type_LUT16_Write(cmsContext ContextID, struct _cms_typehandler_struct* } } - nTabSize = uipow(ContextID, OutputChannels, clutPoints, InputChannels); + nTabSize = uipow(OutputChannels, clutPoints, InputChannels); if (nTabSize == (cmsUInt32Number) -1) return FALSE; if (nTabSize > 0) { // The 3D CLUT. @@ -2462,7 +2459,7 @@ cmsToneCurve* ReadEmbeddedCurve(cmsContext ContextID, struct _cms_typehandler_st { char String[5]; - _cmsTagSignature2String(ContextID, String, (cmsTagSignature) BaseType); + _cmsTagSignature2String(String, (cmsTagSignature) BaseType); cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown curve type '%s'", String); } return NULL; @@ -2669,7 +2666,7 @@ cmsBool WriteSetOfCurves(cmsContext ContextID, struct _cms_typehandler_struct* s { char String[5]; - _cmsTagSignature2String(ContextID, String, (cmsTagSignature) Type); + _cmsTagSignature2String(String, (cmsTagSignature) Type); cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown curve type '%s'", String); } return FALSE; @@ -3139,10 +3136,10 @@ void Type_ColorantTable_Free(cmsContext ContextID, struct _cms_typehandler_struc //The namedColor2Type is a count value and array of structures that provide color //coordinates for 7-bit ASCII color names. For each named color, a PCS and optional //device representation of the color are given. Both representations are 16-bit values. -//The device representation corresponds to the header’s “color space of data” field. -//This representation should be consistent with the “number of device components” +//The device representation corresponds to the header's 'color space of data' field. +//This representation should be consistent with the 'number of device components' //field in the namedColor2Type. If this field is 0, device coordinates are not provided. -//The PCS representation corresponds to the header’s PCS field. The PCS representation +//The PCS representation corresponds to the header's PCS field. The PCS representation //is always provided. Color names are fixed-length, 32-byte fields including null //termination. In order to maintain maximum portability, it is strongly recommended //that special characters of the 7-bit ASCII set not be used. @@ -3896,7 +3893,7 @@ void Type_Screening_Free(cmsContext ContextID, struct _cms_typehandler_struct* s // ******************************************************************************** // //This type represents a set of viewing condition parameters including: -//CIE ’absolute’ illuminant white point tristimulus values and CIE ’absolute’ +//CIE 'absolute' illuminant white point tristimulus values and CIE 'absolute' //surround tristimulus values. static @@ -3986,7 +3983,7 @@ void GenericMPEfree(cmsContext ContextID, struct _cms_typehandler_struct* self, } // Each curve is stored in one or more curve segments, with break-points specified between curve segments. -// The first curve segment always starts at –Infinity, and the last curve segment always ends at +Infinity. The +// The first curve segment always starts at -Infinity, and the last curve segment always ends at +Infinity. The // first and last curve segments shall be specified in terms of a formula, whereas the other segments shall be // specified either in terms of a formula, or by a sampled curve. @@ -4076,7 +4073,7 @@ cmsToneCurve* ReadSegmentedCurve(cmsContext ContextID, struct _cms_typehandler_s { char String[5]; - _cmsTagSignature2String(ContextID, String, (cmsTagSignature) ElementSig); + _cmsTagSignature2String(String, (cmsTagSignature) ElementSig); cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown curve element type '%s' found.", String); } goto Error; @@ -4268,7 +4265,7 @@ cmsBool Type_MPEcurve_Write(cmsContext ContextID, struct _cms_typehandler_struc // The matrix is organized as an array of PxQ+Q elements, where P is the number of input channels to the // matrix, and Q is the number of output channels. The matrix elements are each float32Numbers. The array // is organized as follows: -// array = [e11, e12, …, e1P, e21, e22, …, e2P, …, eQ1, eQ2, …, eQP, e1, e2, …, eQ] +// array = [e11, e12, ..., e1P, e21, e22, ..., e2P, ..., eQ1, eQ2, ..., eQP, e1, e2, ..., eQ] static void *Type_MPEmatrix_Read(cmsContext ContextID, struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) @@ -4500,7 +4497,7 @@ cmsBool ReadMPEElem(cmsContext ContextID, struct _cms_typehandler_struct* self, char String[5]; - _cmsTagSignature2String(ContextID, String, (cmsTagSignature) ElementSig); + _cmsTagSignature2String(String, (cmsTagSignature) ElementSig); // An unknown element was found. cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown MPE type '%s' found.", String); @@ -4619,7 +4616,7 @@ cmsBool Type_MPE_Write(cmsContext ContextID, struct _cms_typehandler_struct* sel char String[5]; - _cmsTagSignature2String(ContextID, String, (cmsTagSignature) ElementSig); + _cmsTagSignature2String(String, (cmsTagSignature) ElementSig); // An unknown element was found. cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Found unknown MPE type '%s'", String); @@ -4794,10 +4791,10 @@ void *Type_vcgt_Read(cmsContext ContextID, struct _cms_typehandler_struct* self, // Y = cX + f | X < d // vcgt formula is: - // Y = (Max – Min) * (X ^ Gamma) + Min + // Y = (Max - Min) * (X ^ Gamma) + Min // So, the translation is - // a = (Max – Min) ^ ( 1 / Gamma) + // a = (Max - Min) ^ ( 1 / Gamma) // e = Min // b=c=d=f=0 @@ -5102,10 +5099,9 @@ cmsBool ReadOneWChar(cmsContext ContextID, cmsIOHANDLER* io, _cmsDICelem* e, cm } static -cmsUInt32Number mywcslen(cmsContext ContextID, const wchar_t *s) +cmsUInt32Number mywcslen(const wchar_t *s) { const wchar_t *p; - cmsUNUSED_PARAMETER(ContextID); p = s; while (*p) @@ -5128,7 +5124,7 @@ cmsBool WriteOneWChar(cmsContext ContextID, cmsIOHANDLER* io, _cmsDICelem* e, c return TRUE; } - n = mywcslen(ContextID, wcstr); + n = mywcslen(wcstr); if (!_cmsWriteWCharArray(ContextID, io, n, wcstr)) return FALSE; e ->Sizes[i] = io ->Tell(ContextID, io) - Before; diff --git a/lcms2mt/src/cmsvirt.c b/lcms2mt/src/cmsvirt.c index f6c34f536..fbb3756ff 100644 --- a/lcms2mt/src/cmsvirt.c +++ b/lcms2mt/src/cmsvirt.c @@ -96,7 +96,7 @@ Error: // This function creates a profile based on White point, primaries and // transfer functions. -cmsHPROFILE CMSEXPORT cmsCreateRGBProfileTHR(cmsContext ContextID, +cmsHPROFILE CMSEXPORT cmsCreateRGBProfile(cmsContext ContextID, const cmsCIExyY* WhitePoint, const cmsCIExyYTRIPLE* Primaries, cmsToneCurve* const TransferFunction[3]) @@ -212,17 +212,10 @@ Error: return NULL; } -cmsHPROFILE CMSEXPORT cmsCreateRGBProfile(const cmsCIExyY* WhitePoint, - const cmsCIExyYTRIPLE* Primaries, - cmsToneCurve* const TransferFunction[3]) -{ - return cmsCreateRGBProfileTHR(NULL, WhitePoint, Primaries, TransferFunction); -} - // This function creates a profile based on White point and transfer function. -cmsHPROFILE CMSEXPORT cmsCreateGrayProfileTHR(cmsContext ContextID, +cmsHPROFILE CMSEXPORT cmsCreateGrayProfile(cmsContext ContextID, const cmsCIExyY* WhitePoint, const cmsToneCurve* TransferFunction) { @@ -275,15 +268,10 @@ Error: -cmsHPROFILE CMSEXPORT cmsCreateGrayProfile(const cmsCIExyY* WhitePoint, - const cmsToneCurve* TransferFunction) -{ - return cmsCreateGrayProfileTHR(NULL, WhitePoint, TransferFunction); -} // This is a devicelink operating in the target colorspace with as many transfer functions as components -cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID, +cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLink(cmsContext ContextID, cmsColorSpaceSignature ColorSpace, cmsToneCurve* const TransferFunctions[]) { @@ -335,12 +323,6 @@ Error: return NULL; } -cmsHPROFILE CMSEXPORT cmsCreateLinearizationDeviceLink(cmsColorSpaceSignature ColorSpace, - cmsToneCurve* const TransferFunctions[]) -{ - return cmsCreateLinearizationDeviceLinkTHR(NULL, ColorSpace, TransferFunctions); -} - // Ink-limiting algorithm // // Sum = C + M + Y + K @@ -389,7 +371,7 @@ int InkLimitingSampler(cmsContext ContextID, register const cmsUInt16Number In[] // This is a devicelink operating in CMYK for ink-limiting -cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLinkTHR(cmsContext ContextID, +cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLink(cmsContext ContextID, cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit) { @@ -463,19 +445,14 @@ Error: return NULL; } -cmsHPROFILE CMSEXPORT cmsCreateInkLimitingDeviceLink(cmsColorSpaceSignature ColorSpace, cmsFloat64Number Limit) -{ - return cmsCreateInkLimitingDeviceLinkTHR(NULL, ColorSpace, Limit); -} - // Creates a fake Lab identity. -cmsHPROFILE CMSEXPORT cmsCreateLab2ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint) +cmsHPROFILE CMSEXPORT cmsCreateLab2Profile(cmsContext ContextID, const cmsCIExyY* WhitePoint) { cmsHPROFILE hProfile; cmsPipeline* LUT = NULL; - hProfile = cmsCreateRGBProfileTHR(ContextID, WhitePoint == NULL ? cmsD50_xyY(ContextID) : WhitePoint, NULL, NULL); + hProfile = cmsCreateRGBProfile(ContextID, WhitePoint == NULL ? cmsD50_xyY(ContextID) : WhitePoint, NULL, NULL); if (hProfile == NULL) return NULL; cmsSetProfileVersion(ContextID, hProfile, 2.1); @@ -510,19 +487,14 @@ Error: } -cmsHPROFILE CMSEXPORT cmsCreateLab2Profile(const cmsCIExyY* WhitePoint) -{ - return cmsCreateLab2ProfileTHR(NULL, WhitePoint); -} - // Creates a fake Lab V4 identity. -cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint) +cmsHPROFILE CMSEXPORT cmsCreateLab4Profile(cmsContext ContextID, const cmsCIExyY* WhitePoint) { cmsHPROFILE hProfile; cmsPipeline* LUT = NULL; - hProfile = cmsCreateRGBProfileTHR(ContextID, WhitePoint == NULL ? cmsD50_xyY(ContextID) : WhitePoint, NULL, NULL); + hProfile = cmsCreateRGBProfile(ContextID, WhitePoint == NULL ? cmsD50_xyY(ContextID) : WhitePoint, NULL, NULL); if (hProfile == NULL) return NULL; cmsSetProfileVersion(ContextID, hProfile, 4.3); @@ -556,19 +528,14 @@ Error: return NULL; } -cmsHPROFILE CMSEXPORT cmsCreateLab4Profile(const cmsCIExyY* WhitePoint) -{ - return cmsCreateLab4ProfileTHR(NULL, WhitePoint); -} - // Creates a fake XYZ identity -cmsHPROFILE CMSEXPORT cmsCreateXYZProfileTHR(cmsContext ContextID) +cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(cmsContext ContextID) { cmsHPROFILE hProfile; cmsPipeline* LUT = NULL; - hProfile = cmsCreateRGBProfileTHR(ContextID, cmsD50_xyY(ContextID), NULL, NULL); + hProfile = cmsCreateRGBProfile(ContextID, cmsD50_xyY(ContextID), NULL, NULL); if (hProfile == NULL) return NULL; cmsSetProfileVersion(ContextID, hProfile, 4.3); @@ -603,26 +570,21 @@ Error: } -cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(void) -{ - return cmsCreateXYZProfileTHR(NULL); -} - //sRGB Curves are defined by: // -//If R’sRGB,G’sRGB, B’sRGB < 0.04045 +//If R'sRGB,G'sRGB, B'sRGB < 0.04045 // -// R = R’sRGB / 12.92 -// G = G’sRGB / 12.92 -// B = B’sRGB / 12.92 +// R = R'sRGB / 12.92 +// G = G'sRGB / 12.92 +// B = B'sRGB / 12.92 // // -//else if R’sRGB,G’sRGB, B’sRGB >= 0.04045 +//else if R'sRGB,G'sRGB, B'sRGB >= 0.04045 // -// R = ((R’sRGB + 0.055) / 1.055)^2.4 -// G = ((G’sRGB + 0.055) / 1.055)^2.4 -// B = ((B’sRGB + 0.055) / 1.055)^2.4 +// R = ((R'sRGB + 0.055) / 1.055)^2.4 +// G = ((G'sRGB + 0.055) / 1.055)^2.4 +// B = ((B'sRGB + 0.055) / 1.055)^2.4 static cmsToneCurve* Build_sRGBGamma(cmsContext ContextID) @@ -639,7 +601,7 @@ cmsToneCurve* Build_sRGBGamma(cmsContext ContextID) } // Create the ICC virtual profile for sRGB space -cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID) +cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(cmsContext ContextID) { cmsCIExyY D65 = { 0.3127, 0.3290, 1.0 }; cmsCIExyYTRIPLE Rec709Primaries = { @@ -654,7 +616,7 @@ cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID) Gamma22[0] = Gamma22[1] = Gamma22[2] = Build_sRGBGamma(ContextID); if (Gamma22[0] == NULL) return NULL; - hsRGB = cmsCreateRGBProfileTHR(ContextID, &D65, &Rec709Primaries, Gamma22); + hsRGB = cmsCreateRGBProfile(ContextID, &D65, &Rec709Primaries, Gamma22); cmsFreeToneCurve(ContextID, Gamma22[0]); if (hsRGB == NULL) return NULL; @@ -666,11 +628,6 @@ cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID) return hsRGB; } -cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfile(void) -{ - return cmsCreate_sRGBProfileTHR(NULL); -} - typedef struct { @@ -724,14 +681,14 @@ int bchswSampler(cmsContext ContextID, register const cmsUInt16Number In[], regi // Creates an abstract profile operating in Lab space for Brightness, // contrast, Saturation and white point displacement -cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID, - cmsUInt32Number nLUTPoints, - cmsFloat64Number Bright, - cmsFloat64Number Contrast, - cmsFloat64Number Hue, - cmsFloat64Number Saturation, - cmsUInt32Number TempSrc, - cmsUInt32Number TempDest) +cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(cmsContext ContextID, + cmsUInt32Number nLUTPoints, + cmsFloat64Number Bright, + cmsFloat64Number Contrast, + cmsFloat64Number Hue, + cmsFloat64Number Saturation, + cmsUInt32Number TempSrc, + cmsUInt32Number TempDest) { cmsHPROFILE hICC; cmsPipeline* Pipeline; @@ -810,21 +767,10 @@ Error: } -CMSAPI cmsHPROFILE CMSEXPORT cmsCreateBCHSWabstractProfile(cmsUInt32Number nLUTPoints, - cmsFloat64Number Bright, - cmsFloat64Number Contrast, - cmsFloat64Number Hue, - cmsFloat64Number Saturation, - cmsUInt32Number TempSrc, - cmsUInt32Number TempDest) -{ - return cmsCreateBCHSWabstractProfileTHR(NULL, nLUTPoints, Bright, Contrast, Hue, Saturation, TempSrc, TempDest); -} - // Creates a fake NULL profile. This profile return 1 channel as always 0. // Is useful only for gamut checking tricks -cmsHPROFILE CMSEXPORT cmsCreateNULLProfileTHR(cmsContext ContextID) +cmsHPROFILE CMSEXPORT cmsCreateNULLProfile(cmsContext ContextID) { cmsHPROFILE hProfile; cmsPipeline* LUT = NULL; @@ -882,11 +828,6 @@ Error: return NULL; } -cmsHPROFILE CMSEXPORT cmsCreateNULLProfile(void) -{ - return cmsCreateNULLProfileTHR(NULL); -} - static int IsPCS(cmsColorSpaceSignature ColorSpace) @@ -934,6 +875,8 @@ void FixColorSpaces(cmsContext ContextID, cmsHPROFILE hProfile, cmsSetPCS(ContextID, hProfile, PCS); } + + // This function creates a named color profile dumping all the contents of transform to a single profile // In this way, LittleCMS may be used to "group" several named color databases into a single profile. // It has, however, several minor limitations. PCS is always Lab, which is not very critic since this @@ -945,8 +888,8 @@ cmsHPROFILE CreateNamedColorDevicelink(cmsContext ContextID, cmsHTRANSFORM xform cmsHPROFILE hICC = NULL; cmsUInt32Number i, nColors; cmsNAMEDCOLORLIST *nc2 = NULL, *Original = NULL; - cmsFormatter16 FromInput, ToOutput; cmsUInt32Number InputFormat, OutputFormat; + cmsFormatter16 FromInput, ToOutput; // Create an empty placeholder hICC = cmsCreateProfilePlaceholder(ContextID); @@ -1128,15 +1071,15 @@ cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsContext ContextID, cmsHTRANSFOR cmsSetProfileVersion(ContextID, hProfile, Version); - FixColorSpaces(ContextID, hProfile, xform->core->EntryColorSpace, xform->core->ExitColorSpace, dwFlags); + FixColorSpaces(ContextID, hProfile, xform ->core->EntryColorSpace, xform ->core->ExitColorSpace, dwFlags); // Optimize the LUT and precalculate a devicelink - ChansIn = cmsChannelsOf(ContextID, xform->core->EntryColorSpace); - ChansOut = cmsChannelsOf(ContextID, xform->core->ExitColorSpace); + ChansIn = cmsChannelsOf(ContextID, xform ->core->EntryColorSpace); + ChansOut = cmsChannelsOf(ContextID, xform ->core->ExitColorSpace); - ColorSpaceBitsIn = _cmsLCMScolorSpace(ContextID, xform->core->EntryColorSpace); - ColorSpaceBitsOut = _cmsLCMScolorSpace(ContextID, xform->core->ExitColorSpace); + ColorSpaceBitsIn = _cmsLCMScolorSpace(ContextID, xform ->core->EntryColorSpace); + ColorSpaceBitsOut = _cmsLCMScolorSpace(ContextID, xform ->core->ExitColorSpace); FrmIn = COLORSPACE_SH(ColorSpaceBitsIn) | CHANNELS_SH(ChansIn)|BYTES_SH(2); FrmOut = COLORSPACE_SH(ColorSpaceBitsOut) | CHANNELS_SH(ChansOut)|BYTES_SH(2); @@ -1209,8 +1152,8 @@ cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsContext ContextID, cmsHTRANSFOR if (!cmsWriteTag(ContextID, hProfile, cmsSigColorantTableOutTag, xform->core->OutputColorant)) goto Error; } - if ((deviceClass == cmsSigLinkClass) && (xform->core->Sequence != NULL)) { - if (!_cmsWriteProfileSequence(ContextID, hProfile, xform->core->Sequence)) goto Error; + if ((deviceClass == cmsSigLinkClass) && (xform ->core->Sequence != NULL)) { + if (!_cmsWriteProfileSequence(ContextID, hProfile, xform ->core->Sequence)) goto Error; } // Set the white point @@ -1218,7 +1161,7 @@ cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsContext ContextID, cmsHTRANSFOR if (!cmsWriteTag(ContextID, hProfile, cmsSigMediaWhitePointTag, &xform->core->EntryWhitePoint)) goto Error; } else { - if (!cmsWriteTag(ContextID, hProfile, cmsSigMediaWhitePointTag, &xform->core->ExitWhitePoint)) goto Error; + if (!cmsWriteTag(ContextID, hProfile, cmsSigMediaWhitePointTag, &xform ->core->ExitWhitePoint)) goto Error; } diff --git a/lcms2mt/src/cmsxform.c b/lcms2mt/src/cmsxform.c index 1b3498469..e80cc6dc8 100644 --- a/lcms2mt/src/cmsxform.c +++ b/lcms2mt/src/cmsxform.c @@ -53,8 +53,9 @@ void _cmsAllocAdaptationStateChunk(struct _cmsContext_struct* ctx, // Sets adaptation state for absolute colorimetric intent in the given context. Adaptation state applies on all -// but cmsCreateExtendedTransformTHR(). Little CMS can handle incomplete adaptation states. -cmsFloat64Number CMSEXPORT cmsSetAdaptationStateTHR(cmsContext ContextID, cmsFloat64Number d) +// but cmsCreateExtendedTransform(). Little CMS can handle incomplete adaptation states. +// The adaptation state may be defaulted by this function. If you don't like it, use the extended transform routine +cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsContext ContextID, cmsFloat64Number d) { cmsFloat64Number prev; _cmsAdaptationStateChunkType* ptr = (_cmsAdaptationStateChunkType*) _cmsContextGetClientChunk(ContextID, AdaptationStateContext); @@ -73,12 +74,6 @@ cmsFloat64Number CMSEXPORT cmsSetAdaptationStateTHR(cmsContext ContextID, cmsFlo } -// The adaptation state may be defaulted by this function. If you don't like it, use the extended transform routine -cmsFloat64Number CMSEXPORT cmsSetAdaptationState(cmsFloat64Number d) -{ - return cmsSetAdaptationStateTHR(NULL, d); -} - // ----------------------------------------------------------------------- // Alarm codes for 16-bit transformations, because the fixed range of containers there are @@ -90,7 +85,7 @@ _cmsAlarmCodesChunkType _cmsAlarmCodesChunk = { DEFAULT_ALARM_CODES_VALUE }; // Sets the codes used to mark out-out-gamut on Proofing transforms for a given context. Values are meant to be // encoded in 16 bits. -void CMSEXPORT cmsSetAlarmCodesTHR(cmsContext ContextID, const cmsUInt16Number AlarmCodesP[cmsMAXCHANNELS]) +void CMSEXPORT cmsSetAlarmCodes(cmsContext ContextID, const cmsUInt16Number AlarmCodesP[cmsMAXCHANNELS]) { _cmsAlarmCodesChunkType* ContextAlarmCodes = (_cmsAlarmCodesChunkType*) _cmsContextGetClientChunk(ContextID, AlarmCodesContext); @@ -101,7 +96,7 @@ void CMSEXPORT cmsSetAlarmCodesTHR(cmsContext ContextID, const cmsUInt16Number A // Gets the current codes used to mark out-out-gamut on Proofing transforms for the given context. // Values are meant to be encoded in 16 bits. -void CMSEXPORT cmsGetAlarmCodesTHR(cmsContext ContextID, cmsUInt16Number AlarmCodesP[cmsMAXCHANNELS]) +void CMSEXPORT cmsGetAlarmCodes(cmsContext ContextID, cmsUInt16Number AlarmCodesP[cmsMAXCHANNELS]) { _cmsAlarmCodesChunkType* ContextAlarmCodes = (_cmsAlarmCodesChunkType*) _cmsContextGetClientChunk(ContextID, AlarmCodesContext); @@ -110,19 +105,6 @@ void CMSEXPORT cmsGetAlarmCodesTHR(cmsContext ContextID, cmsUInt16Number AlarmCo memcpy(AlarmCodesP, ContextAlarmCodes->AlarmCodes, sizeof(ContextAlarmCodes->AlarmCodes)); } -void CMSEXPORT cmsSetAlarmCodes(const cmsUInt16Number NewAlarm[cmsMAXCHANNELS]) -{ - _cmsAssert(NewAlarm != NULL); - - cmsSetAlarmCodesTHR(NULL, NewAlarm); -} - -void CMSEXPORT cmsGetAlarmCodes(cmsUInt16Number OldAlarm[cmsMAXCHANNELS]) -{ - _cmsAssert(OldAlarm != NULL); - cmsGetAlarmCodesTHR(NULL, OldAlarm); -} - // Init and duplicate alarm codes void _cmsAllocAlarmCodesChunk(struct _cmsContext_struct* ctx, @@ -355,7 +337,7 @@ void NullFloatXFORM(cmsContext ContextID, _cmsTRANSFORM* p, // 16 bit precision ----------------------------------------------------------------------------------------------------------- -// Null transformation, only applies formatters. No caché +// Null transformation, only applies formatters. No cache static void NullXFORM(cmsContext ContextID, _cmsTRANSFORM* p, @@ -411,6 +393,7 @@ void PrecalculatedXFORMIdentity(cmsContext ContextID, cmsUInt32Number bppi = Stride->BytesPerPlaneIn; cmsUInt32Number bppo = Stride->BytesPerPlaneOut; int bpp; + cmsUNUSED_PARAMETER(ContextID); /* Silence some warnings */ (void)bppi; @@ -457,12 +440,12 @@ void TransformOnePixelWithGamutCheck(cmsContext ContextID, _cmsTRANSFORM* p, core->Lut->Eval16Fn(ContextID, wIn, wOut, core->Lut->Data); } -// Gamut check, No caché, 16 bits. +// Gamut check, No cache, 16 bits. #define FUNCTION_NAME PrecalculatedXFORMGamutCheck #define GAMUTCHECK #include "extra_xform.h" -// No gamut check, Caché, 16 bits, +// No gamut check, Cache, 16 bits, #define FUNCTION_NAME CachedXFORM #define CACHED #include "extra_xform.h" @@ -976,16 +959,16 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number } if (dwFlags & cmsFLAGS_NOCACHE) { if (dwFlags & cmsFLAGS_GAMUTCHECK) - p ->xform = PrecalculatedXFORMGamutCheck; // Gamut check, no cach<E9> + p ->xform = PrecalculatedXFORMGamutCheck; // Gamut check, no cache else if ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) && _cmsLutIsIdentity(p->core->Lut)) p ->xform = PrecalculatedXFORMIdentity; else - p ->xform = PrecalculatedXFORM; // No cach<E9>, no gamut check + p ->xform = PrecalculatedXFORM; // No cache, no gamut check return; } if (dwFlags & cmsFLAGS_GAMUTCHECK) { - p ->xform = CachedXFORMGamutCheck; // Gamut check, cach<E9> + p ->xform = CachedXFORMGamutCheck; // Gamut check, cache return; } if ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) && @@ -994,7 +977,7 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number return; } if (T_EXTRA(InputFormat) != 0) { - p ->xform = CachedXFORM; // No gamut check, cach<E9> + p ->xform = CachedXFORM; // No gamut check, cache return; } if ((InputFormat & ~(COLORSPACE_SH(31)|CHANNELS_SH(7)|BYTES_SH(3))) == 0 && @@ -1064,7 +1047,7 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number else if (inwords <= 4) p ->xform = CachedXFORM8; else - p ->xform = CachedXFORM; // No gamut check, cach<E9> + p ->xform = CachedXFORM; // No gamut check, cache } } @@ -1157,7 +1140,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut, p ->xform = NullFloatXFORM; } else { - // Float transforms don't use caché, always are non-NULL + // Float transforms don't use cache, always are non-NULL p ->xform = FloatXFORM; } @@ -1272,9 +1255,8 @@ cmsBool IsProperColorSpace(cmsContext ContextID, cmsColorSpaceSignature Check, // with the media white (media black?) x 100. Add a sanity check static -void NormalizeXYZ(cmsContext ContextID, cmsCIEXYZ* Dest) +void NormalizeXYZ(cmsCIEXYZ* Dest) { - cmsUNUSED_PARAMETER(ContextID); while (Dest -> X > 2. && Dest -> Y > 2. && Dest -> Z > 2.) { @@ -1286,7 +1268,7 @@ void NormalizeXYZ(cmsContext ContextID, cmsCIEXYZ* Dest) } static -void SetWhitePoint(cmsContext ContextID, cmsCIEXYZ* wtPt, const cmsCIEXYZ* src) +void SetWhitePoint(cmsCIEXYZ* wtPt, const cmsCIEXYZ* src) { if (src == NULL) { wtPt ->X = cmsD50X; @@ -1298,7 +1280,7 @@ void SetWhitePoint(cmsContext ContextID, cmsCIEXYZ* wtPt, const cmsCIEXYZ* src) wtPt ->Y = src->Y; wtPt ->Z = src->Z; - NormalizeXYZ(ContextID, wtPt); + NormalizeXYZ(wtPt); } } @@ -1381,8 +1363,8 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, xform->core->RenderingIntent = Intents[nProfiles-1]; // Take white points - SetWhitePoint(ContextID, &xform->core->EntryWhitePoint, (cmsCIEXYZ*) cmsReadTag(ContextID, hProfiles[0], cmsSigMediaWhitePointTag)); - SetWhitePoint(ContextID, &xform->core->ExitWhitePoint, (cmsCIEXYZ*) cmsReadTag(ContextID, hProfiles[nProfiles-1], cmsSigMediaWhitePointTag)); + SetWhitePoint(&xform->core->EntryWhitePoint, (cmsCIEXYZ*) cmsReadTag(ContextID, hProfiles[0], cmsSigMediaWhitePointTag)); + SetWhitePoint(&xform->core->ExitWhitePoint, (cmsCIEXYZ*) cmsReadTag(ContextID, hProfiles[nProfiles-1], cmsSigMediaWhitePointTag)); // Create a gamut check LUT if requested @@ -1445,7 +1427,7 @@ cmsHTRANSFORM CMSEXPORT cmsCreateExtendedTransform(cmsContext ContextID, } // Multiprofile transforms: Gamut check is not available here, as it is unclear from which profile the gamut comes. -cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext ContextID, +cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsContext ContextID, cmsHPROFILE hProfiles[], cmsUInt32Number nProfiles, cmsUInt32Number InputFormat, @@ -1466,7 +1448,7 @@ cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext ContextID, for (i=0; i < nProfiles; i++) { BPC[i] = dwFlags & cmsFLAGS_BLACKPOINTCOMPENSATION ? TRUE : FALSE; Intents[i] = Intent; - AdaptationStates[i] = cmsSetAdaptationStateTHR(ContextID, -1); + AdaptationStates[i] = cmsSetAdaptationState(ContextID, -1); } @@ -1475,34 +1457,13 @@ cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransformTHR(cmsContext ContextID, -cmsHTRANSFORM CMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[], - cmsUInt32Number nProfiles, - cmsUInt32Number InputFormat, - cmsUInt32Number OutputFormat, - cmsUInt32Number Intent, - cmsUInt32Number dwFlags) -{ - - if (nProfiles <= 0 || nProfiles > 255) { - cmsSignalError(NULL, cmsERROR_RANGE, "Wrong number of profiles. 1..255 expected, %d found.", nProfiles); - return NULL; - } - - return cmsCreateMultiprofileTransformTHR(NULL, hProfiles, - nProfiles, - InputFormat, - OutputFormat, - Intent, - dwFlags); -} - -cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID, - cmsHPROFILE Input, - cmsUInt32Number InputFormat, - cmsHPROFILE Output, - cmsUInt32Number OutputFormat, - cmsUInt32Number Intent, - cmsUInt32Number dwFlags) +cmsHTRANSFORM CMSEXPORT cmsCreateTransform(cmsContext ContextID, + cmsHPROFILE Input, + cmsUInt32Number InputFormat, + cmsHPROFILE Output, + cmsUInt32Number OutputFormat, + cmsUInt32Number Intent, + cmsUInt32Number dwFlags) { cmsHPROFILE hArray[2]; @@ -1510,21 +1471,11 @@ cmsHTRANSFORM CMSEXPORT cmsCreateTransformTHR(cmsContext ContextID, hArray[0] = Input; hArray[1] = Output; - return cmsCreateMultiprofileTransformTHR(ContextID, hArray, Output == NULL ? 1U : 2U, InputFormat, OutputFormat, Intent, dwFlags); -} - -CMSAPI cmsHTRANSFORM CMSEXPORT cmsCreateTransform(cmsHPROFILE Input, - cmsUInt32Number InputFormat, - cmsHPROFILE Output, - cmsUInt32Number OutputFormat, - cmsUInt32Number Intent, - cmsUInt32Number dwFlags) -{ - return cmsCreateTransformTHR(NULL, Input, InputFormat, Output, OutputFormat, Intent, dwFlags); + return cmsCreateMultiprofileTransform(ContextID, hArray, Output == NULL ? 1U : 2U, InputFormat, OutputFormat, Intent, dwFlags); } -cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext ContextID, +cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransform(cmsContext ContextID, cmsHPROFILE InputProfile, cmsUInt32Number InputFormat, cmsHPROFILE OutputProfile, @@ -1545,10 +1496,10 @@ cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext ContextID, Intents[0] = nIntent; Intents[1] = nIntent; Intents[2] = INTENT_RELATIVE_COLORIMETRIC; Intents[3] = ProofingIntent; BPC[0] = DoBPC; BPC[1] = DoBPC; BPC[2] = 0; BPC[3] = 0; - Adaptation[0] = Adaptation[1] = Adaptation[2] = Adaptation[3] = cmsSetAdaptationStateTHR(ContextID, -1); + Adaptation[0] = Adaptation[1] = Adaptation[2] = Adaptation[3] = cmsSetAdaptationState(ContextID, -1); if (!(dwFlags & (cmsFLAGS_SOFTPROOFING|cmsFLAGS_GAMUTCHECK))) - return cmsCreateTransformTHR(ContextID, InputProfile, InputFormat, OutputProfile, OutputFormat, nIntent, dwFlags); + return cmsCreateTransform(ContextID, InputProfile, InputFormat, OutputProfile, OutputFormat, nIntent, dwFlags); return cmsCreateExtendedTransform(ContextID, 4, hArray, BPC, Intents, Adaptation, ProofingProfile, 1, InputFormat, OutputFormat, dwFlags); @@ -1556,26 +1507,6 @@ cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransformTHR(cmsContext ContextID, } -cmsHTRANSFORM CMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile, - cmsUInt32Number InputFormat, - cmsHPROFILE OutputProfile, - cmsUInt32Number OutputFormat, - cmsHPROFILE ProofingProfile, - cmsUInt32Number nIntent, - cmsUInt32Number ProofingIntent, - cmsUInt32Number dwFlags) -{ - return cmsCreateProofingTransformTHR(NULL, - InputProfile, - InputFormat, - OutputProfile, - OutputFormat, - ProofingProfile, - nIntent, - ProofingIntent, - dwFlags); -} - // Grab the input/output formats cmsUInt32Number CMSEXPORT cmsGetTransformInputFormat(cmsContext ContextID, cmsHTRANSFORM hTransform) diff --git a/lcms2mt/src/extra_xform.h b/lcms2mt/src/extra_xform.h index e9e57da67..e42a81daa 100644 --- a/lcms2mt/src/extra_xform.h +++ b/lcms2mt/src/extra_xform.h @@ -264,7 +264,7 @@ void FUNCTION_NAME(cmsContext ContextID, evalGamut(ContextID, currIn, &wOutOfGamut, core->GamutCheck->Data); if (wOutOfGamut >= 1) /* RJW: Could be faster? copy once to a local buffer? */ - cmsGetAlarmCodes(wOut); + cmsGetAlarmCodes(ContextID, wOut); else #endif /* FLOAT_XFORM */ #endif /* GAMUTCHECK */ diff --git a/lcms2mt/src/lcms2_internal.h b/lcms2mt/src/lcms2_internal.h index 7d8db6722..ec6039587 100644 --- a/lcms2mt/src/lcms2_internal.h +++ b/lcms2mt/src/lcms2_internal.h @@ -88,6 +88,13 @@ # define cmsINLINE static inline #endif +// Allow signed overflow, we know this is harmless in this particular context +#if defined(__clang__) +# define CMS_NO_SANITIZE __attribute__((no_sanitize("signed-integer-overflow"))) +#else +# define CMS_NO_SANITIZE +#endif + // Other replacement functions #ifdef _MSC_VER # ifndef snprintf @@ -184,6 +191,8 @@ cmsINLINE cmsUInt16Number _cmsQuickSaturateWord(cmsFloat64Number d) return _cmsQuickFloorWord(d); } +// Test bed entry points--------------------------------------------------------------- +#define CMSCHECKPOINT CMSAPI // Pthread support -------------------------------------------------------------------- #ifndef CMS_NO_PTHREADS @@ -816,14 +825,14 @@ cmsTagDescriptor* _cmsGetTagDescriptor(cmsContext ContextID, cmsTagSignature // Error logging --------------------------------------------------------------------------------------------------------- -void _cmsTagSignature2String(cmsContext ContextID, char String[5], cmsTagSignature sig); +void _cmsTagSignature2String(char String[5], cmsTagSignature sig); // Interpolation --------------------------------------------------------------------------------------------------------- -cmsInterpParams* _cmsComputeInterpParams(cmsContext ContextID, cmsUInt32Number nSamples, cmsUInt32Number InputChan, cmsUInt32Number OutputChan, const void* Table, cmsUInt32Number dwFlags); -cmsInterpParams* _cmsComputeInterpParamsEx(cmsContext ContextID, const cmsUInt32Number nSamples[], cmsUInt32Number InputChan, cmsUInt32Number OutputChan, const void* Table, cmsUInt32Number dwFlags); -void _cmsFreeInterpParams(cmsContext ContextID, cmsInterpParams* p); -cmsBool _cmsSetInterpolationRoutine(cmsContext ContextID, cmsInterpParams* p); +CMSCHECKPOINT cmsInterpParams* CMSEXPORT _cmsComputeInterpParams(cmsContext ContextID, cmsUInt32Number nSamples, cmsUInt32Number InputChan, cmsUInt32Number OutputChan, const void* Table, cmsUInt32Number dwFlags); +cmsInterpParams* _cmsComputeInterpParamsEx(cmsContext ContextID, const cmsUInt32Number nSamples[], cmsUInt32Number InputChan, cmsUInt32Number OutputChan, const void* Table, cmsUInt32Number dwFlags); +CMSCHECKPOINT void CMSEXPORT _cmsFreeInterpParams(cmsContext ContextID, cmsInterpParams* p); +cmsBool _cmsSetInterpolationRoutine(cmsContext ContextID, cmsInterpParams* p); // Curves ---------------------------------------------------------------------------------------------------------------- @@ -871,20 +880,20 @@ struct _cmsStage_struct { // Special Stages (cannot be saved) -cmsStage* _cmsStageAllocLab2XYZ(cmsContext ContextID); -cmsStage* _cmsStageAllocXYZ2Lab(cmsContext ContextID); -cmsStage* _cmsStageAllocLabPrelin(cmsContext ContextID); -cmsStage* _cmsStageAllocLabV2ToV4(cmsContext ContextID); -cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID); -cmsStage* _cmsStageAllocLabV4ToV2(cmsContext ContextID); -cmsStage* _cmsStageAllocNamedColor(cmsContext ContextID, cmsNAMEDCOLORLIST* NamedColorList, cmsBool UsePCS); -cmsStage* _cmsStageAllocIdentityCurves(cmsContext ContextID, cmsUInt32Number nChannels); -cmsStage* _cmsStageAllocIdentityCLut(cmsContext ContextID, cmsUInt32Number nChan); -cmsStage* _cmsStageNormalizeFromLabFloat(cmsContext ContextID); -cmsStage* _cmsStageNormalizeFromXyzFloat(cmsContext ContextID); -cmsStage* _cmsStageNormalizeToLabFloat(cmsContext ContextID); -cmsStage* _cmsStageNormalizeToXyzFloat(cmsContext ContextID); -cmsStage* _cmsStageClipNegatives(cmsContext ContextID, cmsUInt32Number nChannels); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocLab2XYZ(cmsContext ContextID); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocXYZ2Lab(cmsContext ContextID); +cmsStage* _cmsStageAllocLabPrelin(cmsContext ContextID); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocLabV2ToV4(cmsContext ContextID); +cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocLabV4ToV2(cmsContext ContextID); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocNamedColor(cmsContext ContextID, cmsNAMEDCOLORLIST* NamedColorList, cmsBool UsePCS); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocIdentityCurves(cmsContext ContextID, cmsUInt32Number nChannels); +CMSCHECKPOINT cmsStage* CMSEXPORT _cmsStageAllocIdentityCLut(cmsContext ContextID, cmsUInt32Number nChan); +cmsStage* _cmsStageNormalizeFromLabFloat(cmsContext ContextID); +cmsStage* _cmsStageNormalizeFromXyzFloat(cmsContext ContextID); +cmsStage* _cmsStageNormalizeToLabFloat(cmsContext ContextID); +cmsStage* _cmsStageNormalizeToXyzFloat(cmsContext ContextID); +cmsStage* _cmsStageClipNegatives(cmsContext ContextID, cmsUInt32Number nChannels); // For curve set only @@ -917,9 +926,9 @@ struct _cmsPipeline_struct { // Read tags using low-level function, provide necessary glue code to adapt versions, etc. All those return a brand new copy // of the LUTS, since ownership of original is up to the profile. The user should free allocated resources. -cmsPipeline* _cmsReadInputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent); -cmsPipeline* _cmsReadOutputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent); -cmsPipeline* _cmsReadDevicelinkLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent); +CMSCHECKPOINT cmsPipeline* CMSEXPORT _cmsReadInputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent); +CMSCHECKPOINT cmsPipeline* CMSEXPORT _cmsReadOutputLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent); +CMSCHECKPOINT cmsPipeline* CMSEXPORT _cmsReadDevicelinkLUT(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent); // Special values cmsBool _cmsReadMediaWhitePoint(cmsContext ContextID, cmsCIEXYZ* Dest, cmsHPROFILE hProfile); @@ -944,7 +953,7 @@ cmsSEQ* _cmsCompileProfileSequence(cmsContext ContextID, cmsUInt32Number nProfil // LUT optimization ------------------------------------------------------------------------------------------------ -cmsUInt16Number _cmsQuantizeVal(cmsFloat64Number i, cmsUInt32Number MaxSamples); +CMSCHECKPOINT cmsUInt16Number CMSEXPORT _cmsQuantizeVal(cmsFloat64Number i, cmsUInt32Number MaxSamples); cmsUInt32Number _cmsReasonableGridpointsByColorspace(cmsContext ContextID, cmsColorSpaceSignature Colorspace, cmsUInt32Number dwFlags); cmsBool _cmsEndPointsBySpace(cmsColorSpaceSignature Space, @@ -979,17 +988,17 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID, cmsBool _cmsFormatterIsFloat(cmsUInt32Number Type); cmsBool _cmsFormatterIs8bit(cmsUInt32Number Type); -cmsFormatter _cmsGetFormatter(cmsContext ContextID, - cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 - cmsFormatterDirection Dir, - cmsUInt32Number dwFlags); +CMSCHECKPOINT cmsFormatter CMSEXPORT _cmsGetFormatter(cmsContext ContextID, + cmsUInt32Number Type, // Specific type, i.e. TYPE_RGB_8 + cmsFormatterDirection Dir, + cmsUInt32Number dwFlags); #ifndef CMS_NO_HALF_SUPPORT // Half float -cmsFloat32Number _cmsHalf2Float(cmsUInt16Number h); -cmsUInt16Number _cmsFloat2Half(cmsFloat32Number flt); +CMSCHECKPOINT cmsFloat32Number CMSEXPORT _cmsHalf2Float(cmsUInt16Number h); +CMSCHECKPOINT cmsUInt16Number CMSEXPORT _cmsFloat2Half(cmsFloat32Number flt); #endif diff --git a/lcms2mt/src/lcms2mt.def b/lcms2mt/src/lcms2mt.def index d614a2229..f329f596e 100644 --- a/lcms2mt/src/lcms2mt.def +++ b/lcms2mt/src/lcms2mt.def @@ -1,4 +1,4 @@ -LIBRARY LCMS2.DLL +LIBRARY LCMS2MT.DLL EXPORTS @@ -29,33 +29,20 @@ cmsCloseIOhandler = cmsCloseIOhandler cmsCloseProfile = cmsCloseProfile cmsCMCdeltaE = cmsCMCdeltaE cmsCreate_sRGBProfile = cmsCreate_sRGBProfile -cmsCreate_sRGBProfileTHR = cmsCreate_sRGBProfileTHR cmsCreateBCHSWabstractProfile = cmsCreateBCHSWabstractProfile -cmsCreateBCHSWabstractProfileTHR = cmsCreateBCHSWabstractProfileTHR cmsCreateExtendedTransform = cmsCreateExtendedTransform cmsCreateGrayProfile = cmsCreateGrayProfile -cmsCreateGrayProfileTHR = cmsCreateGrayProfileTHR cmsCreateInkLimitingDeviceLink = cmsCreateInkLimitingDeviceLink -cmsCreateInkLimitingDeviceLinkTHR = cmsCreateInkLimitingDeviceLinkTHR cmsCreateLab2Profile = cmsCreateLab2Profile -cmsCreateLab2ProfileTHR = cmsCreateLab2ProfileTHR cmsCreateLab4Profile = cmsCreateLab4Profile -cmsCreateLab4ProfileTHR = cmsCreateLab4ProfileTHR cmsCreateLinearizationDeviceLink = cmsCreateLinearizationDeviceLink -cmsCreateLinearizationDeviceLinkTHR = cmsCreateLinearizationDeviceLinkTHR cmsCreateMultiprofileTransform = cmsCreateMultiprofileTransform -cmsCreateMultiprofileTransformTHR = cmsCreateMultiprofileTransformTHR cmsCreateNULLProfile = cmsCreateNULLProfile -cmsCreateNULLProfileTHR = cmsCreateNULLProfileTHR cmsCreateProfilePlaceholder = cmsCreateProfilePlaceholder cmsCreateProofingTransform = cmsCreateProofingTransform -cmsCreateProofingTransformTHR = cmsCreateProofingTransformTHR cmsCreateRGBProfile = cmsCreateRGBProfile -cmsCreateRGBProfileTHR = cmsCreateRGBProfileTHR cmsCreateTransform = cmsCreateTransform -cmsCreateTransformTHR = cmsCreateTransformTHR cmsCreateXYZProfile = cmsCreateXYZProfile -cmsCreateXYZProfileTHR = cmsCreateXYZProfileTHR cmsD50_xyY = cmsD50_xyY cmsD50_XYZ = cmsD50_XYZ _cmsDecodeDateTimeNumber = _cmsDecodeDateTimeNumber @@ -234,12 +221,8 @@ cmsOpenIOhandlerFromMem = cmsOpenIOhandlerFromMem cmsOpenIOhandlerFromNULL = cmsOpenIOhandlerFromNULL cmsOpenIOhandlerFromStream = cmsOpenIOhandlerFromStream cmsOpenProfileFromFile = cmsOpenProfileFromFile -cmsOpenProfileFromFileTHR = cmsOpenProfileFromFileTHR -cmsOpenProfileFromIOhandlerTHR = cmsOpenProfileFromIOhandlerTHR cmsOpenProfileFromMem = cmsOpenProfileFromMem -cmsOpenProfileFromMemTHR = cmsOpenProfileFromMemTHR cmsOpenProfileFromStream = cmsOpenProfileFromStream -cmsOpenProfileFromStreamTHR = cmsOpenProfileFromStreamTHR cmsPlugin = cmsPlugin _cmsRead15Fixed16Number = _cmsRead15Fixed16Number _cmsReadAlignment = _cmsReadAlignment @@ -305,7 +288,6 @@ cmsXYZ2xyY = cmsXYZ2xyY cmsXYZEncoded2Float = cmsXYZEncoded2Float cmsSliceSpace16 = cmsSliceSpace16 cmsSliceSpaceFloat = cmsSliceSpaceFloat -cmsChangeBuffersFormat = cmsChangeBuffersFormat cmsCloneTransformChangingFormats = cmsCloneTransformChangingFormats cmsDictAlloc = cmsDictAlloc cmsDictFree = cmsDictFree @@ -318,19 +300,12 @@ _cmsSetTransformUserData = _cmsSetTransformUserData _cmsGetTransformFormatters16 = _cmsGetTransformFormatters16 _cmsGetTransformFormattersFloat = _cmsGetTransformFormattersFloat cmsGetHeaderCreator = cmsGetHeaderCreator -cmsPluginTHR = cmsPluginTHR cmsGetTransformInputFormat = cmsGetTransformInputFormat cmsGetTransformOutputFormat = cmsGetTransformOutputFormat cmsCreateContext = cmsCreateContext cmsDupContext = cmsDupContext cmsDeleteContext = cmsDeleteContext cmsGetContextUserData = cmsGetContextUserData -cmsUnregisterPluginsTHR = cmsUnregisterPluginsTHR -cmsSetAlarmCodesTHR = cmsSetAlarmCodesTHR -cmsGetAlarmCodesTHR = cmsGetAlarmCodesTHR -cmsSetAdaptationStateTHR = cmsSetAdaptationStateTHR -cmsSetLogErrorHandlerTHR = cmsSetLogErrorHandlerTHR -cmsGetSupportedIntentsTHR = cmsGetSupportedIntentsTHR cmsMLUtranslationsCount = cmsMLUtranslationsCount cmsMLUtranslationsCodes = cmsMLUtranslationsCodes _cmsCreateMutex = _cmsCreateMutex diff --git a/lcms2mt/testbed/Makefile.am b/lcms2mt/testbed/Makefile.am index 85e87119a..50e343984 100644 --- a/lcms2mt/testbed/Makefile.am +++ b/lcms2mt/testbed/Makefile.am @@ -12,7 +12,7 @@ check_PROGRAMS = testcms # CFLAGS = --pedantic -Wall -std=c99 -O2 # The testsuite binary is statically linked. This is necessary as it uses some -# of the internal funtions that are not necessarily exported by the shared +# of the internal functions that are not necessarily exported by the shared # library. testcms_LDADD = $(top_builddir)/src/liblcms2.la testcms_LDFLAGS = -static @LDFLAGS@ diff --git a/lcms2mt/testbed/Makefile.in b/lcms2mt/testbed/Makefile.in index 857709324..efc8c2b85 100644 --- a/lcms2mt/testbed/Makefile.in +++ b/lcms2mt/testbed/Makefile.in @@ -330,7 +330,7 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/ # CFLAGS = --pedantic -Wall -std=c99 -O2 # The testsuite binary is statically linked. This is necessary as it uses some -# of the internal funtions that are not necessarily exported by the shared +# of the internal functions that are not necessarily exported by the shared # library. testcms_LDADD = $(top_builddir)/src/liblcms2.la testcms_LDFLAGS = -static @LDFLAGS@ diff --git a/lcms2mt/testbed/testcms2.c b/lcms2mt/testbed/testcms2.c index 84728c8eb..025c79ab7 100644 --- a/lcms2mt/testbed/testcms2.c +++ b/lcms2mt/testbed/testcms2.c @@ -70,7 +70,7 @@ void Die(const char* Reason, ...) // maximum requested as a single block and maximum allocated at a given time. Results are printed at the end static cmsUInt32Number SingleHit, MaxAllocated=0, TotalMemory=0; -// I'm hidding the size before the block. This is a well-known technique and probably the blocks coming from +// I'm hiding the size before the block. This is a well-known technique and probably the blocks coming from // malloc are built in a way similar to that, but I do on my own to be portable. typedef struct { cmsUInt32Number KeepSize; @@ -254,9 +254,9 @@ void FatalErrorQuit(cmsContext ContextID, cmsUInt32Number ErrorCode, const char } -void ResetFatalError(void) +void ResetFatalError(cmsContext ContextID) { - cmsSetLogErrorHandler(FatalErrorQuit); + cmsSetLogErrorHandler(ContextID, FatalErrorQuit); } @@ -375,7 +375,7 @@ cmsHPROFILE Create_AboveRGB(void) Curve[0] = Curve[1] = Curve[2] = cmsBuildGamma(DbgThread(), 2.19921875); cmsWhitePointFromTemp(DbgThread(), &D65, 6504); - hProfile = cmsCreateRGBProfileTHR(DbgThread(), &D65, &Primaries, Curve); + hProfile = cmsCreateRGBProfile(DbgThread(), &D65, &Primaries, Curve); cmsFreeToneCurve(DbgThread(), Curve[0]); return hProfile; @@ -389,7 +389,7 @@ cmsHPROFILE Create_Gray22(void) cmsToneCurve* Curve = cmsBuildGamma(DbgThread(), 2.2); if (Curve == NULL) return NULL; - hProfile = cmsCreateGrayProfileTHR(DbgThread(), cmsD50_xyY(DbgThread()), Curve); + hProfile = cmsCreateGrayProfile(DbgThread(), cmsD50_xyY(DbgThread()), Curve); cmsFreeToneCurve(DbgThread(), Curve); return hProfile; @@ -403,7 +403,7 @@ cmsHPROFILE Create_Gray30(void) cmsToneCurve* Curve = cmsBuildGamma(DbgThread(), 3.0); if (Curve == NULL) return NULL; - hProfile = cmsCreateGrayProfileTHR(DbgThread(), cmsD50_xyY(DbgThread()), Curve); + hProfile = cmsCreateGrayProfile(DbgThread(), cmsD50_xyY(DbgThread()), Curve); cmsFreeToneCurve(DbgThread(), Curve); return hProfile; @@ -417,7 +417,7 @@ cmsHPROFILE Create_GrayLab(void) cmsToneCurve* Curve = cmsBuildGamma(DbgThread(), 1.0); if (Curve == NULL) return NULL; - hProfile = cmsCreateGrayProfileTHR(DbgThread(), cmsD50_xyY(DbgThread()), Curve); + hProfile = cmsCreateGrayProfile(DbgThread(), cmsD50_xyY(DbgThread()), Curve); cmsFreeToneCurve(DbgThread(), Curve); cmsSetPCS(DbgThread(), hProfile, cmsSigLabData); @@ -438,7 +438,7 @@ cmsHPROFILE Create_CMYK_DeviceLink(void) Tab[2] = Curve; Tab[3] = Curve; - hProfile = cmsCreateLinearizationDeviceLinkTHR(DbgThread(), cmsSigCmykData, Tab); + hProfile = cmsCreateLinearizationDeviceLink(DbgThread(), cmsSigCmykData, Tab); if (hProfile == NULL) return NULL; cmsFreeToneCurve(DbgThread(), Curve); @@ -448,7 +448,7 @@ cmsHPROFILE Create_CMYK_DeviceLink(void) // Create a fake CMYK profile, without any other requeriment that being coarse CMYK. -// DONT USE THIS PROFILE FOR ANYTHING, IT IS USELESS BUT FOR TESTING PURPOSES. +// DON'T USE THIS PROFILE FOR ANYTHING, IT IS USELESS BUT FOR TESTING PURPOSES. typedef struct { cmsHTRANSFORM hLab2sRGB; @@ -542,21 +542,21 @@ cmsHPROFILE CreateFakeCMYK(cmsFloat64Number InkLimit, cmsBool lUseAboveRGB) cmsHPROFILE hLab, hsRGB, hLimit; cmsUInt32Number cmykfrm; + ContextID = DbgThread(); if (lUseAboveRGB) hsRGB = Create_AboveRGB(); else - hsRGB = cmsCreate_sRGBProfile(); + hsRGB = cmsCreate_sRGBProfile(ContextID); - hLab = cmsCreateLab4Profile(NULL); - hLimit = cmsCreateInkLimitingDeviceLink(cmsSigCmykData, InkLimit); + hLab = cmsCreateLab4Profile(ContextID, NULL); + hLimit = cmsCreateInkLimitingDeviceLink(ContextID, cmsSigCmykData, InkLimit); cmykfrm = FLOAT_SH(1) | BYTES_SH(0)|CHANNELS_SH(4); - p.hLab2sRGB = cmsCreateTransform(hLab, TYPE_Lab_16, hsRGB, TYPE_RGB_DBL, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); - p.sRGB2Lab = cmsCreateTransform(hsRGB, TYPE_RGB_DBL, hLab, TYPE_Lab_16, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); - p.hIlimit = cmsCreateTransform(hLimit, cmykfrm, NULL, TYPE_CMYK_16, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); + p.hLab2sRGB = cmsCreateTransform(ContextID, hLab, TYPE_Lab_16, hsRGB, TYPE_RGB_DBL, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); + p.sRGB2Lab = cmsCreateTransform(ContextID, hsRGB, TYPE_RGB_DBL, hLab, TYPE_Lab_16, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); + p.hIlimit = cmsCreateTransform(ContextID, hLimit, cmykfrm, NULL, TYPE_CMYK_16, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE); - ContextID = DbgThread(); cmsCloseProfile(ContextID, hLab); cmsCloseProfile(ContextID, hsRGB); cmsCloseProfile(ContextID, hLimit); hICC = cmsCreateProfilePlaceholder(ContextID); @@ -618,7 +618,7 @@ cmsInt32Number OneVirtual(cmsHPROFILE h, const char* SubTestTxt, const char* Fil if (!cmsSaveProfileToFile(DbgThread(), h, FileName)) return 0; cmsCloseProfile(DbgThread(), h); - h = cmsOpenProfileFromFile( FileName, "r"); + h = cmsOpenProfileFromFile(DbgThread(), FileName, "r"); if (h == NULL) return 0; cmsCloseProfile(DbgThread(), h); @@ -634,7 +634,7 @@ cmsInt32Number CreateTestProfiles(void) { cmsHPROFILE h; - h = cmsCreate_sRGBProfileTHR(DbgThread()); + h = cmsCreate_sRGBProfile(DbgThread()); if (!OneVirtual(h, "sRGB profile", "sRGBlcms2.icc")) return 0; // ---- @@ -663,33 +663,33 @@ cmsInt32Number CreateTestProfiles(void) if (!OneVirtual(h, "Linearization profile", "linlcms2.icc")) return 0; // ------- - h = cmsCreateInkLimitingDeviceLinkTHR(DbgThread(), cmsSigCmykData, 150); + h = cmsCreateInkLimitingDeviceLink(DbgThread(), cmsSigCmykData, 150); if (h == NULL) return 0; if (!OneVirtual(h, "Ink-limiting profile", "limitlcms2.icc")) return 0; // ------ - h = cmsCreateLab2ProfileTHR(DbgThread(), NULL); + h = cmsCreateLab2Profile(DbgThread(), NULL); if (!OneVirtual(h, "Lab 2 identity profile", "labv2lcms2.icc")) return 0; // ---- - h = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + h = cmsCreateLab4Profile(DbgThread(), NULL); if (!OneVirtual(h, "Lab 4 identity profile", "labv4lcms2.icc")) return 0; // ---- - h = cmsCreateXYZProfileTHR(DbgThread()); + h = cmsCreateXYZProfile(DbgThread()); if (!OneVirtual(h, "XYZ identity profile", "xyzlcms2.icc")) return 0; // ---- - h = cmsCreateNULLProfileTHR(DbgThread()); + h = cmsCreateNULLProfile(DbgThread()); if (!OneVirtual(h, "NULL profile", "nullcms2.icc")) return 0; // --- - h = cmsCreateBCHSWabstractProfileTHR(DbgThread(), 17, 0, 0, 0, 0, 5000, 6000); + h = cmsCreateBCHSWabstractProfile(DbgThread(), 17, 0, 0, 0, 0, 5000, 6000); if (!OneVirtual(h, "BCHS profile", "bchslcms2.icc")) return 0; // --- @@ -699,7 +699,7 @@ cmsInt32Number CreateTestProfiles(void) // --- - h = cmsCreateBCHSWabstractProfileTHR(DbgThread(), 17, 0, 1.2, 0, 3, 5000, 5000); + h = cmsCreateBCHSWabstractProfile(DbgThread(), 17, 0, 1.2, 0, 3, 5000, 5000); if (!OneVirtual(h, "Brightness", "brightness.icc")) return 0; return 1; } @@ -759,7 +759,7 @@ cmsInt32Number CheckBaseTypes(void) // Are we little or big endian? From Harbison&Steele. static -cmsInt32Number CheckEndianess(void) +cmsInt32Number CheckEndianness(void) { cmsInt32Number BigEndian, IsOk; union { @@ -1593,7 +1593,7 @@ cmsInt32Number CheckReverseInterpolation3x3(void) return (max <= FLOAT_PRECISSION); Error: - cmsPipelineFree(Lut); + cmsPipelineFree(DbgThread(), Lut); return 0; } @@ -1695,7 +1695,7 @@ cmsInt32Number CheckReverseInterpolation4x3(void) return (max <= FLOAT_PRECISSION); Error: - cmsPipelineFree(Lut); + cmsPipelineFree(DbgThread(), Lut); return 0; } @@ -3633,7 +3633,7 @@ cmsInt32Number CheckMLU(void) // Check profile IO - h = cmsOpenProfileFromFileTHR(DbgThread(), "mlucheck.icc", "w"); + h = cmsOpenProfileFromFile(DbgThread(), "mlucheck.icc", "w"); cmsSetProfileVersion(DbgThread(), h, 4.3); @@ -3642,9 +3642,9 @@ cmsInt32Number CheckMLU(void) cmsMLUfree(DbgThread(), mlu2); - h = cmsOpenProfileFromFileTHR(DbgThread(), "mlucheck.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "mlucheck.icc", "r"); - mlu3 = cmsReadTag(DbgThread(), h, cmsSigProfileDescriptionTag); + mlu3 = (cmsMLU *) cmsReadTag(DbgThread(), h, cmsSigProfileDescriptionTag); if (mlu3 == NULL) { Fail("Profile didn't get the MLU\n"); rc = 0; goto Error; } // Check all is still in place @@ -3720,15 +3720,15 @@ cmsInt32Number CheckNamedColorList(void) if (strcmp(Name, CheckName) != 0) {rc = 0; Fail("Invalid Name"); goto Error; }; } - h = cmsOpenProfileFromFileTHR(DbgThread(), "namedcol.icc", "w"); + h = cmsOpenProfileFromFile(DbgThread(), "namedcol.icc", "w"); if (h == NULL) return 0; if (!cmsWriteTag(DbgThread(), h, cmsSigNamedColor2Tag, nc)) return 0; cmsCloseProfile(DbgThread(), h); cmsFreeNamedColorList(DbgThread(), nc); nc = NULL; - h = cmsOpenProfileFromFileTHR(DbgThread(), "namedcol.icc", "r"); - nc2 = cmsReadTag(DbgThread(), h, cmsSigNamedColor2Tag); + h = cmsOpenProfileFromFile(DbgThread(), "namedcol.icc", "r"); + nc2 = (cmsNAMEDCOLORLIST *) cmsReadTag(DbgThread(), h, cmsSigNamedColor2Tag); if (cmsNamedColorCount(DbgThread(), nc2) != 4096) { rc = 0; Fail("Invalid count"); goto Error; } @@ -3813,9 +3813,9 @@ void CheckSingleFormatter16(cmsContext id, cmsUInt32Number Type, const char* Tex Values[i] <<= 8; } - b.Fmt16(DbgThread(), &info, Values, Buffer, 1); + b.Fmt16(DbgThread(), &info, Values, Buffer, 2); memset(Values, 0, sizeof(Values)); - f.Fmt16(DbgThread(), &info, Values, Buffer, 1); + f.Fmt16(DbgThread(), &info, Values, Buffer, 2); for (i=0; i < nChannels; i++) { if (bytes == 1) @@ -4208,11 +4208,12 @@ cmsInt32Number CheckOneRGB_double(cmsHTRANSFORM xform, cmsFloat64Number R, cmsFl static cmsInt32Number CheckChangeBufferFormat(void) { - cmsHPROFILE hsRGB = cmsCreate_sRGBProfile(); + cmsHPROFILE hsRGB = cmsCreate_sRGBProfile(DbgThread()); cmsHTRANSFORM xform; + cmsHTRANSFORM xform2; - xform = cmsCreateTransform(hsRGB, TYPE_RGB_16, hsRGB, TYPE_RGB_16, INTENT_PERCEPTUAL, 0); + xform = cmsCreateTransform(DbgThread(), hsRGB, TYPE_RGB_16, hsRGB, TYPE_RGB_16, INTENT_PERCEPTUAL, 0); cmsCloseProfile(DbgThread(), hsRGB); if (xform == NULL) return 0; @@ -4221,17 +4222,20 @@ cmsInt32Number CheckChangeBufferFormat(void) if (!CheckOneRGB(xform, 120, 0, 0, 120, 0, 0)) return 0; if (!CheckOneRGB(xform, 0, 222, 255, 0, 222, 255)) return 0; + xform2 = cmsCloneTransformChangingFormats(DbgThread(), xform, TYPE_BGR_16, TYPE_RGB_16); + if (!xform2) return 0; - if (!cmsChangeBuffersFormat(DbgThread(), xform, TYPE_BGR_16, TYPE_RGB_16)) return 0; + if (!CheckOneRGB(xform2, 0, 0, 123, 123, 0, 0)) return 0; + if (!CheckOneRGB(xform2, 154, 234, 0, 0, 234, 154)) return 0; - if (!CheckOneRGB(xform, 0, 0, 123, 123, 0, 0)) return 0; - if (!CheckOneRGB(xform, 154, 234, 0, 0, 234, 154)) return 0; + cmsDeleteTransform(DbgThread(),xform2); + xform2 = cmsCloneTransformChangingFormats(DbgThread(), xform, TYPE_RGB_DBL, TYPE_RGB_DBL); + if (!xform2) return 0; - if (!cmsChangeBuffersFormat(DbgThread(), 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; + if (!CheckOneRGB_double(xform2, 0.20, 0, 0, 0.20, 0, 0)) return 0; + if (!CheckOneRGB_double(xform2, 0, 0.9, 1, 0, 0.9, 1)) return 0; + cmsDeleteTransform(DbgThread(),xform2); cmsDeleteTransform(DbgThread(),xform); return 1; @@ -4254,7 +4258,7 @@ cmsInt32Number CheckXYZ(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSignatu return cmsWriteTag(DbgThread(), hProfile, tag, &XYZ); case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsCIEXYZ *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; return IsGoodFixed15_16("X", 1.0, Pt ->X) && IsGoodFixed15_16("Y", 1.1, Pt->Y) && @@ -4282,7 +4286,7 @@ cmsInt32Number CheckGamma(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSigna return rc; case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsToneCurve *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; return cmsIsToneCurveLinear(DbgThread(), Pt); @@ -4309,7 +4313,7 @@ cmsInt32Number CheckTextSingle(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTag return rc; case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsMLU *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; cmsMLUgetASCII(DbgThread(), Pt, cmsNoLanguage, cmsNoCountry, Buffer, 256); if (strcmp(Buffer, "Test test") != 0) return FALSE; @@ -4343,7 +4347,7 @@ cmsInt32Number CheckText(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSignat return rc; case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsMLU *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; cmsMLUgetASCII(DbgThread(), Pt, cmsNoLanguage, cmsNoCountry, Buffer, 256); if (strcmp(Buffer, "Test test") != 0) return FALSE; @@ -4377,7 +4381,7 @@ cmsInt32Number CheckData(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSigna return rc; case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsICCData *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; return (Pt ->data[0] == '?') && (Pt ->flag == 0) && (Pt ->len == 1); @@ -4395,11 +4399,11 @@ cmsInt32Number CheckSignature(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTag switch (Pass) { case 1: - Holder = cmsSigPerceptualReferenceMediumGamut; + Holder = (cmsTagSignature) cmsSigPerceptualReferenceMediumGamut; return cmsWriteTag(DbgThread(), hProfile, tag, &Holder); case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsTagSignature *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; return *Pt == cmsSigPerceptualReferenceMediumGamut; @@ -4427,7 +4431,7 @@ cmsInt32Number CheckDateTime(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagS return cmsWriteTag(DbgThread(), hProfile, tag, &Holder); case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (struct tm *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; return (Pt ->tm_hour == 1 && @@ -4478,7 +4482,7 @@ cmsInt32Number CheckNamedColor(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTa case 2: - nc = cmsReadTag(DbgThread(), hProfile, tag); + nc = (cmsNAMEDCOLORLIST *) cmsReadTag(DbgThread(), hProfile, tag); if (nc == NULL) return 0; for (i=0; i < max_check; i++) { @@ -4536,7 +4540,7 @@ cmsInt32Number CheckLUT(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSignat return rc; case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsPipeline *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; // Transform values, check for identity @@ -4561,7 +4565,7 @@ cmsInt32Number CheckCHAD(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSigna case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsFloat64Number *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; for (i=0; i < 9; i++) { @@ -4587,7 +4591,7 @@ cmsInt32Number CheckChromaticity(cmsInt32Number Pass, cmsHPROFILE hProfile, cms case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsCIExyYTRIPLE *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; if (!IsGoodFixed15_16("xyY", Pt ->Red.x, c.Red.x)) return 0; @@ -4618,7 +4622,7 @@ cmsInt32Number CheckColorantOrder(cmsInt32Number Pass, cmsHPROFILE hProfile, cm case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsUInt8Number *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; for (i=0; i < cmsMAXCHANNELS; i++) { @@ -4650,7 +4654,7 @@ cmsInt32Number CheckMeasurement(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsT case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsICCMeasurementConditions *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; if (!IsGoodFixed15_16("Backing", Pt ->Backing.X, 0.1)) return 0; @@ -4691,7 +4695,7 @@ cmsInt32Number CheckUcrBg(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSign case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsUcrBg *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; cmsMLUgetASCII(DbgThread(), Pt ->Desc, cmsNoLanguage, cmsNoCountry, Buffer, 256); @@ -4816,7 +4820,7 @@ cmsInt32Number CheckMPE(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTagSignat return rc; case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsPipeline *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; return CheckFloatLUT(Pt); @@ -4847,7 +4851,7 @@ cmsInt32Number CheckScreening(cmsInt32Number Pass, cmsHPROFILE hProfile, cmsTag case 2: - Pt = cmsReadTag(DbgThread(), hProfile, tag); + Pt = (cmsScreening *) cmsReadTag(DbgThread(), hProfile, tag); if (Pt == NULL) return 0; if (Pt ->nChannels != 1) return 0; @@ -4939,7 +4943,7 @@ cmsInt32Number CheckProfileSequenceTag(cmsInt32Number Pass, cmsHPROFILE hProfil case 2: - s = cmsReadTag(DbgThread(), hProfile, cmsSigProfileSequenceDescTag); + s = (cmsSEQ *) cmsReadTag(DbgThread(), hProfile, cmsSigProfileSequenceDescTag); if (s == NULL) return 0; if (s ->n != 3) return 0; @@ -5007,7 +5011,7 @@ cmsInt32Number CheckProfileSequenceIDTag(cmsInt32Number Pass, cmsHPROFILE hProf case 2: - s = cmsReadTag(DbgThread(), hProfile, cmsSigProfileSequenceIdTag); + s = (cmsSEQ *) cmsReadTag(DbgThread(), hProfile, cmsSigProfileSequenceIdTag); if (s == NULL) return 0; if (s ->n != 3) return 0; @@ -5050,7 +5054,7 @@ cmsInt32Number CheckICCViewingConditions(cmsInt32Number Pass, cmsHPROFILE hProf return 1; case 2: - v = cmsReadTag(DbgThread(), hProfile, cmsSigViewingConditionsTag); + v = (cmsICCViewingConditions *) cmsReadTag(DbgThread(), hProfile, cmsSigViewingConditionsTag); if (v == NULL) return 0; if (v ->IlluminantType != 1) return 0; @@ -5092,7 +5096,7 @@ cmsInt32Number CheckVCGT(cmsInt32Number Pass, cmsHPROFILE hProfile) case 2: - PtrCurve = cmsReadTag(DbgThread(), hProfile, cmsSigVcgtTag); + PtrCurve = (cmsToneCurve **) cmsReadTag(DbgThread(), hProfile, cmsSigVcgtTag); if (PtrCurve == NULL) return 0; if (!IsGoodVal("VCGT R", cmsEstimateGamma(DbgThread(), PtrCurve[0], 0.01), 1.1, 0.001)) return 0; if (!IsGoodVal("VCGT G", cmsEstimateGamma(DbgThread(), PtrCurve[1], 0.01), 2.2, 0.001)) return 0; @@ -5229,10 +5233,10 @@ cmsInt32Number CheckRAWtags(cmsInt32Number Pass, cmsHPROFILE hProfile) switch (Pass) { case 1: - return cmsWriteRawTag(DbgThread(), hProfile, 0x31323334, "data123", 7); + return cmsWriteRawTag(DbgThread(), hProfile, (cmsTagSignature) 0x31323334, "data123", 7); case 2: - if (!cmsReadRawTag(DbgThread(), hProfile, 0x31323334, Buffer, 7)) return 0; + if (!cmsReadRawTag(DbgThread(), hProfile, (cmsTagSignature) 0x31323334, Buffer, 7)) return 0; if (strncmp(Buffer, "data123", 7) != 0) return 0; return 1; @@ -5391,7 +5395,7 @@ cmsInt32Number CheckProfileCreation(void) if (Pass == 1) { cmsSaveProfileToFile(DbgThread(), h, "alltags.icc"); cmsCloseProfile(DbgThread(), h); - h = cmsOpenProfileFromFileTHR(DbgThread(), "alltags.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "alltags.icc", "r"); } } @@ -5410,7 +5414,7 @@ cmsInt32Number CheckProfileCreation(void) return 1; Error: - cmsCloseProfile(h); + cmsCloseProfile(DbgThread(), h); remove("alltags.icc"); return 0; } @@ -5439,7 +5443,7 @@ cmsInt32Number CheckVersionHeaderWriting(void) cmsSaveProfileToFile(DbgThread(), h, "versions.icc"); cmsCloseProfile(DbgThread(), h); - h = cmsOpenProfileFromFileTHR(DbgThread(), "versions.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "versions.icc", "r"); // Only the first 3 digits are significant if (fabs(cmsGetProfileVersion(DbgThread(), h) - test_versions[index]) > 0.005) { @@ -5463,9 +5467,9 @@ cmsInt32Number CheckMultilocalizedProfile(void) cmsMLU *Pt; char Buffer[256]; - hProfile = cmsOpenProfileFromFile( "crayons.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "crayons.icc", "r"); - Pt = cmsReadTag(DbgThread(), hProfile, cmsSigProfileDescriptionTag); + Pt = (cmsMLU *) cmsReadTag(DbgThread(), hProfile, cmsSigProfileDescriptionTag); cmsMLUgetASCII(DbgThread(), Pt, "en", "GB", Buffer, 256); if (strcmp(Buffer, "Crayon Colours") != 0) return FALSE; cmsMLUgetASCII(DbgThread(), Pt, "en", "US", Buffer, 256); @@ -5497,56 +5501,56 @@ cmsInt32Number CheckBadProfiles(void) { cmsHPROFILE h; - h = cmsOpenProfileFromFileTHR(DbgThread(), "IDoNotExist.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "IDoNotExist.icc", "r"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromFileTHR(DbgThread(), "IAmIllFormed*.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "IAmIllFormed*.icc", "r"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } // No profile name given - h = cmsOpenProfileFromFileTHR(DbgThread(), "", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "", "r"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromFileTHR(DbgThread(), "..", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "..", "r"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromFileTHR(DbgThread(), "IHaveBadAccessMode.icc", "@"); + h = cmsOpenProfileFromFile(DbgThread(), "IHaveBadAccessMode.icc", "@"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromFileTHR(DbgThread(), "bad.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "bad.icc", "r"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromFileTHR(DbgThread(), "toosmall.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "toosmall.icc", "r"); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromMemTHR(DbgThread(), NULL, 3); + h = cmsOpenProfileFromMem(DbgThread(), NULL, 3); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; } - h = cmsOpenProfileFromMemTHR(DbgThread(), "123", 3); + h = cmsOpenProfileFromMem(DbgThread(), "123", 3); if (h != NULL) { cmsCloseProfile(DbgThread(), h); return 0; @@ -5563,9 +5567,9 @@ cmsInt32Number CheckErrReportingOnBadProfiles(void) { cmsInt32Number rc; - cmsSetLogErrorHandler(ErrorReportingFunction); + cmsSetLogErrorHandler(DbgThread(), ErrorReportingFunction); rc = CheckBadProfiles(); - cmsSetLogErrorHandler(FatalErrorQuit); + cmsSetLogErrorHandler(DbgThread(), FatalErrorQuit); // Reset the error state TrappedError = FALSE; @@ -5576,10 +5580,10 @@ cmsInt32Number CheckErrReportingOnBadProfiles(void) static cmsInt32Number CheckBadTransforms(void) { - cmsHPROFILE h1 = cmsCreate_sRGBProfile(); + cmsHPROFILE h1 = cmsCreate_sRGBProfile(DbgThread()); cmsHTRANSFORM x1; - x1 = cmsCreateTransform(NULL, 0, NULL, 0, 0, 0); + x1 = cmsCreateTransform(DbgThread(), NULL, 0, NULL, 0, 0, 0); if (x1 != NULL) { cmsDeleteTransform(DbgThread(), x1); return 0; @@ -5587,26 +5591,26 @@ cmsInt32Number CheckBadTransforms(void) - x1 = cmsCreateTransform(h1, TYPE_RGB_8, h1, TYPE_RGB_8, 12345, 0); + x1 = cmsCreateTransform(DbgThread(), h1, TYPE_RGB_8, h1, TYPE_RGB_8, 12345, 0); if (x1 != NULL) { cmsDeleteTransform(DbgThread(), x1); return 0; } - x1 = cmsCreateTransform(h1, TYPE_CMYK_8, h1, TYPE_RGB_8, 0, 0); + x1 = cmsCreateTransform(DbgThread(), h1, TYPE_CMYK_8, h1, TYPE_RGB_8, 0, 0); if (x1 != NULL) { cmsDeleteTransform(DbgThread(), x1); return 0; } - x1 = cmsCreateTransform(h1, TYPE_RGB_8, h1, TYPE_CMYK_8, 1, 0); + x1 = cmsCreateTransform(DbgThread(), h1, TYPE_RGB_8, h1, TYPE_CMYK_8, 1, 0); if (x1 != NULL) { cmsDeleteTransform(DbgThread(), x1); return 0; } // sRGB does its output as XYZ! - x1 = cmsCreateTransform(h1, TYPE_RGB_8, NULL, TYPE_Lab_8, 1, 0); + x1 = cmsCreateTransform(DbgThread(), h1, TYPE_RGB_8, NULL, TYPE_Lab_8, 1, 0); if (x1 != NULL) { cmsDeleteTransform(DbgThread(), x1); return 0; @@ -5617,10 +5621,10 @@ cmsInt32Number CheckBadTransforms(void) { - cmsHPROFILE hp1 = cmsOpenProfileFromFile( "test1.icc", "r"); - cmsHPROFILE hp2 = cmsCreate_sRGBProfile(); + cmsHPROFILE hp1 = cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"); + cmsHPROFILE hp2 = cmsCreate_sRGBProfile(DbgThread()); - x1 = cmsCreateTransform(hp1, TYPE_BGR_8, hp2, TYPE_BGR_8, INTENT_PERCEPTUAL, 0); + x1 = cmsCreateTransform(DbgThread(), hp1, TYPE_BGR_8, hp2, TYPE_BGR_8, INTENT_PERCEPTUAL, 0); cmsCloseProfile(DbgThread(), hp1); cmsCloseProfile(DbgThread(), hp2); if (x1 != NULL) { @@ -5638,9 +5642,9 @@ cmsInt32Number CheckErrReportingOnBadTransforms(void) { cmsInt32Number rc; - cmsSetLogErrorHandler(ErrorReportingFunction); + cmsSetLogErrorHandler(DbgThread(), ErrorReportingFunction); rc = CheckBadTransforms(); - cmsSetLogErrorHandler(FatalErrorQuit); + cmsSetLogErrorHandler(DbgThread(), FatalErrorQuit); // Reset the error state TrappedError = FALSE; @@ -5854,31 +5858,31 @@ cmsInt32Number CheckCurvesOnlyTransforms(void) c2 = cmsBuildGamma(DbgThread(), 1/2.2); c3 = cmsBuildGamma(DbgThread(), 4.84); - h1 = cmsCreateLinearizationDeviceLinkTHR(DbgThread(), cmsSigGrayData, &c1); - h2 = cmsCreateLinearizationDeviceLinkTHR(DbgThread(), cmsSigGrayData, &c2); - h3 = cmsCreateLinearizationDeviceLinkTHR(DbgThread(), cmsSigGrayData, &c3); + h1 = cmsCreateLinearizationDeviceLink(DbgThread(), cmsSigGrayData, &c1); + h2 = cmsCreateLinearizationDeviceLink(DbgThread(), cmsSigGrayData, &c2); + h3 = cmsCreateLinearizationDeviceLink(DbgThread(), cmsSigGrayData, &c3); SubTest("Gray float optimizeable transform"); - xform1 = cmsCreateTransform(h1, TYPE_GRAY_FLT, h2, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, 0); + xform1 = cmsCreateTransform(DbgThread(), h1, TYPE_GRAY_FLT, h2, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, 0); rc &= CheckFloatlinearXFORM(xform1, 1); cmsDeleteTransform(DbgThread(), xform1); if (rc == 0) goto Error; SubTest("Gray 8 optimizeable transform"); - xform1 = cmsCreateTransform(h1, TYPE_GRAY_8, h2, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); + xform1 = cmsCreateTransform(DbgThread(), h1, TYPE_GRAY_8, h2, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); rc &= Check8linearXFORM(xform1, 1); cmsDeleteTransform(DbgThread(), xform1); if (rc == 0) goto Error; SubTest("Gray 16 optimizeable transform"); - xform1 = cmsCreateTransform(h1, TYPE_GRAY_16, h2, TYPE_GRAY_16, INTENT_PERCEPTUAL, 0); + xform1 = cmsCreateTransform(DbgThread(), h1, TYPE_GRAY_16, h2, TYPE_GRAY_16, INTENT_PERCEPTUAL, 0); rc &= Check16linearXFORM(xform1, 1); cmsDeleteTransform(DbgThread(), xform1); if (rc == 0) goto Error; SubTest("Gray float non-optimizeable transform"); - xform1 = cmsCreateTransform(h1, TYPE_GRAY_FLT, h1, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, 0); - xform2 = cmsCreateTransform(h3, TYPE_GRAY_FLT, NULL, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, 0); + xform1 = cmsCreateTransform(DbgThread(), h1, TYPE_GRAY_FLT, h1, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, 0); + xform2 = cmsCreateTransform(DbgThread(), h3, TYPE_GRAY_FLT, NULL, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, 0); rc &= CompareFloatXFORM(xform1, xform2, 1); cmsDeleteTransform(DbgThread(), xform1); @@ -5886,8 +5890,8 @@ cmsInt32Number CheckCurvesOnlyTransforms(void) if (rc == 0) goto Error; SubTest("Gray 8 non-optimizeable transform"); - xform1 = cmsCreateTransform(h1, TYPE_GRAY_8, h1, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); - xform2 = cmsCreateTransform(h3, TYPE_GRAY_8, NULL, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); + xform1 = cmsCreateTransform(DbgThread(), h1, TYPE_GRAY_8, h1, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); + xform2 = cmsCreateTransform(DbgThread(), h3, TYPE_GRAY_8, NULL, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); rc &= Compare8bitXFORM(xform1, xform2, 1); cmsDeleteTransform(DbgThread(), xform1); @@ -5896,8 +5900,8 @@ cmsInt32Number CheckCurvesOnlyTransforms(void) SubTest("Gray 16 non-optimizeable transform"); - xform1 = cmsCreateTransform(h1, TYPE_GRAY_16, h1, TYPE_GRAY_16, INTENT_PERCEPTUAL, 0); - xform2 = cmsCreateTransform(h3, TYPE_GRAY_16, NULL, TYPE_GRAY_16, INTENT_PERCEPTUAL, 0); + xform1 = cmsCreateTransform(DbgThread(), h1, TYPE_GRAY_16, h1, TYPE_GRAY_16, INTENT_PERCEPTUAL, 0); + xform2 = cmsCreateTransform(DbgThread(), h3, TYPE_GRAY_16, NULL, TYPE_GRAY_16, INTENT_PERCEPTUAL, 0); rc &= Compare16bitXFORM(xform1, xform2, 1); cmsDeleteTransform(DbgThread(), xform1); @@ -5972,7 +5976,7 @@ cmsInt32Number OneTrivialLab(cmsHPROFILE hLab1, cmsHPROFILE hLab2, const char* t cmsInt32Number rc; SubTest(txt); - xform = cmsCreateTransformTHR(DbgThread(), hLab1, TYPE_Lab_DBL, hLab2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab1, TYPE_Lab_DBL, hLab2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hLab1); cmsCloseProfile(DbgThread(), hLab2); rc = CheckSeveralLab(xform); @@ -5984,10 +5988,10 @@ cmsInt32Number OneTrivialLab(cmsHPROFILE hLab1, cmsHPROFILE hLab2, const char* t static cmsInt32Number CheckFloatLabTransforms(void) { - return OneTrivialLab(cmsCreateLab4ProfileTHR(DbgThread(), NULL), cmsCreateLab4ProfileTHR(DbgThread(), NULL), "Lab4/Lab4") && - OneTrivialLab(cmsCreateLab2ProfileTHR(DbgThread(), NULL), cmsCreateLab2ProfileTHR(DbgThread(), NULL), "Lab2/Lab2") && - OneTrivialLab(cmsCreateLab4ProfileTHR(DbgThread(), NULL), cmsCreateLab2ProfileTHR(DbgThread(), NULL), "Lab4/Lab2") && - OneTrivialLab(cmsCreateLab2ProfileTHR(DbgThread(), NULL), cmsCreateLab4ProfileTHR(DbgThread(), NULL), "Lab2/Lab4"); + return OneTrivialLab(cmsCreateLab4Profile(DbgThread(), NULL), cmsCreateLab4Profile(DbgThread(), NULL), "Lab4/Lab4") && + OneTrivialLab(cmsCreateLab2Profile(DbgThread(), NULL), cmsCreateLab2Profile(DbgThread(), NULL), "Lab2/Lab2") && + OneTrivialLab(cmsCreateLab4Profile(DbgThread(), NULL), cmsCreateLab2Profile(DbgThread(), NULL), "Lab4/Lab2") && + OneTrivialLab(cmsCreateLab2Profile(DbgThread(), NULL), cmsCreateLab4Profile(DbgThread(), NULL), "Lab2/Lab4"); } @@ -5998,11 +6002,11 @@ cmsInt32Number CheckEncodedLabTransforms(void) cmsUInt16Number In[3]; cmsCIELab Lab; cmsCIELab White = { 100, 0, 0 }; - cmsHPROFILE hLab1 = cmsCreateLab4ProfileTHR(DbgThread(), NULL); - cmsHPROFILE hLab2 = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + cmsHPROFILE hLab1 = cmsCreateLab4Profile(DbgThread(), NULL); + cmsHPROFILE hLab2 = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hLab1, TYPE_Lab_16, hLab2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab1, TYPE_Lab_16, hLab2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hLab1); cmsCloseProfile(DbgThread(), hLab2); In[0] = 0xFFFF; @@ -6014,10 +6018,10 @@ cmsInt32Number CheckEncodedLabTransforms(void) if (cmsDeltaE(DbgThread(), &Lab, &White) > 0.0001) return 0; cmsDeleteTransform(DbgThread(), xform); - hLab1 = cmsCreateLab2ProfileTHR(DbgThread(), NULL); - hLab2 = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hLab1 = cmsCreateLab2Profile(DbgThread(), NULL); + hLab2 = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hLab1, TYPE_LabV2_16, hLab2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab1, TYPE_LabV2_16, hLab2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hLab1); cmsCloseProfile(DbgThread(), hLab2); @@ -6031,10 +6035,10 @@ cmsInt32Number CheckEncodedLabTransforms(void) cmsDeleteTransform(DbgThread(), xform); - hLab2 = cmsCreateLab2ProfileTHR(DbgThread(), NULL); - hLab1 = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hLab2 = cmsCreateLab2Profile(DbgThread(), NULL); + hLab1 = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hLab1, TYPE_Lab_DBL, hLab2, TYPE_LabV2_16, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab1, TYPE_Lab_DBL, hLab2, TYPE_LabV2_16, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hLab1); cmsCloseProfile(DbgThread(), hLab2); Lab.L = 100; @@ -6048,10 +6052,10 @@ cmsInt32Number CheckEncodedLabTransforms(void) cmsDeleteTransform(DbgThread(), xform); - hLab1 = cmsCreateLab4ProfileTHR(DbgThread(), NULL); - hLab2 = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hLab1 = cmsCreateLab4Profile(DbgThread(), NULL); + hLab2 = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hLab1, TYPE_Lab_DBL, hLab2, TYPE_Lab_16, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab1, TYPE_Lab_DBL, hLab2, TYPE_Lab_16, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hLab1); cmsCloseProfile(DbgThread(), hLab2); Lab.L = 100; @@ -6076,8 +6080,8 @@ cmsInt32Number CheckStoredIdentities(void) cmsHTRANSFORM xform; cmsInt32Number rc = 1; - hLab = cmsCreateLab4ProfileTHR(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hLab, TYPE_Lab_8, hLab, TYPE_Lab_8, 0, 0); + hLab = cmsCreateLab4Profile(DbgThread(), NULL); + xform = cmsCreateTransform(DbgThread(), hLab, TYPE_Lab_8, hLab, TYPE_Lab_8, 0, 0); hLink = cmsTransform2DeviceLink(NULL, xform, 3.4, 0); cmsSaveProfileToFile(DbgThread(), hLink, "abstractv2.icc"); @@ -6090,9 +6094,9 @@ cmsInt32Number CheckStoredIdentities(void) cmsDeleteTransform(DbgThread(), xform); cmsCloseProfile(DbgThread(), hLab); - h4 = cmsOpenProfileFromFileTHR(DbgThread(), "abstractv4.icc", "r"); + h4 = cmsOpenProfileFromFile(DbgThread(), "abstractv4.icc", "r"); - xform = cmsCreateTransformTHR(DbgThread(), h4, TYPE_Lab_DBL, h4, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), h4, TYPE_Lab_DBL, h4, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); SubTest("V4"); rc &= CheckSeveralLab(xform); @@ -6103,9 +6107,9 @@ cmsInt32Number CheckStoredIdentities(void) SubTest("V2"); - h2 = cmsOpenProfileFromFileTHR(DbgThread(), "abstractv2.icc", "r"); + h2 = cmsOpenProfileFromFile(DbgThread(), "abstractv2.icc", "r"); - xform = cmsCreateTransformTHR(DbgThread(), h2, TYPE_Lab_DBL, h2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), h2, TYPE_Lab_DBL, h2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); rc &= CheckSeveralLab(xform); cmsDeleteTransform(DbgThread(), xform); cmsCloseProfile(DbgThread(), h2); @@ -6113,20 +6117,20 @@ cmsInt32Number CheckStoredIdentities(void) SubTest("V2 -> V4"); - h2 = cmsOpenProfileFromFileTHR(DbgThread(), "abstractv2.icc", "r"); - h4 = cmsOpenProfileFromFileTHR(DbgThread(), "abstractv4.icc", "r"); + h2 = cmsOpenProfileFromFile(DbgThread(), "abstractv2.icc", "r"); + h4 = cmsOpenProfileFromFile(DbgThread(), "abstractv4.icc", "r"); - xform = cmsCreateTransformTHR(DbgThread(), h4, TYPE_Lab_DBL, h2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), h4, TYPE_Lab_DBL, h2, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); rc &= CheckSeveralLab(xform); cmsDeleteTransform(DbgThread(), xform); cmsCloseProfile(DbgThread(), h2); cmsCloseProfile(DbgThread(), h4); SubTest("V4 -> V2"); - h2 = cmsOpenProfileFromFileTHR(DbgThread(), "abstractv2.icc", "r"); - h4 = cmsOpenProfileFromFileTHR(DbgThread(), "abstractv4.icc", "r"); + h2 = cmsOpenProfileFromFile(DbgThread(), "abstractv2.icc", "r"); + h4 = cmsOpenProfileFromFile(DbgThread(), "abstractv4.icc", "r"); - xform = cmsCreateTransformTHR(DbgThread(), h2, TYPE_Lab_DBL, h4, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), h2, TYPE_Lab_DBL, h4, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); rc &= CheckSeveralLab(xform); cmsDeleteTransform(DbgThread(), xform); cmsCloseProfile(DbgThread(), h2); @@ -6150,13 +6154,13 @@ cmsInt32Number CheckMatrixShaperXFORMFloat(void) cmsInt32Number rc1, rc2; hAbove = Create_AboveRGB(); - xform = cmsCreateTransformTHR(DbgThread(), hAbove, TYPE_RGB_FLT, hAbove, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hAbove, TYPE_RGB_FLT, hAbove, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hAbove); rc1 = CheckFloatlinearXFORM(xform, 3); cmsDeleteTransform(DbgThread(), xform); - hSRGB = cmsCreate_sRGBProfileTHR(DbgThread()); - xform = cmsCreateTransformTHR(DbgThread(), hSRGB, TYPE_RGB_FLT, hSRGB, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); + hSRGB = cmsCreate_sRGBProfile(DbgThread()); + xform = cmsCreateTransform(DbgThread(), hSRGB, TYPE_RGB_FLT, hSRGB, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hSRGB); rc2 = CheckFloatlinearXFORM(xform, 3); cmsDeleteTransform(DbgThread(), xform); @@ -6174,14 +6178,14 @@ cmsInt32Number CheckMatrixShaperXFORM16(void) cmsInt32Number rc1, rc2; hAbove = Create_AboveRGB(); - xform = cmsCreateTransformTHR(DbgThread(), hAbove, TYPE_RGB_16, hAbove, TYPE_RGB_16, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hAbove, TYPE_RGB_16, hAbove, TYPE_RGB_16, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hAbove); rc1 = Check16linearXFORM(xform, 3); cmsDeleteTransform(DbgThread(), xform); - hSRGB = cmsCreate_sRGBProfileTHR(DbgThread()); - xform = cmsCreateTransformTHR(DbgThread(), hSRGB, TYPE_RGB_16, hSRGB, TYPE_RGB_16, INTENT_RELATIVE_COLORIMETRIC, 0); + hSRGB = cmsCreate_sRGBProfile(DbgThread()); + xform = cmsCreateTransform(DbgThread(), hSRGB, TYPE_RGB_16, hSRGB, TYPE_RGB_16, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hSRGB); rc2 = Check16linearXFORM(xform, 3); cmsDeleteTransform(DbgThread(), xform); @@ -6200,13 +6204,13 @@ cmsInt32Number CheckMatrixShaperXFORM8(void) cmsInt32Number rc1, rc2; hAbove = Create_AboveRGB(); - xform = cmsCreateTransformTHR(DbgThread(), hAbove, TYPE_RGB_8, hAbove, TYPE_RGB_8, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hAbove, TYPE_RGB_8, hAbove, TYPE_RGB_8, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hAbove); rc1 = Check8linearXFORM(xform, 3); cmsDeleteTransform(DbgThread(), xform); - hSRGB = cmsCreate_sRGBProfileTHR(DbgThread()); - xform = cmsCreateTransformTHR(DbgThread(), hSRGB, TYPE_RGB_8, hSRGB, TYPE_RGB_8, INTENT_RELATIVE_COLORIMETRIC, 0); + hSRGB = cmsCreate_sRGBProfile(DbgThread()); + xform = cmsCreateTransform(DbgThread(), hSRGB, TYPE_RGB_8, hSRGB, TYPE_RGB_8, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hSRGB); rc2 = Check8linearXFORM(xform, 3); cmsDeleteTransform(DbgThread(), xform); @@ -6252,14 +6256,14 @@ cmsInt32Number Chack_sRGB_Float(void) cmsInt32Number rc; - hsRGB = cmsCreate_sRGBProfileTHR(DbgThread()); - hXYZ = cmsCreateXYZProfileTHR(DbgThread()); - hLab = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hsRGB = cmsCreate_sRGBProfile(DbgThread()); + hXYZ = cmsCreateXYZProfile(DbgThread()); + hLab = cmsCreateLab4Profile(DbgThread(), NULL); - xform1 = cmsCreateTransformTHR(DbgThread(), hsRGB, TYPE_RGB_FLT, hXYZ, TYPE_XYZ_DBL, + xform1 = cmsCreateTransform(DbgThread(), hsRGB, TYPE_RGB_FLT, hXYZ, TYPE_XYZ_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); - xform2 = cmsCreateTransformTHR(DbgThread(), hsRGB, TYPE_RGB_FLT, hLab, TYPE_Lab_DBL, + xform2 = cmsCreateTransform(DbgThread(), hsRGB, TYPE_RGB_FLT, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hsRGB); cmsCloseProfile(DbgThread(), hXYZ); @@ -6299,10 +6303,10 @@ cmsBool GetProfileRGBPrimaries(cmsHPROFILE hProfile, {0., 1., 0.}, {0., 0., 1.}}; - hXYZ = cmsCreateXYZProfile(); + hXYZ = cmsCreateXYZProfile(DbgThread()); if (hXYZ == NULL) return FALSE; - hTransform = cmsCreateTransform(hProfile, TYPE_RGB_DBL, hXYZ, TYPE_XYZ_DBL, + hTransform = cmsCreateTransform(DbgThread(), hProfile, TYPE_RGB_DBL, hXYZ, TYPE_XYZ_DBL, intent, cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE); cmsCloseProfile(DbgThread(), hXYZ); if (hTransform == NULL) return FALSE; @@ -6321,8 +6325,8 @@ int CheckRGBPrimaries(void) cmsCIExyYTRIPLE tripxyY; cmsBool result; - cmsSetAdaptationState(0); - hsRGB = cmsCreate_sRGBProfileTHR(DbgThread()); + cmsSetAdaptationState(DbgThread(), 0); + hsRGB = cmsCreate_sRGBProfile(DbgThread()); if (!hsRGB) return 0; result = GetProfileRGBPrimaries(hsRGB, &tripXYZ, @@ -6359,8 +6363,8 @@ int CheckRGBPrimaries(void) static cmsInt32Number CheckCMYK(cmsInt32Number Intent, const char *Profile1, const char* Profile2) { - cmsHPROFILE hSWOP = cmsOpenProfileFromFileTHR(DbgThread(), Profile1, "r"); - cmsHPROFILE hFOGRA = cmsOpenProfileFromFileTHR(DbgThread(), Profile2, "r"); + cmsHPROFILE hSWOP = cmsOpenProfileFromFile(DbgThread(), Profile1, "r"); + cmsHPROFILE hFOGRA = cmsOpenProfileFromFile(DbgThread(), Profile2, "r"); cmsHTRANSFORM xform, swop_lab, fogra_lab; cmsFloat32Number CMYK1[4], CMYK2[4]; cmsCIELab Lab1, Lab2; @@ -6368,12 +6372,12 @@ cmsInt32Number CheckCMYK(cmsInt32Number Intent, const char *Profile1, const char cmsFloat64Number DeltaL, Max; cmsInt32Number i; - hLab = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hLab = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hSWOP, TYPE_CMYK_FLT, hFOGRA, TYPE_CMYK_FLT, Intent, 0); + xform = cmsCreateTransform(DbgThread(), hSWOP, TYPE_CMYK_FLT, hFOGRA, TYPE_CMYK_FLT, Intent, 0); - swop_lab = cmsCreateTransformTHR(DbgThread(), hSWOP, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, Intent, 0); - fogra_lab = cmsCreateTransformTHR(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, Intent, 0); + swop_lab = cmsCreateTransform(DbgThread(), hSWOP, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, Intent, 0); + fogra_lab = cmsCreateTransform(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, Intent, 0); Max = 0; for (i=0; i <= 100; i++) { @@ -6395,11 +6399,8 @@ cmsInt32Number CheckCMYK(cmsInt32Number Intent, const char *Profile1, const char cmsDeleteTransform(DbgThread(), xform); - if (Max > 3.0) return 0; - xform = cmsCreateTransformTHR(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hSWOP, TYPE_CMYK_FLT, Intent, 0); - - Max = 0; + xform = cmsCreateTransform(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hSWOP, TYPE_CMYK_FLT, Intent, 0); for (i=0; i <= 100; i++) { CMYK1[0] = 10; @@ -6454,8 +6455,8 @@ cmsInt32Number CheckCMYKRelCol(void) static cmsInt32Number CheckKOnlyBlackPreserving(void) { - cmsHPROFILE hSWOP = cmsOpenProfileFromFileTHR(DbgThread(), "test1.icc", "r"); - cmsHPROFILE hFOGRA = cmsOpenProfileFromFileTHR(DbgThread(), "test2.icc", "r"); + cmsHPROFILE hSWOP = cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"); + cmsHPROFILE hFOGRA = cmsOpenProfileFromFile(DbgThread(), "test2.icc", "r"); cmsHTRANSFORM xform, swop_lab, fogra_lab; cmsFloat32Number CMYK1[4], CMYK2[4]; cmsCIELab Lab1, Lab2; @@ -6463,12 +6464,12 @@ cmsInt32Number CheckKOnlyBlackPreserving(void) cmsFloat64Number DeltaL, Max; cmsInt32Number i; - hLab = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hLab = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hSWOP, TYPE_CMYK_FLT, hFOGRA, TYPE_CMYK_FLT, INTENT_PRESERVE_K_ONLY_PERCEPTUAL, 0); + xform = cmsCreateTransform(DbgThread(), hSWOP, TYPE_CMYK_FLT, hFOGRA, TYPE_CMYK_FLT, INTENT_PRESERVE_K_ONLY_PERCEPTUAL, 0); - swop_lab = cmsCreateTransformTHR(DbgThread(), hSWOP, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); - fogra_lab = cmsCreateTransformTHR(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); + swop_lab = cmsCreateTransform(DbgThread(), hSWOP, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); + fogra_lab = cmsCreateTransform(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); Max = 0; @@ -6497,13 +6498,10 @@ cmsInt32Number CheckKOnlyBlackPreserving(void) cmsDeleteTransform(DbgThread(), xform); // dL should be below 3.0 - if (Max > 3.0) return 0; // Same, but FOGRA to SWOP - xform = cmsCreateTransformTHR(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hSWOP, TYPE_CMYK_FLT, INTENT_PRESERVE_K_ONLY_PERCEPTUAL, 0); - - Max = 0; + xform = cmsCreateTransform(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hSWOP, TYPE_CMYK_FLT, INTENT_PRESERVE_K_ONLY_PERCEPTUAL, 0); for (i=0; i <= 100; i++) { CMYK1[0] = 0; @@ -6535,8 +6533,8 @@ cmsInt32Number CheckKOnlyBlackPreserving(void) static cmsInt32Number CheckKPlaneBlackPreserving(void) { - cmsHPROFILE hSWOP = cmsOpenProfileFromFileTHR(DbgThread(), "test1.icc", "r"); - cmsHPROFILE hFOGRA = cmsOpenProfileFromFileTHR(DbgThread(), "test2.icc", "r"); + cmsHPROFILE hSWOP = cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"); + cmsHPROFILE hFOGRA = cmsOpenProfileFromFile(DbgThread(), "test2.icc", "r"); cmsHTRANSFORM xform, swop_lab, fogra_lab; cmsFloat32Number CMYK1[4], CMYK2[4]; cmsCIELab Lab1, Lab2; @@ -6544,12 +6542,12 @@ cmsInt32Number CheckKPlaneBlackPreserving(void) cmsFloat64Number DeltaE, Max; cmsInt32Number i; - hLab = cmsCreateLab4ProfileTHR(DbgThread(), NULL); + hLab = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransformTHR(DbgThread(), hSWOP, TYPE_CMYK_FLT, hFOGRA, TYPE_CMYK_FLT, INTENT_PERCEPTUAL, 0); + xform = cmsCreateTransform(DbgThread(), hSWOP, TYPE_CMYK_FLT, hFOGRA, TYPE_CMYK_FLT, INTENT_PERCEPTUAL, 0); - swop_lab = cmsCreateTransformTHR(DbgThread(), hSWOP, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); - fogra_lab = cmsCreateTransformTHR(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); + swop_lab = cmsCreateTransform(DbgThread(), hSWOP, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); + fogra_lab = cmsCreateTransform(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hLab, TYPE_Lab_DBL, INTENT_PERCEPTUAL, 0); Max = 0; @@ -6571,7 +6569,7 @@ cmsInt32Number CheckKPlaneBlackPreserving(void) cmsDeleteTransform(DbgThread(), xform); - xform = cmsCreateTransformTHR(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hSWOP, TYPE_CMYK_FLT, INTENT_PRESERVE_K_PLANE_PERCEPTUAL, 0); + xform = cmsCreateTransform(DbgThread(), hFOGRA, TYPE_CMYK_FLT, hSWOP, TYPE_CMYK_FLT, INTENT_PRESERVE_K_PLANE_PERCEPTUAL, 0); for (i=0; i <= 100; i++) { CMYK1[0] = 30; @@ -6615,7 +6613,7 @@ cmsInt32Number CheckProofingXFORMFloat(void) cmsInt32Number rc; hAbove = Create_AboveRGB(); - xform = cmsCreateProofingTransformTHR(DbgThread(), hAbove, TYPE_RGB_FLT, hAbove, TYPE_RGB_FLT, hAbove, + xform = cmsCreateProofingTransform(DbgThread(), hAbove, TYPE_RGB_FLT, hAbove, TYPE_RGB_FLT, hAbove, INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_SOFTPROOFING); cmsCloseProfile(DbgThread(), hAbove); rc = CheckFloatlinearXFORM(xform, 3); @@ -6631,7 +6629,7 @@ cmsInt32Number CheckProofingXFORM16(void) cmsInt32Number rc; hAbove = Create_AboveRGB(); - xform = cmsCreateProofingTransformTHR(DbgThread(), hAbove, TYPE_RGB_16, hAbove, TYPE_RGB_16, hAbove, + xform = cmsCreateProofingTransform(DbgThread(), hAbove, TYPE_RGB_16, hAbove, TYPE_RGB_16, hAbove, INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_SOFTPROOFING|cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hAbove); rc = Check16linearXFORM(xform, 3); @@ -6649,10 +6647,10 @@ cmsInt32Number CheckGamutCheck(void) cmsUInt16Number Alarm[16] = { 0xDEAD, 0xBABE, 0xFACE }; // Set alarm codes to fancy values so we could check the out of gamut condition - cmsSetAlarmCodes(Alarm); + cmsSetAlarmCodes(DbgThread(), Alarm); // Create the profiles - hSRGB = cmsCreate_sRGBProfileTHR(DbgThread()); + hSRGB = cmsCreate_sRGBProfile(DbgThread()); hAbove = Create_AboveRGB(); if (hSRGB == NULL || hAbove == NULL) return 0; // Failed @@ -6660,7 +6658,7 @@ cmsInt32Number CheckGamutCheck(void) SubTest("Gamut check on floating point"); // Create a gamut checker in the same space. No value should be out of gamut - xform = cmsCreateProofingTransformTHR(DbgThread(), hAbove, TYPE_RGB_FLT, hAbove, TYPE_RGB_FLT, hAbove, + xform = cmsCreateProofingTransform(DbgThread(), hAbove, TYPE_RGB_FLT, hAbove, TYPE_RGB_FLT, hAbove, INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_GAMUTCHECK); @@ -6676,7 +6674,7 @@ cmsInt32Number CheckGamutCheck(void) SubTest("Gamut check on 16 bits"); - xform = cmsCreateProofingTransformTHR(DbgThread(), hAbove, TYPE_RGB_16, hAbove, TYPE_RGB_16, hSRGB, + xform = cmsCreateProofingTransform(DbgThread(), hAbove, TYPE_RGB_16, hAbove, TYPE_RGB_16, hSRGB, INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_GAMUTCHECK); cmsCloseProfile(DbgThread(), hSRGB); @@ -6700,27 +6698,27 @@ cmsInt32Number CheckBlackPoint(void) cmsCIEXYZ Black; cmsCIELab Lab; - hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "test5.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"); cmsDetectDestinationBlackPoint(DbgThread(), &Black, hProfile, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hProfile); - hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "test1.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"); cmsDetectDestinationBlackPoint(DbgThread(), &Black, hProfile, INTENT_RELATIVE_COLORIMETRIC, 0); cmsXYZ2Lab(DbgThread(), NULL, &Lab, &Black); cmsCloseProfile(DbgThread(), hProfile); - hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "lcms2cmyk.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "lcms2cmyk.icc", "r"); cmsDetectDestinationBlackPoint(DbgThread(), &Black, hProfile, INTENT_RELATIVE_COLORIMETRIC, 0); cmsXYZ2Lab(DbgThread(), NULL, &Lab, &Black); cmsCloseProfile(DbgThread(), hProfile); - hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "test2.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "test2.icc", "r"); cmsDetectDestinationBlackPoint(DbgThread(), &Black, hProfile, INTENT_RELATIVE_COLORIMETRIC, 0); cmsXYZ2Lab(DbgThread(), NULL, &Lab, &Black); cmsCloseProfile(DbgThread(), hProfile); - hProfile = cmsOpenProfileFromFileTHR(DbgThread(), "test1.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"); cmsDetectDestinationBlackPoint(DbgThread(), &Black, hProfile, INTENT_PERCEPTUAL, 0); cmsXYZ2Lab(DbgThread(), NULL, &Lab, &Black); cmsCloseProfile(DbgThread(), hProfile); @@ -6739,7 +6737,7 @@ cmsInt32Number CheckOneTAC(cmsFloat64Number InkLimit) cmsSaveProfileToFile(DbgThread(), h, "lcmstac.icc"); cmsCloseProfile(DbgThread(), h); - h = cmsOpenProfileFromFile( "lcmstac.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "lcmstac.icc", "r"); d = cmsDetectTAC(DbgThread(), h); cmsCloseProfile(DbgThread(), h); @@ -6915,9 +6913,9 @@ void GenerateCSA(const char* cInProf, const char* FileName) if (cInProf == NULL) - hProfile = cmsCreateLab4Profile(NULL); + hProfile = cmsCreateLab4Profile(DbgThread(), NULL); else - hProfile = cmsOpenProfileFromFile( cInProf, "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), cInProf, "r"); n = cmsGetPostScriptCSA(DbgThread(), hProfile, 0, 0, NULL, 0); if (n == 0) return; @@ -6950,9 +6948,9 @@ void GenerateCRD(const char* cOutProf, const char* FileName) if (cOutProf == NULL) - hProfile = cmsCreateLab4Profile(NULL); + hProfile = cmsCreateLab4Profile(DbgThread(), NULL); else - hProfile = cmsOpenProfileFromFile( cOutProf, "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), cOutProf, "r"); n = cmsGetPostScriptCRD(DbgThread(), hProfile, 0, dwFlags, NULL, 0); if (n == 0) return; @@ -7011,12 +7009,12 @@ static cmsInt32Number CheckInputGray(void) { cmsHPROFILE hGray = Create_Gray22(); - cmsHPROFILE hLab = cmsCreateLab4Profile(NULL); + cmsHPROFILE hLab = cmsCreateLab4Profile(DbgThread(), NULL); cmsHTRANSFORM xform; if (hGray == NULL || hLab == NULL) return 0; - xform = cmsCreateTransform(hGray, TYPE_GRAY_8, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hGray, TYPE_GRAY_8, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hGray); cmsCloseProfile(DbgThread(), hLab); if (!CheckGray(xform, 0, 0)) return 0; @@ -7032,12 +7030,12 @@ static cmsInt32Number CheckLabInputGray(void) { cmsHPROFILE hGray = Create_GrayLab(); - cmsHPROFILE hLab = cmsCreateLab4Profile(NULL); + cmsHPROFILE hLab = cmsCreateLab4Profile(DbgThread(), NULL); cmsHTRANSFORM xform; if (hGray == NULL || hLab == NULL) return 0; - xform = cmsCreateTransform(hGray, TYPE_GRAY_8, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hGray, TYPE_GRAY_8, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hGray); cmsCloseProfile(DbgThread(), hLab); if (!CheckGray(xform, 0, 0)) return 0; @@ -7069,12 +7067,12 @@ static cmsInt32Number CheckOutputGray(void) { cmsHPROFILE hGray = Create_Gray22(); - cmsHPROFILE hLab = cmsCreateLab4Profile(NULL); + cmsHPROFILE hLab = cmsCreateLab4Profile(DbgThread(), NULL); cmsHTRANSFORM xform; if (hGray == NULL || hLab == NULL) return 0; - xform = cmsCreateTransform( hLab, TYPE_Lab_DBL, hGray, TYPE_GRAY_8, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab, TYPE_Lab_DBL, hGray, TYPE_GRAY_8, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hGray); cmsCloseProfile(DbgThread(), hLab); if (!CheckOutGray(xform, 0, 0)) return 0; @@ -7093,13 +7091,13 @@ static cmsInt32Number CheckLabOutputGray(void) { cmsHPROFILE hGray = Create_GrayLab(); - cmsHPROFILE hLab = cmsCreateLab4Profile(NULL); + cmsHPROFILE hLab = cmsCreateLab4Profile(DbgThread(), NULL); cmsHTRANSFORM xform; cmsInt32Number i; if (hGray == NULL || hLab == NULL) return 0; - xform = cmsCreateTransform( hLab, TYPE_Lab_DBL, hGray, TYPE_GRAY_8, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), hLab, TYPE_Lab_DBL, hGray, TYPE_GRAY_8, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), hGray); cmsCloseProfile(DbgThread(), hLab); if (!CheckOutGray(xform, 0, 0)) return 0; @@ -7127,7 +7125,7 @@ cmsInt32Number CheckV4gamma(void) cmsUInt16Number Lin[] = {0, 0xffff}; cmsToneCurve*g = cmsBuildTabulatedToneCurve16(DbgThread(), 2, Lin); - h = cmsOpenProfileFromFileTHR(DbgThread(), "v4gamma.icc", "w"); + h = cmsOpenProfileFromFile(DbgThread(), "v4gamma.icc", "w"); if (h == NULL) return 0; @@ -7194,10 +7192,10 @@ cmsInt32Number CheckGBD(void) // Now for sRGB SubTest("checking sRGB gamut"); h = cmsGBDAlloc(DbgThread()); - hsRGB = cmsCreate_sRGBProfile(); - hLab = cmsCreateLab4Profile(NULL); + hsRGB = cmsCreate_sRGBProfile(DbgThread()); + hLab = cmsCreateLab4Profile(DbgThread(), NULL); - xform = cmsCreateTransform(hsRGB, TYPE_RGB_8, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE); + xform = cmsCreateTransform(DbgThread(), hsRGB, TYPE_RGB_8, hLab, TYPE_Lab_DBL, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hsRGB); cmsCloseProfile(DbgThread(), hLab); @@ -7286,7 +7284,7 @@ static int CheckMD5(void) { _cmsICCPROFILE* h; - cmsHPROFILE pProfile = cmsOpenProfileFromFile( "sRGBlcms2.icc", "r"); + cmsHPROFILE pProfile = cmsOpenProfileFromFile(DbgThread(), "sRGBlcms2.icc", "r"); cmsProfileID ProfileID1, ProfileID2, ProfileID3, ProfileID4; h =(_cmsICCPROFILE*) pProfile; @@ -7296,7 +7294,7 @@ int CheckMD5(void) cmsCloseProfile(DbgThread(), pProfile); - pProfile = cmsOpenProfileFromFile( "sRGBlcms2.icc", "r"); + pProfile = cmsOpenProfileFromFile(DbgThread(), "sRGBlcms2.icc", "r"); h =(_cmsICCPROFILE*) pProfile; if (cmsMD5computeID(DbgThread(), pProfile)) cmsGetHeaderProfileID(DbgThread(), pProfile, ProfileID3.ID8); @@ -7318,7 +7316,7 @@ int CheckLinking(void) cmsStage *stageBegin, *stageEnd; // Create a CLUT based profile - h = cmsCreateInkLimitingDeviceLinkTHR(DbgThread(), cmsSigCmykData, 150); + h = cmsCreateInkLimitingDeviceLink(DbgThread(), cmsSigCmykData, 150); // link a second tag cmsLinkTag(DbgThread(), h, cmsSigAToB1Tag, cmsSigAToB0Tag); @@ -7328,7 +7326,7 @@ int CheckLinking(void) cmsCloseProfile(DbgThread(), h); // Now open the profile and read the pipeline - h = cmsOpenProfileFromFile( "lcms2link.icc", "r"); + h = cmsOpenProfileFromFile(DbgThread(), "lcms2link.icc", "r"); if (h == NULL) return 0; pipeline = (cmsPipeline*) cmsReadTag(DbgThread(), h, cmsSigAToB1Tag); @@ -7407,19 +7405,20 @@ static cmsInt32Number CheckFloatXYZ(void) { cmsHPROFILE input; - cmsHPROFILE xyzProfile = cmsCreateXYZProfile(); + cmsHPROFILE xyzProfile = cmsCreateXYZProfile(DbgThread()); cmsHTRANSFORM xform; - cmsFloat32Number in[3]; - cmsFloat32Number out[3]; + cmsFloat32Number in[4]; + cmsFloat32Number out[4]; in[0] = 1.0; in[1] = 1.0; in[2] = 1.0; + in[3] = 0.5; // RGB to XYZ input = IdentityMatrixProfile( cmsSigRgbData); - xform = cmsCreateTransform( input, TYPE_RGB_FLT, xyzProfile, TYPE_XYZ_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), input, TYPE_RGB_FLT, xyzProfile, TYPE_XYZ_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), input); cmsDoTransform(DbgThread(), xform, in, out, 1); @@ -7434,7 +7433,7 @@ cmsInt32Number CheckFloatXYZ(void) // XYZ to XYZ input = IdentityMatrixProfile( cmsSigXYZData); - xform = cmsCreateTransform( input, TYPE_XYZ_FLT, xyzProfile, TYPE_XYZ_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), input, TYPE_XYZ_FLT, xyzProfile, TYPE_XYZ_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), input); cmsDoTransform(DbgThread(), xform, in, out, 1); @@ -7448,10 +7447,29 @@ cmsInt32Number CheckFloatXYZ(void) return 0; + input = IdentityMatrixProfile( cmsSigXYZData); + +# define TYPE_XYZA_FLT (FLOAT_SH(1)|COLORSPACE_SH(PT_XYZ)|EXTRA_SH(1)|CHANNELS_SH(3)|BYTES_SH(4)) + + xform = cmsCreateTransform(DbgThread(), input, TYPE_XYZA_FLT, xyzProfile, TYPE_XYZA_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_COPY_ALPHA); + cmsCloseProfile(DbgThread(), input); + + cmsDoTransform(DbgThread(), xform, in, out, 1); + + + cmsDeleteTransform(DbgThread(), xform); + + if (!IsGoodVal("Float XYZA->XYZA", in[0], out[0], FLOAT_PRECISSION) || + !IsGoodVal("Float XYZA->XYZA", in[1], out[1], FLOAT_PRECISSION) || + !IsGoodVal("Float XYZA->XYZA", in[2], out[2], FLOAT_PRECISSION) || + !IsGoodVal("Float XYZA->XYZA", in[3], out[3], FLOAT_PRECISSION)) + return 0; + + // XYZ to RGB input = IdentityMatrixProfile( cmsSigRgbData); - xform = cmsCreateTransform( xyzProfile, TYPE_XYZ_FLT, input, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), xyzProfile, TYPE_XYZ_FLT, input, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), input); cmsDoTransform(DbgThread(), xform, in, out, 1); @@ -7469,7 +7487,7 @@ cmsInt32Number CheckFloatXYZ(void) // XYZ to RGB input = IdentityMatrixProfile( cmsSigRgbData); - xform = cmsCreateTransform( input, TYPE_RGB_FLT, input, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); + xform = cmsCreateTransform(DbgThread(), input, TYPE_RGB_FLT, input, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, 0); cmsCloseProfile(DbgThread(), input); cmsDoTransform(DbgThread(), xform, in, out, 1); @@ -7507,11 +7525,11 @@ Bug reported static cmsInt32Number ChecksRGB2LabFLT(void) { - cmsHPROFILE hSRGB = cmsCreate_sRGBProfile(); - cmsHPROFILE hLab = cmsCreateLab4Profile(NULL); + cmsHPROFILE hSRGB = cmsCreate_sRGBProfile(DbgThread()); + cmsHPROFILE hLab = cmsCreateLab4Profile(DbgThread(), NULL); - cmsHTRANSFORM xform1 = cmsCreateTransform(hSRGB, TYPE_RGBA_FLT, hLab, TYPE_LabA_FLT, 0, cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE); - cmsHTRANSFORM xform2 = cmsCreateTransform(hLab, TYPE_LabA_FLT, hSRGB, TYPE_RGBA_FLT, 0, cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE); + cmsHTRANSFORM xform1 = cmsCreateTransform(DbgThread(), hSRGB, TYPE_RGBA_FLT, hLab, TYPE_LabA_FLT, 0, cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE); + cmsHTRANSFORM xform2 = cmsCreateTransform(DbgThread(), hLab, TYPE_LabA_FLT, hSRGB, TYPE_RGBA_FLT, 0, cmsFLAGS_NOCACHE|cmsFLAGS_NOOPTIMIZE); cmsFloat32Number RGBA1[4], RGBA2[4], LabA[4]; int i; @@ -7707,7 +7725,7 @@ cmsInt32Number CheckReadRAW(void) SubTest("RAW read on on-disk"); - hProfile = cmsOpenProfileFromFile( "test1.icc", "r"); + hProfile = cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"); if (hProfile == NULL) return 0; @@ -7724,7 +7742,7 @@ cmsInt32Number CheckReadRAW(void) return 0; SubTest("RAW read on in-memory created profiles"); - hProfile = cmsCreate_sRGBProfile(); + hProfile = cmsCreate_sRGBProfile(DbgThread()); tag_size = cmsReadRawTag(DbgThread(), hProfile, cmsSigGreenColorantTag, buffer, 4); tag_size1 = cmsReadRawTag(DbgThread(), hProfile, cmsSigGreenColorantTag, NULL, 0); @@ -7750,7 +7768,7 @@ cmsInt32Number CheckMeta(void) int rc; /* open file */ - p = cmsOpenProfileFromFile( "ibm-t61.icc", "r"); + p = cmsOpenProfileFromFile(DbgThread(), "ibm-t61.icc", "r"); if (p == NULL) return 0; /* read dictionary, but don't do anything with the value */ @@ -7776,7 +7794,7 @@ cmsInt32Number CheckMeta(void) cmsCloseProfile(DbgThread(), p); /* open newly created file and read metadata */ - p = cmsOpenProfileFromFile( "new.icc", "r"); + p = cmsOpenProfileFromFile(DbgThread(), "new.icc", "r"); //ERROR: Bad dictionary Name/Value //ERROR: Corrupted tag 'meta' //test: test.c:59: main: Assertion `dict' failed. @@ -7796,7 +7814,7 @@ cmsInt32Number CheckFloatNULLxform(void) cmsFloat32Number in[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; cmsFloat32Number out[10]; - cmsHTRANSFORM xform = cmsCreateTransform(NULL, TYPE_GRAY_FLT, NULL, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, cmsFLAGS_NULLTRANSFORM); + cmsHTRANSFORM xform = cmsCreateTransform(DbgThread(), NULL, TYPE_GRAY_FLT, NULL, TYPE_GRAY_FLT, INTENT_PERCEPTUAL, cmsFLAGS_NULLTRANSFORM); if (xform == NULL) { Fail("Unable to create float null transform"); @@ -7824,7 +7842,7 @@ cmsInt32Number CheckRemoveTag(void) cmsMLU *mlu; int ret; - p = cmsCreate_sRGBProfileTHR(NULL); + p = cmsCreate_sRGBProfile(NULL); /* set value */ mlu = cmsMLUalloc (NULL, 1); @@ -7856,12 +7874,12 @@ cmsInt32Number CheckMatrixSimplify(void) unsigned char buf[3] = { 127, 32, 64 }; - pIn = cmsCreate_sRGBProfile(); - pOut = cmsOpenProfileFromFile( "ibm-t61.icc", "r"); + pIn = cmsCreate_sRGBProfile(DbgThread()); + pOut = cmsOpenProfileFromFile(DbgThread(), "ibm-t61.icc", "r"); if (pIn == NULL || pOut == NULL) return 0; - t = cmsCreateTransform(pIn, TYPE_RGB_8, pOut, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); + t = cmsCreateTransform(DbgThread(), pIn, TYPE_RGB_8, pOut, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); cmsDoTransformStride(DbgThread(), t, buf, buf, 1, 1); cmsDeleteTransform(DbgThread(), t); cmsCloseProfile(DbgThread(), pIn); @@ -7906,12 +7924,12 @@ cmsInt32Number CheckTransformLineStride(void) memset(out, 0, sizeof(out)); - pIn = cmsCreate_sRGBProfile(); - pOut = cmsOpenProfileFromFile( "ibm-t61.icc", "r"); + pIn = cmsCreate_sRGBProfile(DbgThread()); + pOut = cmsOpenProfileFromFile(DbgThread(), "ibm-t61.icc", "r"); if (pIn == NULL || pOut == NULL) return 0; - t = cmsCreateTransform(pIn, TYPE_RGB_8, pOut, TYPE_RGB_8, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); + t = cmsCreateTransform(DbgThread(), pIn, TYPE_RGB_8, pOut, TYPE_RGB_8, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); cmsDoTransformLineStride(DbgThread(), t, buf1, out, 2, 4, 7, 7, 0, 0); cmsDeleteTransform(DbgThread(), t); @@ -7925,7 +7943,7 @@ cmsInt32Number CheckTransformLineStride(void) memset(out, 0, sizeof(out)); - t = cmsCreateTransform(pIn, TYPE_RGBA_8, pOut, TYPE_RGBA_8, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); + t = cmsCreateTransform(DbgThread(), pIn, TYPE_RGBA_8, pOut, TYPE_RGBA_8, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); cmsDoTransformLineStride(DbgThread(), t, buf2, out, 2, 4, 9, 9, 0, 0); @@ -7941,7 +7959,7 @@ cmsInt32Number CheckTransformLineStride(void) memset(out, 0, sizeof(out)); - t = cmsCreateTransform(pIn, TYPE_RGBA_16, pOut, TYPE_RGBA_16, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); + t = cmsCreateTransform(DbgThread(), pIn, TYPE_RGBA_16, pOut, TYPE_RGBA_16, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); cmsDoTransformLineStride(DbgThread(), t, buf3, out, 2, 4, 18, 18, 0, 0); @@ -7959,7 +7977,7 @@ cmsInt32Number CheckTransformLineStride(void) // From 8 to 16 - t = cmsCreateTransform(pIn, TYPE_RGBA_8, pOut, TYPE_RGBA_16, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); + t = cmsCreateTransform(DbgThread(), pIn, TYPE_RGBA_8, pOut, TYPE_RGBA_16, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); cmsDoTransformLineStride(DbgThread(), t, buf2, out, 2, 4, 9, 18, 0, 0); @@ -7985,9 +8003,10 @@ static int CheckPlanar8opt(void) { cmsHPROFILE aboveRGB = Create_AboveRGB(); - cmsHPROFILE sRGB = cmsCreate_sRGBProfile(); + cmsHPROFILE sRGB = cmsCreate_sRGBProfile(DbgThread()); - cmsHTRANSFORM transform = cmsCreateTransform(sRGB, TYPE_RGB_8_PLANAR, + cmsHTRANSFORM transform = cmsCreateTransform(DbgThread(), + sRGB, TYPE_RGB_8_PLANAR, aboveRGB, TYPE_RGB_8_PLANAR, INTENT_PERCEPTUAL, 0); @@ -8005,9 +8024,9 @@ static int CheckSE(void) { cmsHPROFILE input_profile = Create_AboveRGB(); - cmsHPROFILE output_profile = cmsCreate_sRGBProfile(); + cmsHPROFILE output_profile = cmsCreate_sRGBProfile(DbgThread()); - cmsHTRANSFORM tr = cmsCreateTransform(input_profile, TYPE_RGBA_8, output_profile, TYPE_RGBA_16_SE, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_COPY_ALPHA); + cmsHTRANSFORM tr = cmsCreateTransform(DbgThread(), input_profile, TYPE_RGBA_8, output_profile, TYPE_RGBA_16_SE, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_COPY_ALPHA); cmsUInt8Number rgba[4] = { 40, 41, 41, 0xfa }; cmsUInt16Number out[4]; @@ -8040,11 +8059,11 @@ int CheckForgedMPE(void) cmsHTRANSFORM hTransform; cmsUInt8Number output[4]; - srcProfile = cmsOpenProfileFromFile( "bad_mpe.icc", "r"); + srcProfile = cmsOpenProfileFromFile(DbgThread(), "bad_mpe.icc", "r"); if (!srcProfile) return 0; - dstProfile = cmsCreate_sRGBProfile(); + dstProfile = cmsCreate_sRGBProfile(DbgThread()); if (!dstProfile) { cmsCloseProfile(DbgThread(), srcProfile); return 0; @@ -8062,14 +8081,14 @@ int CheckForgedMPE(void) COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1); } - cmsSetLogErrorHandler(ErrorReportingFunction); + cmsSetLogErrorHandler(DbgThread(), ErrorReportingFunction); - hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile, + hTransform = cmsCreateTransform(DbgThread(), srcProfile, srcFormat, dstProfile, TYPE_BGR_8, intent, flags); cmsCloseProfile(DbgThread(), srcProfile); cmsCloseProfile(DbgThread(), dstProfile); - cmsSetLogErrorHandler(FatalErrorQuit); + cmsSetLogErrorHandler(DbgThread(), FatalErrorQuit); // Should report error if (!TrappedError) return 0; @@ -8109,11 +8128,11 @@ int CheckProofingIntersection(void) cmsHPROFILE profile_null, hnd1, hnd2; cmsHTRANSFORM transform; - hnd1 = cmsCreate_sRGBProfile(); + hnd1 = cmsCreate_sRGBProfile(DbgThread()); hnd2 = Create_AboveRGB(); - profile_null = cmsCreateNULLProfileTHR(DbgThread()); - transform = cmsCreateProofingTransformTHR(DbgThread(), + profile_null = cmsCreateNULLProfile(DbgThread()); + transform = cmsCreateProofingTransform(DbgThread(), hnd1, TYPE_RGB_FLT, profile_null, @@ -8140,10 +8159,12 @@ int CheckProofingIntersection(void) // -------------------------------------------------------------------------------------------------- -typedef struct {cmsUInt8Number r, g, b, a;} Scanline_rgb1; -typedef struct {cmsUInt16Number r, g, b, a;} Scanline_rgb2; -typedef struct {cmsUInt8Number r, g, b;} Scanline_rgb8; -typedef struct {cmsUInt16Number r, g, b;} Scanline_rgb0; +typedef struct {cmsUInt8Number r, g, b, a;} Scanline_rgba8; +typedef struct {cmsUInt16Number r, g, b, a;} Scanline_rgba16; +typedef struct {cmsFloat32Number r, g, b, a;} Scanline_rgba32; +typedef struct {cmsUInt8Number r, g, b;} Scanline_rgb8; +typedef struct {cmsUInt16Number r, g, b;} Scanline_rgb16; +typedef struct {cmsFloat32Number r, g, b;} Scanline_rgb32; static @@ -8158,47 +8179,98 @@ void PrintPerformance(cmsUInt32Number Bytes, cmsUInt32Number SizeOfPixel, cmsFlo cmsFloat64Number seconds = (cmsFloat64Number) diff / CLOCKS_PER_SEC; cmsFloat64Number mpix_sec = Bytes / (1024.0*1024.0*seconds*SizeOfPixel); - printf("%g MPixel/sec.\n", mpix_sec); + printf("%#4.3g MPixel/sec.\n", mpix_sec); fflush(stdout); } +static +void SpeedTest32bits(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent) +{ + cmsInt32Number r, g, b, j; + clock_t atime; + cmsFloat64Number diff; + cmsHTRANSFORM hlcmsxform; + Scanline_rgba32 *In; + cmsUInt32Number Mb; + cmsUInt32Number Interval = 4; // Power of 2 number to increment r,g,b values by in the loops to keep the test duration practically short + cmsUInt32Number NumPixels; + if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) + Die("Unable to open profiles"); + + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, TYPE_RGBA_FLT, + hlcmsProfileOut, TYPE_RGBA_FLT, Intent, cmsFLAGS_NOCACHE); + cmsCloseProfile(DbgThread(), hlcmsProfileIn); + cmsCloseProfile(DbgThread(), hlcmsProfileOut); + + NumPixels = 256 / Interval * 256 / Interval * 256 / Interval; + Mb = NumPixels * sizeof(Scanline_rgba32); + + In = (Scanline_rgba32 *) malloc(Mb); + + j = 0; + for (r=0; r < 256; r += Interval) + for (g=0; g < 256; g += Interval) + for (b=0; b < 256; b += Interval) { + + In[j].r = r / 256.0f; + In[j].g = g / 256.0f; + In[j].b = b / 256.0f; + In[j].a = (In[j].r + In[j].g + In[j].b) / 3; + + j++; + } + + + TitlePerformance(Title); + + atime = clock(); + + cmsDoTransform(DbgThread(), hlcmsxform, In, In, NumPixels); + + diff = clock() - atime; + free(In); + + PrintPerformance(Mb, sizeof(Scanline_rgba32), diff); + cmsDeleteTransform(DbgThread(), hlcmsxform); + +} static void SpeedTest16bits(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent) { - cmsInt32Number r, g, b, j; clock_t atime; cmsFloat64Number diff; cmsHTRANSFORM hlcmsxform; - Scanline_rgb0 *In; + Scanline_rgb16 *In; cmsUInt32Number Mb; if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) Die("Unable to open profiles"); - hlcmsxform = cmsCreateTransformTHR(DbgThread(), hlcmsProfileIn, TYPE_RGB_16, - hlcmsProfileOut, TYPE_RGB_16, Intent, cmsFLAGS_NOCACHE); + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, TYPE_RGB_16, + hlcmsProfileOut, TYPE_RGB_16, Intent, cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hlcmsProfileIn); cmsCloseProfile(DbgThread(), hlcmsProfileOut); - Mb = 256*256*256*sizeof(Scanline_rgb0); - In = (Scanline_rgb0*) malloc(Mb); + Mb = 256*256*256 * sizeof(Scanline_rgb16); + + In = (Scanline_rgb16*) malloc(Mb); j = 0; for (r=0; r < 256; r++) for (g=0; g < 256; g++) for (b=0; b < 256; b++) { - In[j].r = (cmsUInt16Number) ((r << 8) | r); - In[j].g = (cmsUInt16Number) ((g << 8) | g); - In[j].b = (cmsUInt16Number) ((b << 8) | b); + In[j].r = (cmsUInt16Number) ((r << 8) | r); + In[j].g = (cmsUInt16Number) ((g << 8) | g); + In[j].b = (cmsUInt16Number) ((b << 8) | b); - j++; - } + j++; + } TitlePerformance(Title); @@ -8210,7 +8282,63 @@ void SpeedTest16bits(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE diff = clock() - atime; free(In); - PrintPerformance(Mb, sizeof(Scanline_rgb0), diff); + PrintPerformance(Mb, sizeof(Scanline_rgb16), diff); + cmsDeleteTransform(DbgThread(), hlcmsxform); + +} + + +static +void SpeedTest32bitsCMYK(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut) +{ + cmsInt32Number r, g, b, j; + clock_t atime; + cmsFloat64Number diff; + cmsHTRANSFORM hlcmsxform; + Scanline_rgba32 *In; + cmsUInt32Number Mb; + cmsUInt32Number Interval = 4; // Power of 2 number to increment r,g,b values by in the loops to keep the test duration practically short + cmsUInt32Number NumPixels; + + if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) + Die("Unable to open profiles"); + + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, TYPE_CMYK_FLT, + hlcmsProfileOut, TYPE_CMYK_FLT, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE); + cmsCloseProfile(DbgThread(), hlcmsProfileIn); + cmsCloseProfile(DbgThread(), hlcmsProfileOut); + + NumPixels = 256 / Interval * 256 / Interval * 256 / Interval; + Mb = NumPixels * sizeof(Scanline_rgba32); + + In = (Scanline_rgba32 *) malloc(Mb); + + j = 0; + for (r=0; r < 256; r += Interval) + for (g=0; g < 256; g += Interval) + for (b=0; b < 256; b += Interval) { + + In[j].r = r / 256.0f; + In[j].g = g / 256.0f; + In[j].b = b / 256.0f; + In[j].a = (In[j].r + In[j].g + In[j].b) / 3; + + j++; + } + + + TitlePerformance(Title); + + atime = clock(); + + cmsDoTransform(DbgThread(), hlcmsxform, In, In, NumPixels); + + diff = clock() - atime; + + free(In); + + PrintPerformance(Mb, sizeof(Scanline_rgba32), diff); + cmsDeleteTransform(DbgThread(), hlcmsxform); } @@ -8223,33 +8351,33 @@ void SpeedTest16bitsCMYK(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPRO clock_t atime; cmsFloat64Number diff; cmsHTRANSFORM hlcmsxform; - Scanline_rgb2 *In; + Scanline_rgba16 *In; cmsUInt32Number Mb; if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) Die("Unable to open profiles"); - hlcmsxform = cmsCreateTransformTHR(DbgThread(), hlcmsProfileIn, TYPE_CMYK_16, - hlcmsProfileOut, TYPE_CMYK_16, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE); + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, TYPE_CMYK_16, + hlcmsProfileOut, TYPE_CMYK_16, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hlcmsProfileIn); cmsCloseProfile(DbgThread(), hlcmsProfileOut); - Mb = 256*256*256*sizeof(Scanline_rgb2); + Mb = 256*256*256*sizeof(Scanline_rgba16); - In = (Scanline_rgb2*) malloc(Mb); + In = (Scanline_rgba16*) malloc(Mb); j = 0; for (r=0; r < 256; r++) for (g=0; g < 256; g++) for (b=0; b < 256; b++) { - In[j].r = (cmsUInt16Number) ((r << 8) | r); - In[j].g = (cmsUInt16Number) ((g << 8) | g); - In[j].b = (cmsUInt16Number) ((b << 8) | b); - In[j].a = 0; + In[j].r = (cmsUInt16Number) ((r << 8) | r); + In[j].g = (cmsUInt16Number) ((g << 8) | g); + In[j].b = (cmsUInt16Number) ((b << 8) | b); + In[j].a = 0; - j++; - } + j++; + } TitlePerformance(Title); @@ -8262,7 +8390,7 @@ void SpeedTest16bitsCMYK(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPRO free(In); - PrintPerformance(Mb, sizeof(Scanline_rgb2), diff); + PrintPerformance(Mb, sizeof(Scanline_rgba16), diff); cmsDeleteTransform(DbgThread(), hlcmsxform); @@ -8282,7 +8410,7 @@ void SpeedTest8bits(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) Die("Unable to open profiles"); - hlcmsxform = cmsCreateTransformTHR(DbgThread(), hlcmsProfileIn, TYPE_RGB_8, + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, TYPE_RGB_8, hlcmsProfileOut, TYPE_RGB_8, Intent, cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hlcmsProfileIn); cmsCloseProfile(DbgThread(), hlcmsProfileOut); @@ -8327,20 +8455,20 @@ void SpeedTest8bitsCMYK(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROF clock_t atime; cmsFloat64Number diff; cmsHTRANSFORM hlcmsxform; - Scanline_rgb2 *In; + Scanline_rgba8 *In; cmsUInt32Number Mb; if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) Die("Unable to open profiles"); - hlcmsxform = cmsCreateTransformTHR(DbgThread(), hlcmsProfileIn, TYPE_CMYK_8, + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, TYPE_CMYK_8, hlcmsProfileOut, TYPE_CMYK_8, INTENT_PERCEPTUAL, cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hlcmsProfileIn); cmsCloseProfile(DbgThread(), hlcmsProfileOut); - Mb = 256*256*256*sizeof(Scanline_rgb2); + Mb = 256*256*256*sizeof(Scanline_rgba8); - In = (Scanline_rgb2*) malloc(Mb); + In = (Scanline_rgba8*) malloc(Mb); j = 0; for (r=0; r < 256; r++) @@ -8365,7 +8493,7 @@ void SpeedTest8bitsCMYK(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROF free(In); - PrintPerformance(Mb, sizeof(Scanline_rgb2), diff); + PrintPerformance(Mb, sizeof(Scanline_rgba8), diff); cmsDeleteTransform(DbgThread(), hlcmsxform); @@ -8374,6 +8502,100 @@ void SpeedTest8bitsCMYK(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROF static +void SpeedTest32bitsGray(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent) +{ + cmsInt32Number r, g, b, j; + clock_t atime; + cmsFloat64Number diff; + cmsHTRANSFORM hlcmsxform; + cmsFloat32Number *In; + cmsUInt32Number Mb; + cmsUInt32Number Interval = 4; // Power of 2 number to increment r,g,b values by in the loops to keep the test duration practically short + cmsUInt32Number NumPixels; + + if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) + Die("Unable to open profiles"); + + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, + TYPE_GRAY_FLT, hlcmsProfileOut, TYPE_GRAY_FLT, Intent, cmsFLAGS_NOCACHE); + cmsCloseProfile(DbgThread(), hlcmsProfileIn); + cmsCloseProfile(DbgThread(), hlcmsProfileOut); + + NumPixels = 256 / Interval * 256 / Interval * 256 / Interval; + Mb = NumPixels * sizeof(cmsFloat32Number); + + In = (cmsFloat32Number*) malloc(Mb); + + j = 0; + for (r = 0; r < 256; r += Interval) + for (g = 0; g < 256; g += Interval) + for (b = 0; b < 256; b += Interval) { + + In[j] = ((r + g + b) / 768.0f); + + j++; + } + + TitlePerformance(Title); + + atime = clock(); + + cmsDoTransform(DbgThread(), hlcmsxform, In, In, NumPixels); + + diff = clock() - atime; + free(In); + + PrintPerformance(Mb, sizeof(cmsFloat32Number), diff); + cmsDeleteTransform(DbgThread(), hlcmsxform); +} + + +static +void SpeedTest16bitsGray(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent) +{ + cmsInt32Number r, g, b, j; + clock_t atime; + cmsFloat64Number diff; + cmsHTRANSFORM hlcmsxform; + cmsUInt16Number *In; + cmsUInt32Number Mb; + + if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) + Die("Unable to open profiles"); + + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, + TYPE_GRAY_16, hlcmsProfileOut, TYPE_GRAY_16, Intent, cmsFLAGS_NOCACHE); + cmsCloseProfile(DbgThread(), hlcmsProfileIn); + cmsCloseProfile(DbgThread(), hlcmsProfileOut); + Mb = 256*256*256 * sizeof(cmsUInt16Number); + + In = (cmsUInt16Number *) malloc(Mb); + + j = 0; + for (r=0; r < 256; r++) + for (g=0; g < 256; g++) + for (b=0; b < 256; b++) { + + In[j] = (cmsUInt16Number) ((r + g + b) / 3); + + j++; + } + + TitlePerformance(Title); + + atime = clock(); + + cmsDoTransform(DbgThread(), hlcmsxform, In, In, 256*256*256); + + diff = clock() - atime; + free(In); + + PrintPerformance(Mb, sizeof(cmsUInt16Number), diff); + cmsDeleteTransform(DbgThread(), hlcmsxform); +} + + +static void SpeedTest8bitsGray(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileOut, cmsInt32Number Intent) { cmsInt32Number r, g, b, j; @@ -8387,8 +8609,8 @@ void SpeedTest8bitsGray(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROF if (hlcmsProfileIn == NULL || hlcmsProfileOut == NULL) Die("Unable to open profiles"); - hlcmsxform = cmsCreateTransformTHR(DbgThread(), hlcmsProfileIn, - TYPE_GRAY_8, hlcmsProfileOut, TYPE_GRAY_8, Intent, cmsFLAGS_NOCACHE); + hlcmsxform = cmsCreateTransform(DbgThread(), hlcmsProfileIn, + TYPE_GRAY_8, hlcmsProfileOut, TYPE_GRAY_8, Intent, cmsFLAGS_NOCACHE); cmsCloseProfile(DbgThread(), hlcmsProfileIn); cmsCloseProfile(DbgThread(), hlcmsProfileOut); Mb = 256*256*256; @@ -8400,10 +8622,10 @@ void SpeedTest8bitsGray(const char * Title, cmsHPROFILE hlcmsProfileIn, cmsHPROF for (g=0; g < 256; g++) for (b=0; b < 256; b++) { - In[j] = (cmsUInt8Number) r; + In[j] = (cmsUInt8Number) r; - j++; - } + j++; + } TitlePerformance(Title); @@ -8427,7 +8649,7 @@ cmsHPROFILE CreateCurves(void) cmsHPROFILE h; Transfer[0] = Transfer[1] = Transfer[2] = Gamma; - h = cmsCreateLinearizationDeviceLink(cmsSigRgbData, Transfer); + h = cmsCreateLinearizationDeviceLink(DbgThread(), cmsSigRgbData, Transfer); cmsFreeToneCurve(DbgThread(), Gamma); @@ -8442,45 +8664,80 @@ void SpeedTest(void) printf( "=================================\n\n"); fflush(stdout); - SpeedTest16bits("16 bits on CLUT profiles", - cmsOpenProfileFromFile( "test5.icc", "r"), - cmsOpenProfileFromFile( "test3.icc", "r"), INTENT_PERCEPTUAL); - SpeedTest8bits("8 bits on CLUT profiles", - cmsOpenProfileFromFile("test5.icc", "r"), - cmsOpenProfileFromFile("test3.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test3.icc", "r"), INTENT_PERCEPTUAL); + SpeedTest16bits("16 bits on CLUT profiles", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test3.icc", "r"), INTENT_PERCEPTUAL); + + SpeedTest32bits("32 bits on CLUT profiles", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test3.icc", "r"), INTENT_PERCEPTUAL); + + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SpeedTest8bits("8 bits on Matrix-Shaper profiles", - cmsOpenProfileFromFile("test5.icc", "r"), - cmsOpenProfileFromFile("aRGBlcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), INTENT_PERCEPTUAL); - SpeedTest8bits("8 bits on SAME Matrix-Shaper profiles", - cmsOpenProfileFromFile("test5.icc", "r"), - cmsOpenProfileFromFile("test5.icc", "r"), + SpeedTest16bits("16 bits on Matrix-Shaper profiles", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), INTENT_PERCEPTUAL); - SpeedTest8bits("8 bits on Matrix-Shaper profiles (AbsCol)", - cmsOpenProfileFromFile("test5.icc", "r"), - cmsOpenProfileFromFile("aRGBlcms2.icc", "r"), - INTENT_ABSOLUTE_COLORIMETRIC); + SpeedTest32bits("32 bits on Matrix-Shaper profiles", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), + INTENT_PERCEPTUAL); - SpeedTest16bits("16 bits on Matrix-Shaper profiles", - cmsOpenProfileFromFile("test5.icc", "r"), - cmsOpenProfileFromFile("aRGBlcms2.icc", "r"), + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + SpeedTest8bits("8 bits on SAME Matrix-Shaper profiles", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), INTENT_PERCEPTUAL); SpeedTest16bits("16 bits on SAME Matrix-Shaper profiles", - cmsOpenProfileFromFile("aRGBlcms2.icc", "r"), - cmsOpenProfileFromFile("aRGBlcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), INTENT_PERCEPTUAL); + SpeedTest32bits("32 bits on SAME Matrix-Shaper profiles", + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), + INTENT_PERCEPTUAL); + + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + SpeedTest8bits("8 bits on Matrix-Shaper profiles (AbsCol)", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), + INTENT_ABSOLUTE_COLORIMETRIC); + SpeedTest16bits("16 bits on Matrix-Shaper profiles (AbsCol)", - cmsOpenProfileFromFile("test5.icc", "r"), - cmsOpenProfileFromFile("aRGBlcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), + INTENT_ABSOLUTE_COLORIMETRIC); + + SpeedTest32bits("32 bits on Matrix-Shaper profiles (AbsCol)", + cmsOpenProfileFromFile(DbgThread(), "test5.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "aRGBlcms2.icc", "r"), INTENT_ABSOLUTE_COLORIMETRIC); + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SpeedTest8bits("8 bits on curves", CreateCurves(), CreateCurves(), @@ -8491,25 +8748,76 @@ void SpeedTest(void) CreateCurves(), INTENT_PERCEPTUAL); + SpeedTest32bits("32 bits on curves", + CreateCurves(), + CreateCurves(), + INTENT_PERCEPTUAL); + + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SpeedTest8bitsCMYK("8 bits on CMYK profiles", - cmsOpenProfileFromFile("test1.icc", "r"), - cmsOpenProfileFromFile("test2.icc", "r")); + cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test2.icc", "r")); SpeedTest16bitsCMYK("16 bits on CMYK profiles", - cmsOpenProfileFromFile("test1.icc", "r"), - cmsOpenProfileFromFile("test2.icc", "r")); + cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test2.icc", "r")); + + SpeedTest32bitsCMYK("32 bits on CMYK profiles", + cmsOpenProfileFromFile(DbgThread(), "test1.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "test2.icc", "r")); + + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SpeedTest8bitsGray("8 bits on gray-to gray", - cmsOpenProfileFromFile("gray3lcms2.icc", "r"), - cmsOpenProfileFromFile("graylcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + cmsOpenProfileFromFile(DbgThread(), "gray3lcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + + SpeedTest16bitsGray("16 bits on gray-to gray", + cmsOpenProfileFromFile(DbgThread(), "gray3lcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + + SpeedTest32bitsGray("32 bits on gray-to gray", + cmsOpenProfileFromFile(DbgThread(), "gray3lcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SpeedTest8bitsGray("8 bits on gray-to-lab gray", - cmsOpenProfileFromFile("graylcms2.icc", "r"), - cmsOpenProfileFromFile("glablcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "glablcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + + SpeedTest16bitsGray("16 bits on gray-to-lab gray", + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "glablcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + + SpeedTest32bitsGray("32 bits on gray-to-lab gray", + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "glablcms2.icc", "r"), INTENT_RELATIVE_COLORIMETRIC); + + printf("\n"); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SpeedTest8bitsGray("8 bits on SAME gray-to-gray", - cmsOpenProfileFromFile("graylcms2.icc", "r"), - cmsOpenProfileFromFile("graylcms2.icc", "r"), INTENT_PERCEPTUAL); + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), INTENT_PERCEPTUAL); + + SpeedTest16bitsGray("16 bits on SAME gray-to-gray", + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), INTENT_PERCEPTUAL); + + SpeedTest32bitsGray("32 bits on SAME gray-to-gray", + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), + cmsOpenProfileFromFile(DbgThread(), "graylcms2.icc", "r"), INTENT_PERCEPTUAL); + + printf("\n"); } @@ -8524,7 +8832,7 @@ void PrintSupportedIntents(void) cmsUInt32Number Codes[200]; char* Descriptions[200]; - n = cmsGetSupportedIntents(200, Codes, Descriptions); + n = cmsGetSupportedIntents(DbgThread(), 200, Codes, Descriptions); printf("Supported intents:\n"); for (i=0; i < n; i++) { @@ -8575,17 +8883,17 @@ int main(int argc, char* argv[]) printf("Installing debug memory plug-in ... "); - cmsPluginTHR(DbgThread(), &DebugMemHandler); + cmsPlugin(DbgThread(), &DebugMemHandler); printf("done.\n"); printf("Installing error logger ... "); - cmsSetLogErrorHandler(FatalErrorQuit); + cmsSetLogErrorHandler(DbgThread(), FatalErrorQuit); printf("done.\n"); PrintSupportedIntents(); Check("Base types", CheckBaseTypes); - Check("endianess", CheckEndianess); + Check("endianness", CheckEndianness); Check("quick floor", CheckQuickFloor); Check("quick floor word", CheckQuickFloorWord); Check("Fixed point 15.16 representation", CheckFixedPoint15_16); @@ -8771,7 +9079,7 @@ int main(int argc, char* argv[]) Check("RGB->Lab->RGB with alpha on FLT", ChecksRGB2LabFLT); Check("Parametric curve on Rec709", CheckParametricRec709); Check("Floating Point sampled curve with non-zero start", CheckFloatSamples); - Check("Floating Point segmented curve with short sampled segement", CheckFloatSegments); + Check("Floating Point segmented curve with short sampled segment", CheckFloatSegments); Check("Read RAW portions", CheckReadRAW); Check("Check MetaTag", CheckMeta); Check("Null transform on floats", CheckFloatNULLxform); diff --git a/lcms2mt/testbed/testcms2.h b/lcms2mt/testbed/testcms2.h index 043e64b1c..862f0ace1 100755 --- a/lcms2mt/testbed/testcms2.h +++ b/lcms2mt/testbed/testcms2.h @@ -50,7 +50,7 @@ cmsBool IsGoodWordPrec(const char *title, cmsUInt16Number in, cmsUInt16Number ou void* PluginMemHandler(void); cmsContext WatchDogContext(void* usr); -void ResetFatalError(void); +void ResetFatalError(cmsContext ContextID); void Die(const char* Reason, ...); void Dot(void); void Fail(const char* frm, ...); diff --git a/lcms2mt/testbed/testplugin.c b/lcms2mt/testbed/testplugin.c index f871ddb6f..b70e7d95c 100755 --- a/lcms2mt/testbed/testplugin.c +++ b/lcms2mt/testbed/testplugin.c @@ -27,7 +27,7 @@ #include "testcms2.h" // -------------------------------------------------------------------------------------------------- -// Auxiliar, duplicate a context and mark the block as non-debug because in this case the allocator +// Auxiliary, duplicate a context and mark the block as non-debug because in this case the allocator // and deallocator have different context owners // -------------------------------------------------------------------------------------------------- @@ -64,7 +64,7 @@ cmsInt32Number CheckAllocContext(void) c2 = cmsCreateContext(PluginMemHandler(), NULL); DebugMemDontCheckThis(c2); - cmsPluginTHR(c1, PluginMemHandler()); // Now the context have custom allocators + cmsPlugin(c1, PluginMemHandler()); // Now the context have custom allocators c3 = DupContext(c1, NULL); c4 = DupContext(c2, NULL); @@ -150,11 +150,11 @@ cmsInt32Number CheckAlarmColorsContext(void) c1 = WatchDogContext(NULL); - cmsSetAlarmCodesTHR(c1, codes); + cmsSetAlarmCodes(c1, codes); c2 = DupContext(c1, NULL); c3 = DupContext(c2, NULL); - cmsGetAlarmCodesTHR(c3, out); + cmsGetAlarmCodes(c3, out); rc = 1; for (i=0; i < 16; i++) { @@ -184,22 +184,22 @@ cmsInt32Number CheckAdaptationStateContext(void) cmsContext c1, c2, c3; cmsFloat64Number old1, old2; - old1 = cmsSetAdaptationStateTHR(NULL, -1); + old1 = cmsSetAdaptationState(NULL, -1); c1 = WatchDogContext(NULL); - cmsSetAdaptationStateTHR(c1, 0.7); + cmsSetAdaptationState(c1, 0.7); c2 = DupContext(c1, NULL); c3 = DupContext(c2, NULL); - rc = IsGoodVal("Adaptation state", cmsSetAdaptationStateTHR(c3, -1), 0.7, 0.001); + rc = IsGoodVal("Adaptation state", cmsSetAdaptationState(c3, -1), 0.7, 0.001); cmsDeleteContext(c1); cmsDeleteContext(c2); cmsDeleteContext(c3); - old2 = cmsSetAdaptationStateTHR(NULL, -1); + old2 = cmsSetAdaptationState(NULL, -1); if (old1 != old2) { Fail("Adaptation state has changed"); @@ -296,7 +296,7 @@ cmsInt32Number CheckInterp1DPlugin(void) goto Error; } - cmsPluginTHR(ctx, &InterpPluginSample); + cmsPlugin(ctx, &InterpPluginSample); cpy = DupContext(ctx, NULL); if (cpy == NULL) { @@ -371,7 +371,7 @@ cmsInt32Number CheckInterp3DPlugin(void) return 0; } - cmsPluginTHR(ctx, &InterpPluginSample); + cmsPlugin(ctx, &InterpPluginSample); p = cmsPipelineAlloc(ctx, 3, 3); clut = cmsStageAllocCLut16bit(ctx, 2, 3, 3, identity); @@ -555,11 +555,11 @@ cmsInt32Number CheckParametricCurvePlugin(void) ctx = WatchDogContext(NULL); - cmsPluginTHR(ctx, &CurvePluginSample); + cmsPlugin(ctx, &CurvePluginSample); cpy = DupContext(ctx, NULL); - cmsPluginTHR(cpy, &CurvePluginSample2); + cmsPlugin(cpy, &CurvePluginSample2); sinus = cmsBuildParametricToneCurve(cpy, TYPE_SIN, &scale); cosinus = cmsBuildParametricToneCurve(cpy, TYPE_COS, &scale); @@ -715,13 +715,13 @@ cmsInt32Number CheckFormattersPlugin(void) cmsUInt16Number result[4]; int i; - cmsPluginTHR(ctx, &FormattersPluginSample); + cmsPlugin(ctx, &FormattersPluginSample); cpy = DupContext(ctx, NULL); - cmsPluginTHR(cpy, &FormattersPluginSample2); + cmsPlugin(cpy, &FormattersPluginSample2); - xform = cmsCreateTransformTHR(cpy, NULL, TYPE_RGB_565, NULL, TYPE_RGB_565, INTENT_PERCEPTUAL, cmsFLAGS_NULLTRANSFORM); + xform = cmsCreateTransform(cpy, NULL, TYPE_RGB_565, NULL, TYPE_RGB_565, INTENT_PERCEPTUAL, cmsFLAGS_NULLTRANSFORM); cmsDoTransform(cpy, xform, stream, result, 4); @@ -802,7 +802,7 @@ cmsInt32Number CheckTagTypePlugin(void) cmsUInt32Number clen = 0; ctx = WatchDogContext(NULL); - cmsPluginTHR(ctx, &TagTypePluginSample); + cmsPlugin(ctx, &TagTypePluginSample); cpy = DupContext(ctx, NULL); @@ -840,8 +840,8 @@ cmsInt32Number CheckTagTypePlugin(void) cmsCloseProfile(cpy, h); - cmsSetLogErrorHandler(NULL); - h = cmsOpenProfileFromMem(data, clen); + cmsSetLogErrorHandler(cpy, NULL); + h = cmsOpenProfileFromMem(cpy, data, clen); if (h == NULL) { Fail("Open profile failed"); goto Error; @@ -855,9 +855,9 @@ cmsInt32Number CheckTagTypePlugin(void) } cmsCloseProfile(cpy, h); - ResetFatalError(); + ResetFatalError(cpy); - h = cmsOpenProfileFromMemTHR(cpy, data, clen); + h = cmsOpenProfileFromMem(cpy, data, clen); if (h == NULL) { Fail("Open profile from mem failed"); goto Error; @@ -959,7 +959,7 @@ cmsInt32Number CheckMPEPlugin(void) cmsPipeline* pipe; ctx = WatchDogContext(NULL); - cmsPluginTHR(ctx, &MPEPluginSample); + cmsPlugin(ctx, &MPEPluginSample); cpy = DupContext(ctx, NULL); @@ -1015,8 +1015,8 @@ cmsInt32Number CheckMPEPlugin(void) cmsCloseProfile(cpy, h); - cmsSetLogErrorHandler(NULL); - h = cmsOpenProfileFromMem(data, clen); + cmsSetLogErrorHandler(cpy, NULL); + h = cmsOpenProfileFromMem(cpy, data, clen); if (h == NULL) { Fail("Open profile failed"); goto Error; @@ -1032,9 +1032,9 @@ cmsInt32Number CheckMPEPlugin(void) cmsCloseProfile(cpy, h); - ResetFatalError(); + ResetFatalError(cpy); - h = cmsOpenProfileFromMemTHR(cpy, data, clen); + h = cmsOpenProfileFromMem(cpy, data, clen); if (h == NULL) { Fail("Open profile from mem failed"); goto Error; @@ -1133,15 +1133,15 @@ cmsInt32Number CheckOptimizationPlugin(void) cmsHPROFILE h; int i; - cmsPluginTHR(ctx, &OptimizationPluginSample); + cmsPlugin(ctx, &OptimizationPluginSample); cpy = DupContext(ctx, NULL); Linear[0] = cmsBuildGamma(cpy, 1.0); - h = cmsCreateLinearizationDeviceLinkTHR(cpy, cmsSigGrayData, Linear); + h = cmsCreateLinearizationDeviceLink(cpy, cmsSigGrayData, Linear); cmsFreeToneCurve(cpy, Linear[0]); - xform = cmsCreateTransformTHR(cpy, h, TYPE_GRAY_8, h, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); + xform = cmsCreateTransform(cpy, h, TYPE_GRAY_8, h, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); cmsCloseProfile(cpy, h); cmsDoTransform(cpy, xform, In, Out, 4); @@ -1222,19 +1222,19 @@ cmsInt32Number CheckIntentPlugin(void) cmsUInt8Number Out[4]; int i; - cmsPluginTHR(ctx, &IntentPluginSample); + cmsPlugin(ctx, &IntentPluginSample); cpy = DupContext(ctx, NULL); Linear1 = cmsBuildGamma(cpy, 3.0); Linear2 = cmsBuildGamma(cpy, 0.1); - h1 = cmsCreateLinearizationDeviceLinkTHR(cpy, cmsSigGrayData, &Linear1); - h2 = cmsCreateLinearizationDeviceLinkTHR(cpy, cmsSigGrayData, &Linear2); + h1 = cmsCreateLinearizationDeviceLink(cpy, cmsSigGrayData, &Linear1); + h2 = cmsCreateLinearizationDeviceLink(cpy, cmsSigGrayData, &Linear2); cmsFreeToneCurve(cpy, Linear1); cmsFreeToneCurve(cpy, Linear2); - xform = cmsCreateTransformTHR(cpy, h1, TYPE_GRAY_8, h2, TYPE_GRAY_8, INTENT_DECEPTIVE, 0); + xform = cmsCreateTransform(cpy, h1, TYPE_GRAY_8, h2, TYPE_GRAY_8, INTENT_DECEPTIVE, 0); cmsCloseProfile(cpy,h1); cmsCloseProfile(cpy, h2); cmsDoTransform(cpy, xform, In, Out, 4); @@ -1311,15 +1311,15 @@ cmsInt32Number CheckTransformPlugin(void) cmsHPROFILE h; int i; - cmsPluginTHR(ctx, &FullTransformPluginSample); + cmsPlugin(ctx, &FullTransformPluginSample); cpy = DupContext(ctx, NULL); Linear = cmsBuildGamma(cpy, 1.0); - h = cmsCreateLinearizationDeviceLinkTHR(cpy, cmsSigGrayData, &Linear); + h = cmsCreateLinearizationDeviceLink(cpy, cmsSigGrayData, &Linear); cmsFreeToneCurve(cpy, Linear); - xform = cmsCreateTransformTHR(cpy, h, TYPE_GRAY_8, h, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); + xform = cmsCreateTransform(cpy, h, TYPE_GRAY_8, h, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); cmsCloseProfile(cpy, h); cmsDoTransform(cpy, xform, In, Out, 4); @@ -1402,15 +1402,15 @@ cmsInt32Number CheckMutexPlugin(void) int i; - cmsPluginTHR(ctx, &MutexPluginSample); + cmsPlugin(ctx, &MutexPluginSample); cpy = DupContext(ctx, NULL); Linear = cmsBuildGamma(cpy, 1.0); - h = cmsCreateLinearizationDeviceLinkTHR(cpy, cmsSigGrayData, &Linear); + h = cmsCreateLinearizationDeviceLink(cpy, cmsSigGrayData, &Linear); cmsFreeToneCurve(cpy, Linear); - xform = cmsCreateTransformTHR(cpy, h, TYPE_GRAY_8, h, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); + xform = cmsCreateTransform(cpy, h, TYPE_GRAY_8, h, TYPE_GRAY_8, INTENT_PERCEPTUAL, 0); cmsCloseProfile(cpy, h); cmsDoTransform(cpy, xform, In, Out, 4); diff --git a/lcms2mt/testbed/zoo_icc.c b/lcms2mt/testbed/zoo_icc.c index 05c09d768..06d058878 100755 --- a/lcms2mt/testbed/zoo_icc.c +++ b/lcms2mt/testbed/zoo_icc.c @@ -163,7 +163,7 @@ cmsInt32Number CheckSingleSpecimen(cmsContext ContextID, const char* Profile) sprintf(BuffSrc, "%s%s", ZOOfolder, Profile); sprintf(BuffDst, "%s%s", ZOOwrite, Profile); - h = cmsOpenProfileFromFile(BuffSrc, "r"); + h = cmsOpenProfileFromFile(ContextID, BuffSrc, "r"); if (h == NULL) return 0; printf("%s\n", Profile); @@ -177,7 +177,7 @@ cmsInt32Number CheckSingleSpecimen(cmsContext ContextID, const char* Profile) cmsSaveProfileToFile(ContextID, h, BuffDst); cmsCloseProfile(ContextID, h); - h = cmsOpenProfileFromFile(BuffDst, "r"); + h = cmsOpenProfileFromFile(ContextID, BuffDst, "r"); if (h == NULL) return 0; ReadAllTags(ContextID, h); @@ -197,7 +197,7 @@ cmsInt32Number CheckRAWSpecimen(cmsContext ContextID, const char* Profile) sprintf(BuffSrc, "%s%s", ZOOfolder, Profile); sprintf(BuffDst, "%s%s", ZOORawWrite, Profile); - h = cmsOpenProfileFromFile(BuffSrc, "r"); + h = cmsOpenProfileFromFile(ContextID, BuffSrc, "r"); if (h == NULL) return 0; ReadAllTags(ContextID, h); @@ -205,7 +205,7 @@ cmsInt32Number CheckRAWSpecimen(cmsContext ContextID, const char* Profile) cmsSaveProfileToFile(ContextID, h, BuffDst); cmsCloseProfile(ContextID, h); - h = cmsOpenProfileFromFile(BuffDst, "r"); + h = cmsOpenProfileFromFile(ContextID, BuffDst, "r"); if (h == NULL) return 0; ReadAllTags(ContextID, h); cmsCloseProfile(ContextID, h); @@ -238,7 +238,7 @@ int count_stats(cmsContext ContextID, const char* Profile) sprintf(BuffSrc, "%s%s", ZOOfolder, Profile); - h = cmsOpenProfileFromFile(BuffSrc, "r"); + h = cmsOpenProfileFromFile(ContextID, BuffSrc, "r"); if (h == NULL) return 0; @@ -278,7 +278,7 @@ void CheckProfileZOO(cmsContext ContextID) struct _finddata_t c_file; intptr_t hFile; - cmsSetLogErrorHandler(NULL); + cmsSetLogErrorHandler(ContextID, NULL); if ( (hFile = _findfirst("c:\\colormaps\\*.*", &c_file)) == -1L ) printf("No files in current directory"); @@ -303,7 +303,7 @@ void CheckProfileZOO(cmsContext ContextID) _findclose(hFile); } - ResetFatalError(); + ResetFatalError(ContextID); } #endif diff --git a/lcms2mt/utils/common/utils.h b/lcms2mt/utils/common/utils.h index 1572ac1ac..4df35b076 100644 --- a/lcms2mt/utils/common/utils.h +++ b/lcms2mt/utils/common/utils.h @@ -55,7 +55,7 @@ // Init the utility functions -void InitUtils(const char* PName); +void InitUtils(cmsContext ContextID, const char* PName); // Fatal Error (print the message and exit(1))--------------------------------------------- @@ -82,7 +82,7 @@ void PrintProfileInformation(cmsContext ContextID, cmsHPROFILE h); // --------------------------------------------------------------------------------- -void PrintRenderingIntents(void); +void PrintRenderingIntents(cmsContext ContextID); void PrintBuiltins(void); // --------------------------------------------------------------------------------- diff --git a/lcms2mt/utils/common/vprf.c b/lcms2mt/utils/common/vprf.c index 7ba1e200a..d2e1efc0e 100644 --- a/lcms2mt/utils/common/vprf.c +++ b/lcms2mt/utils/common/vprf.c @@ -56,12 +56,12 @@ void MyErrorLogHandler(cmsContext ContextID, cmsUInt32Number ErrorCode, const ch } -void InitUtils(const char* PName) +void InitUtils(cmsContext ContextID, const char* PName) { strncpy(ProgramName, PName, sizeof(ProgramName)); ProgramName[sizeof(ProgramName)-1] = 0; - cmsSetLogErrorHandler(MyErrorLogHandler); + cmsSetLogErrorHandler(ContextID, MyErrorLogHandler); } @@ -69,32 +69,32 @@ void InitUtils(const char* PName) cmsHPROFILE OpenStockProfile(cmsContext ContextID, const char* File) { if (!File) - return cmsCreate_sRGBProfileTHR(ContextID); + return cmsCreate_sRGBProfile(ContextID); if (cmsstrcasecmp(File, "*Lab2") == 0) - return cmsCreateLab2ProfileTHR(ContextID, NULL); + return cmsCreateLab2Profile(ContextID, NULL); if (cmsstrcasecmp(File, "*Lab4") == 0) - return cmsCreateLab4ProfileTHR(ContextID, NULL); + return cmsCreateLab4Profile(ContextID, NULL); if (cmsstrcasecmp(File, "*Lab") == 0) - return cmsCreateLab4ProfileTHR(ContextID, NULL); + return cmsCreateLab4Profile(ContextID, NULL); if (cmsstrcasecmp(File, "*LabD65") == 0) { cmsCIExyY D65xyY; cmsWhitePointFromTemp(ContextID, &D65xyY, 6504); - return cmsCreateLab4ProfileTHR(ContextID, &D65xyY); + return cmsCreateLab4Profile(ContextID, &D65xyY); } if (cmsstrcasecmp(File, "*XYZ") == 0) - return cmsCreateXYZProfileTHR(ContextID); + return cmsCreateXYZProfile(ContextID); if (cmsstrcasecmp(File, "*Gray22") == 0) { cmsToneCurve* Curve = cmsBuildGamma(ContextID, 2.2); - cmsHPROFILE hProfile = cmsCreateGrayProfileTHR(ContextID, cmsD50_xyY(ContextID), Curve); + cmsHPROFILE hProfile = cmsCreateGrayProfile(ContextID, cmsD50_xyY(ContextID), Curve); cmsFreeToneCurve(ContextID, Curve); return hProfile; } @@ -102,16 +102,16 @@ cmsHPROFILE OpenStockProfile(cmsContext ContextID, const char* File) if (cmsstrcasecmp(File, "*Gray30") == 0) { cmsToneCurve* Curve = cmsBuildGamma(ContextID, 3.0); - cmsHPROFILE hProfile = cmsCreateGrayProfileTHR(ContextID, cmsD50_xyY(ContextID), Curve); + cmsHPROFILE hProfile = cmsCreateGrayProfile(ContextID, cmsD50_xyY(ContextID), Curve); cmsFreeToneCurve(ContextID, Curve); return hProfile; } if (cmsstrcasecmp(File, "*srgb") == 0) - return cmsCreate_sRGBProfileTHR(ContextID); + return cmsCreate_sRGBProfile(ContextID); if (cmsstrcasecmp(File, "*null") == 0) - return cmsCreateNULLProfileTHR(ContextID); + return cmsCreateNULLProfile(ContextID); if (cmsstrcasecmp(File, "*Lin2222") == 0) { @@ -121,13 +121,13 @@ cmsHPROFILE OpenStockProfile(cmsContext ContextID, const char* File) cmsHPROFILE hProfile; Gamma4[0] = Gamma4[1] = Gamma4[2] = Gamma4[3] = Gamma; - hProfile = cmsCreateLinearizationDeviceLink(cmsSigCmykData, Gamma4); + hProfile = cmsCreateLinearizationDeviceLink(ContextID, cmsSigCmykData, Gamma4); cmsFreeToneCurve(ContextID, Gamma); return hProfile; } - return cmsOpenProfileFromFileTHR(ContextID, File, "r"); + return cmsOpenProfileFromFile(ContextID, File, "r"); } // Help on available built-ins @@ -225,7 +225,7 @@ void PrintProfileInformation(cmsContext ContextID, cmsHPROFILE hInput) // ----------------------------------------------------------------------------- -void PrintRenderingIntents(void) +void PrintRenderingIntents(cmsContext ContextID) { cmsUInt32Number Codes[200]; char* Descriptions[200]; @@ -233,7 +233,7 @@ void PrintRenderingIntents(void) fprintf(stderr, "%ct<n> rendering intent:\n\n", SW); - n = cmsGetSupportedIntents(200, Codes, Descriptions); + n = cmsGetSupportedIntents(ContextID, 200, Codes, Descriptions); for (i=0; i < n; i++) { fprintf(stderr, "\t%u - %s\n", Codes[i], Descriptions[i]); diff --git a/lcms2mt/utils/delphi/lcms2dll.pas b/lcms2mt/utils/delphi/lcms2dll.pas index b8cccdc04..9af7a0d11 100644 --- a/lcms2mt/utils/delphi/lcms2dll.pas +++ b/lcms2mt/utils/delphi/lcms2dll.pas @@ -1328,7 +1328,7 @@ FUNCTION cmsCloseIOhandler(io: LPcmsIOHANDLER): cmsBool; StdCall; FUNCTION cmsMD5computeID(hProfile: cmsHPROFILE): cmsBool; StdCall; -// Profile high level funtions ------------------------------------------------------------------------------------------ +// Profile high level functions ------------------------------------------------------------------------------------------ FUNCTION cmsOpenProfileFromFile(ICCProfile : PAnsiChar; sAccess: PAnsiChar): cmsHPROFILE; StdCall; FUNCTION cmsOpenProfileFromFileTHR(ContextID: cmsContext; ICCProfile, sAccess: PAnsiChar): cmsHPROFILE; StdCall; @@ -1448,7 +1448,7 @@ cmsFLAGS_SOFTPROOFING = $4000; // Do softproofing // Misc cmsFLAGS_BLACKPOINTCOMPENSATION = $2000; cmsFLAGS_NOWHITEONWHITEFIXUP = $0004; // Don't fix scum dot -cmsFLAGS_HIGHRESPRECALC = $0400; // Use more memory to give better accurancy +cmsFLAGS_HIGHRESPRECALC = $0400; // Use more memory to give better accuracy cmsFLAGS_LOWRESPRECALC = $0800; // Use less memory to minimize resouces // For devicelink creation diff --git a/lcms2mt/utils/jpgicc/jpgicc.c b/lcms2mt/utils/jpgicc/jpgicc.c index b4a880040..55d4cc5c2 100644 --- a/lcms2mt/utils/jpgicc/jpgicc.c +++ b/lcms2mt/utils/jpgicc/jpgicc.c @@ -105,7 +105,7 @@ in the case of future revision (for example, 1994). Spatial Resolution: (Two octets) Lightness pixel density in pels/25.4 mm. The basic value is 200. Allowed values are 100, 200, 300, 400, 600 and 1200 pels/25.4 mm, with square (or equivalent) pels. -NOTE – The functional equivalence of inch-based and mm-based resolutions is maintained. For example, the 200 × 200 +NOTE - The functional equivalence of inch-based and mm-based resolutions is maintained. For example, the 200 x 200 */ static @@ -142,8 +142,8 @@ void SetITUFax(j_compress_ptr cinfo) // the default range for ITU/T.42 -- See RFC 2301, section 6.2.3 for details // L* = [0, 100] -// a* = [–85, 85] -// b* = [–75, 125] +// a* = [-85, 85] +// b* = [-75, 125] // These functions does convert the encoding of ITUFAX to floating point @@ -170,7 +170,7 @@ void Lab2ITU(const cmsCIELab* Lab, cmsUInt16Number Out[3]) // once for each node. In[] will contain the Lab PCS value to convert to ITUFAX // on PCS2ITU, or the ITUFAX value to convert to Lab in ITU2PCS // You can change the number of sample points if desired, the algorithm will -// remain same. 33 points gives good accurancy, but you can reduce to 22 or less +// remain same. 33 points gives good accuracy, but you can reduce to 22 or less // is space is critical #define GRID_POINTS 33 @@ -1047,7 +1047,7 @@ void Help(int level) fprintf(stderr, "%ci<profile> - Input profile (defaults to sRGB)\n", SW); fprintf(stderr, "%co<profile> - Output profile (defaults to sRGB)\n", SW); - PrintRenderingIntents(); + PrintRenderingIntents(NULL); fprintf(stderr, "%cb - Black point compensation\n", SW); @@ -1238,7 +1238,7 @@ void HandleSwitches(int argc, char *argv[]) int main(int argc, char* argv[]) { - InitUtils("jpgicc"); + InitUtils(NULL, "jpgicc"); HandleSwitches(argc, argv); diff --git a/lcms2mt/utils/linkicc/linkicc.c b/lcms2mt/utils/linkicc/linkicc.c index 2104d8314..e2fa28c94 100644 --- a/lcms2mt/utils/linkicc/linkicc.c +++ b/lcms2mt/utils/linkicc/linkicc.c @@ -61,7 +61,7 @@ int Help(int level) fprintf(stderr, "flags:\n\n"); fprintf(stderr, "%co<profile> - Output devicelink profile. [defaults to 'devicelink.icc']\n", SW); - PrintRenderingIntents(); + PrintRenderingIntents(NULL); fprintf(stderr, "%cc<0,1,2> - Precision (0=LowRes, 1=Normal, 2=Hi-res) [defaults to 1]\n", SW); fprintf(stderr, "%cn<gridpoints> - Alternate way to set precision, number of CLUT points\n", SW); @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) fflush(stderr); // Initialize - InitUtils("linkicc"); + InitUtils(ContextID, "linkicc"); rc = 0; // Get the options @@ -310,7 +310,7 @@ int main(int argc, char *argv[]) // Ink limiting if (InkLimit != 400.0) { cmsColorSpaceSignature EndingColorSpace = cmsGetColorSpace(ContextID, Profiles[nargs-1]); - Profiles[nargs++] = cmsCreateInkLimitingDeviceLink(EndingColorSpace, InkLimit); + Profiles[nargs++] = cmsCreateInkLimitingDeviceLink(ContextID, EndingColorSpace, InkLimit); } // Set the flags @@ -342,11 +342,11 @@ int main(int argc, char *argv[]) if (lUse8bits) dwFlags |= cmsFLAGS_8BITS_DEVICELINK; - cmsSetAdaptationState(ObserverAdaptationState); + cmsSetAdaptationState(ContextID, ObserverAdaptationState); // Create the color transform. Specify 0 for the format is safe as the transform // is intended to be used only for the devicelink. - hTransform = cmsCreateMultiprofileTransform(Profiles, nargs, 0, 0, Intent, dwFlags|cmsFLAGS_NOOPTIMIZE); + hTransform = cmsCreateMultiprofileTransform(ContextID, Profiles, nargs, 0, 0, Intent, dwFlags|cmsFLAGS_NOOPTIMIZE); if (hTransform == NULL) { FatalError("Transform creation failed"); goto Cleanup; diff --git a/lcms2mt/utils/psicc/Makefile.am b/lcms2mt/utils/psicc/Makefile.am index 99d9d5b3a..fd9839a89 100644 --- a/lcms2mt/utils/psicc/Makefile.am +++ b/lcms2mt/utils/psicc/Makefile.am @@ -11,7 +11,7 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ bin_PROGRAMS = psicc -psicc_LDADD = $(top_builddir)/src/liblcms2.la +psicc_LDADD = $(top_builddir)/src/liblcms2.la @LCMS_LIB_DEPLIBS@ psicc_LDFLAGS = @LDFLAGS@ psicc_SOURCES = psicc.c ../common/xgetopt.c ../common/vprf.c ../common/utils.h psicc_MANS = psicc.1 diff --git a/lcms2mt/utils/psicc/psicc.c b/lcms2mt/utils/psicc/psicc.c index 60a8c9b9f..51851e008 100644 --- a/lcms2mt/utils/psicc/psicc.c +++ b/lcms2mt/utils/psicc/psicc.c @@ -201,7 +201,7 @@ int main(int argc, char *argv[]) cmsContext ContextID = NULL; // Initialize - InitUtils("psicc"); + InitUtils(NULL, "psicc"); HandleSwitches(argc, argv); diff --git a/lcms2mt/utils/samples/itufax.c b/lcms2mt/utils/samples/itufax.c index 79c7c4400..6bad87ea8 100644 --- a/lcms2mt/utils/samples/itufax.c +++ b/lcms2mt/utils/samples/itufax.c @@ -29,9 +29,9 @@ // the default range for ITU/T.42 -- See RFC 2301, section 6.2.3 for details -// L* = [0, 100] -// a* = [–85, 85] -// b* = [–75, 125] +// L* = [0, 100] +// a* = [-85, 85] +// b* = [-75, 125] // These functions does convert the encoding of ITUFAX to floating point @@ -59,7 +59,7 @@ void Lab2ITU(LPcmsCIELab Lab, WORD Out[3]) // once for each node. In[] will contain the Lab PCS value to convert to ITUFAX // on InputDirection, or the ITUFAX value to convert to Lab in OutputDirection // You can change the number of sample points if desired, the algorithm will -// remain same. 33 points gives good accurancy, but you can reduce to 22 or less +// remain same. 33 points gives good accuracy, but you can reduce to 22 or less // is space is critical #define GRID_POINTS 33 diff --git a/lcms2mt/utils/samples/roundtrip.c b/lcms2mt/utils/samples/roundtrip.c index a0ea4c1f0..c1d4d2fa4 100644 --- a/lcms2mt/utils/samples/roundtrip.c +++ b/lcms2mt/utils/samples/roundtrip.c @@ -96,4 +96,4 @@ int main(int argc, char* argv[]) cmsDeleteTransform(xform); return 0; -} +}
\ No newline at end of file diff --git a/lcms2mt/utils/tificc/tifdiff.c b/lcms2mt/utils/tificc/tifdiff.c index 214e84544..6719ec1c0 100644 --- a/lcms2mt/utils/tificc/tifdiff.c +++ b/lcms2mt/utils/tificc/tifdiff.c @@ -629,7 +629,7 @@ int main(int argc, char* argv[]) Tiff1 = Tiff2 = TiffDiff = NULL; - InitUtils("tiffdiff"); + InitUtils(NULL, "tiffdiff"); HandleSwitches(argc, argv); diff --git a/lcms2mt/utils/tificc/tificc.c b/lcms2mt/utils/tificc/tificc.c index 538c30cc0..2d2c70f33 100644 --- a/lcms2mt/utils/tificc/tificc.c +++ b/lcms2mt/utils/tificc/tificc.c @@ -25,7 +25,7 @@ // This program does apply profiles to (some) TIFF files -#include "lcms2_plugin.h" +#include "lcms2mt_plugin.h" #include "tiffio.h" #include "utils.h" @@ -936,7 +936,7 @@ void Help(int level) fprintf(stderr, "%co<profile> - Output profile (defaults to sRGB)\n", SW); fprintf(stderr, "%cl<profile> - Transform by device-link profile\n", SW); - PrintRenderingIntents(); + PrintRenderingIntents(NULL); fprintf(stderr, "%cb - Black point compensation\n", SW); fprintf(stderr, "%cd<0..1> - Observer adaptation state (abs.col. only)\n", SW); @@ -1138,7 +1138,7 @@ int main(int argc, char* argv[]) cmsPlugin(&TiffLabPlugin); - InitUtils("tificc"); + InitUtils(NULL, "tificc"); HandleSwitches(argc, argv); diff --git a/lcms2mt/utils/transicc/Makefile.am b/lcms2mt/utils/transicc/Makefile.am index 05e8b6936..7f033c6c5 100644 --- a/lcms2mt/utils/transicc/Makefile.am +++ b/lcms2mt/utils/transicc/Makefile.am @@ -11,7 +11,7 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ bin_PROGRAMS = transicc -transicc_LDADD = $(top_builddir)/src/liblcms2.la +transicc_LDADD = $(top_builddir)/src/liblcms2.la @LCMS_LIB_DEPLIBS@ transicc_LDFLAGS = @LDFLAGS@ transicc_SOURCES = transicc.c ../common/xgetopt.c ../common/vprf.c ../common/utils.h transicc_MANS = transicc.1 diff --git a/lcms2mt/utils/transicc/transicc.c b/lcms2mt/utils/transicc/transicc.c index bdb27e794..4bd1b5bd6 100644 --- a/lcms2mt/utils/transicc/transicc.c +++ b/lcms2mt/utils/transicc/transicc.c @@ -111,7 +111,7 @@ void Help(void) fprintf(stderr, "\nYou can use '*Lab', '*xyz' and others as built-in profiles\n\n"); - PrintRenderingIntents(); + PrintRenderingIntents(NULL); fprintf(stderr, "\n"); @@ -140,7 +140,7 @@ void Help(void) // The toggles stuff static -void HandleSwitches(int argc, char *argv[]) +void HandleSwitches(cmsContext ContextID, int argc, char *argv[]) { int s; @@ -172,7 +172,7 @@ void HandleSwitches(int argc, char *argv[]) ObserverAdaptationState > 1.0) FatalError("Adaptation states should be between 0 and 1"); - cmsSetAdaptationState(ObserverAdaptationState); + cmsSetAdaptationState(ContextID, ObserverAdaptationState); } break; @@ -561,13 +561,13 @@ cmsBool OpenTransforms(cmsContext ContextID) for (i=0; i < cmsMAXCHANNELS; i++) Alarm[i] = 0xFFFF; - cmsSetAlarmCodes(Alarm); + cmsSetAlarmCodes(ContextID, Alarm); dwFlags |= cmsFLAGS_GAMUTCHECK; } // The main transform - hTrans = cmsCreateProofingTransform(hInput, dwIn, hOutput, dwOut, hProof, Intent, ProofingIntent, dwFlags); + hTrans = cmsCreateProofingTransform(ContextID, hInput, dwIn, hOutput, dwOut, hProof, Intent, ProofingIntent, dwFlags); if (hProof) cmsCloseProfile(ContextID, hProof); @@ -579,13 +579,13 @@ cmsBool OpenTransforms(cmsContext ContextID) if (hOutput && Verbose > 1) { - cmsHPROFILE hXYZ = cmsCreateXYZProfile(); - cmsHPROFILE hLab = cmsCreateLab4Profile(NULL); + cmsHPROFILE hXYZ = cmsCreateXYZProfile(ContextID); + cmsHPROFILE hLab = cmsCreateLab4Profile(ContextID, NULL); - hTransXYZ = cmsCreateTransform(hInput, dwIn, hXYZ, lIsFloat ? TYPE_XYZ_DBL : TYPE_XYZ_16, Intent, cmsFLAGS_NOCACHE); + hTransXYZ = cmsCreateTransform(ContextID, hInput, dwIn, hXYZ, lIsFloat ? TYPE_XYZ_DBL : TYPE_XYZ_16, Intent, cmsFLAGS_NOCACHE); if (hTransXYZ == NULL) return FALSE; - hTransLab = cmsCreateTransform(hInput, dwIn, hLab, lIsFloat? TYPE_Lab_DBL : TYPE_Lab_16, Intent, cmsFLAGS_NOCACHE); + hTransLab = cmsCreateTransform(ContextID, hInput, dwIn, hLab, lIsFloat? TYPE_Lab_DBL : TYPE_Lab_16, Intent, cmsFLAGS_NOCACHE); if (hTransLab == NULL) return FALSE; cmsCloseProfile(ContextID, hXYZ); @@ -1243,7 +1243,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "LittleCMS ColorSpace conversion calculator - 4.3 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0); - InitUtils("transicc"); + InitUtils(ContextID, "transicc"); Verbose = 1; @@ -1253,7 +1253,7 @@ int main(int argc, char *argv[]) return 0; } - HandleSwitches(argc, argv); + HandleSwitches(ContextID, argc, argv); // Open profiles, create transforms if (!OpenTransforms(ContextID)) return 1; |