summaryrefslogtreecommitdiff
path: root/lcms2mt/utils
diff options
context:
space:
mode:
Diffstat (limited to 'lcms2mt/utils')
-rw-r--r--lcms2mt/utils/common/utils.h4
-rw-r--r--lcms2mt/utils/common/vprf.c32
-rw-r--r--lcms2mt/utils/delphi/lcms2dll.pas4
-rw-r--r--lcms2mt/utils/jpgicc/jpgicc.c12
-rw-r--r--lcms2mt/utils/linkicc/linkicc.c10
-rw-r--r--lcms2mt/utils/psicc/Makefile.am2
-rw-r--r--lcms2mt/utils/psicc/psicc.c2
-rw-r--r--lcms2mt/utils/samples/itufax.c8
-rw-r--r--lcms2mt/utils/samples/roundtrip.c2
-rw-r--r--lcms2mt/utils/tificc/tifdiff.c2
-rw-r--r--lcms2mt/utils/tificc/tificc.c6
-rw-r--r--lcms2mt/utils/transicc/Makefile.am2
-rw-r--r--lcms2mt/utils/transicc/transicc.c22
13 files changed, 54 insertions, 54 deletions
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;