summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2011-02-15 15:57:43 +0100
committerMarti Maria <info@littlecms.com>2011-02-15 15:57:43 +0100
commit16cbf1ae325ab4d9312906cd1617991416023c7e (patch)
tree8bd2dac6e78c50db7c980f065d3395d8583e4dd4
parente06c51f04a41bb999f7c083b1771dca1923aad71 (diff)
downloadlcms2-16cbf1ae325ab4d9312906cd1617991416023c7e.tar.gz
Tools update
-rw-r--r--utils/linkicc/linkicc.c113
-rw-r--r--utils/tificc/tificc.c2
2 files changed, 66 insertions, 49 deletions
diff --git a/utils/linkicc/linkicc.c b/utils/linkicc/linkicc.c
index a0c4dbf..921562a 100644
--- a/utils/linkicc/linkicc.c
+++ b/utils/linkicc/linkicc.c
@@ -34,6 +34,8 @@ static char* cOutProf = "devicelink.icc";
static int PrecalcMode = 1;
static int NumOfGridPoints = 0;
+static cmsFloat64Number ObserverAdaptationState = 1.0; // According ICC 4.2 this is the default
+
static cmsBool BlackPointCompensation = FALSE;
static cmsFloat64Number InkLimit = 400;
@@ -70,6 +72,7 @@ int Help(int level)
fprintf(stderr, "%c8 - Creates 8-bit devicelink\n", SW);
fprintf(stderr, "%cx - Creatively, guess deviceclass of resulting profile.\n", SW);
fprintf(stderr, "%cb - Black point compensation\n", SW);
+ fprintf(stderr, "%ca<0..1> - Observer adaptation state (abs.col. only)\n\n", SW);
fprintf(stderr, "%cl - Use linearization curves (may affect accuracy)\n", SW);
fprintf(stderr, "%cr<v.r> - Profile version. (CAUTION: may change the profile implementation)\n", SW);
fprintf(stderr, "\n");
@@ -119,20 +122,30 @@ void HandleSwitches(int argc, char *argv[])
{
int s;
- while ((s = xgetopt(argc,argv,"V:v:xXH:h:8k:K:BbO:o:T:t:D:d:C:c:n:N:f:F:lLy:Y:r:R:")) != EOF) {
+ while ((s = xgetopt(argc,argv,"a:A:BbC:c:D:d:h:H:k:K:lLn:N:O:o:r:R:T:t:V:v:xX8y:Y:")) != EOF) {
switch (s) {
- case 'V':
- case 'v':
- Verbose = atoi(xoptarg);
- if (Verbose < 0 || Verbose > 3) {
- FatalError("Unknown verbosity level '%d'", Verbose);
- }
+
+ case 'a':
+ case 'A':
+ ObserverAdaptationState = atof(xoptarg);
+ if (ObserverAdaptationState < 0 ||
+ ObserverAdaptationState > 1.0)
+ FatalError("Adaptation state should be 0..1");
+ break;
+
+ case 'b':
+ case 'B':
+ BlackPointCompensation = TRUE;
break;
- case '8':
- lUse8bits = TRUE;
+ case 'c':
+ case 'C':
+ PrecalcMode = atoi(xoptarg);
+ if (PrecalcMode < 0 || PrecalcMode > 2) {
+ FatalError("Unknown precalc mode '%d'", PrecalcMode);
+ }
break;
case 'd':
@@ -142,29 +155,22 @@ void HandleSwitches(int argc, char *argv[])
Description = xoptarg;
break;
- case 'y':
- case 'Y':
- Copyright = xoptarg;
- break;
-
+ case 'h':
+ case 'H':
+ Help(atoi(xoptarg));
+ return;
- case 'o':
- case 'O':
- cOutProf = xoptarg;
+ case 'k':
+ case 'K':
+ InkLimit = atof(xoptarg);
+ if (InkLimit < 0.0 || InkLimit > 400.0) {
+ FatalError("Ink limit must be 0%%..400%%");
+ }
break;
- case 't':
- case 'T':
- Intent = atoi(xoptarg); // Will be validated latter on
- break;
-
- case 'c':
- case 'C':
- PrecalcMode = atoi(xoptarg);
- if (PrecalcMode < 0 || PrecalcMode > 2) {
- FatalError("Unknown precalc mode '%d'", PrecalcMode);
- }
+ case 'l':
+ case 'L': KeepLinearization = TRUE;
break;
case 'n':
@@ -175,20 +181,12 @@ void HandleSwitches(int argc, char *argv[])
NumOfGridPoints = atoi(xoptarg);
break;
- case 'b':
- case 'B':
- BlackPointCompensation = TRUE;
+ case 'o':
+ case 'O':
+ cOutProf = xoptarg;
break;
- case 'k':
- case 'K':
- InkLimit = atof(xoptarg);
- if (InkLimit < 0.0 || InkLimit > 400.0) {
- FatalError("Ink limit must be 0%%..400%%");
- }
- break;
-
case 'r':
case 'R':
Version = atof(xoptarg);
@@ -197,21 +195,38 @@ void HandleSwitches(int argc, char *argv[])
}
break;
+ case 't':
+ case 'T':
+ Intent = atoi(xoptarg); // Will be validated latter on
+ break;
+
+ case 'V':
+ case 'v':
+ Verbose = atoi(xoptarg);
+ if (Verbose < 0 || Verbose > 3) {
+ FatalError("Unknown verbosity level '%d'", Verbose);
+ }
+ break;
+
+ case '8':
+ lUse8bits = TRUE;
+ break;
+
+
+
+ case 'y':
+ case 'Y':
+ Copyright = xoptarg;
+ break;
+
+
case 'x':
case 'X': TagResult = TRUE;
break;
- case 'h':
- case 'H':
- Help(atoi(xoptarg));
- return;
- case 'l':
- case 'L': KeepLinearization = TRUE;
- break;
-
default:
FatalError("Unknown option - run without args to see valid ones.\n");
@@ -260,7 +275,7 @@ int main(int argc, char *argv[])
cmsHTRANSFORM hTransform = NULL;
// Here we are
- fprintf(stderr, "little cms ICC device link generator - v2.0 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
+ fprintf(stderr, "little cms ICC device link generator - v2.1 [LittleCMS %2.2f]\n", LCMS_VERSION / 1000.0);
fflush(stderr);
// Initialize
@@ -327,6 +342,8 @@ int main(int argc, char *argv[])
if (lUse8bits) dwFlags |= cmsFLAGS_8BITS_DEVICELINK;
+ cmsSetAdaptationState(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);
diff --git a/utils/tificc/tificc.c b/utils/tificc/tificc.c
index a0957aa..a36612d 100644
--- a/utils/tificc/tificc.c
+++ b/utils/tificc/tificc.c
@@ -46,7 +46,7 @@ static int ProofingIntent = INTENT_PERCEPTUAL;
static int PrecalcMode = 1;
static cmsFloat64Number InkLimit = 400;
-static cmsFloat64Number ObserverAdaptationState = 0;
+static cmsFloat64Number ObserverAdaptationState = 1.0; // According ICC 4.2 this is the default
static const char *cInpProf = NULL;
static const char *cOutProf = NULL;