diff options
author | Marti Maria <info@littlecms.com> | 2010-12-13 18:00:28 +0100 |
---|---|---|
committer | Marti Maria <info@littlecms.com> | 2010-12-13 18:00:28 +0100 |
commit | 782564ed6d0d5b8acebbdaf5741812b22f0b1f3b (patch) | |
tree | a481cfef2c80bb467268ef72abef4cd51c32257f | |
parent | b2edce1a2116b358f77af1e918731cdab78a5e51 (diff) | |
download | lcms2-782564ed6d0d5b8acebbdaf5741812b22f0b1f3b.tar.gz |
Adding adaptation state control in jpgicc, tificc
-rw-r--r-- | utils/jpgicc/jpgicc.c | 15 | ||||
-rw-r--r-- | utils/tificc/tificc.c | 6 |
2 files changed, 17 insertions, 4 deletions
diff --git a/utils/jpgicc/jpgicc.c b/utils/jpgicc/jpgicc.c index 18b23a1..9b902f6 100644 --- a/utils/jpgicc/jpgicc.c +++ b/utils/jpgicc/jpgicc.c @@ -48,6 +48,9 @@ static int PrecalcMode = 1; static int jpegQuality = 75; +static cmsFloat64Number ObserverAdaptationState = 0; + + static char *cInpProf = NULL; static char *cOutProf = NULL; static char *cProofing = NULL; @@ -906,6 +909,8 @@ int TransformImage(char *cDefInpProf, char *cOutProf) cmsUInt8Number* EmbedBuffer; + cmsSetAdaptationState(ObserverAdaptationState); + if (BlackPointCompensation) { dwFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION; @@ -1051,6 +1056,7 @@ void Help(int level) fprintf(stderr, "%cb - Black point compensation\n", SW); + fprintf(stderr, "%cd<0..1> - Observer adaptation state (abs.col. only)\n", SW); fprintf(stderr, "%cn - Ignore embedded profile\n", SW); fprintf(stderr, "%ce - Embed destination profile\n", SW); fprintf(stderr, "%cs<new profile> - Save embedded profile as <new profile>\n", SW); @@ -1113,7 +1119,7 @@ void HandleSwitches(int argc, char *argv[]) { int s; - while ((s=xgetopt(argc,argv,"bBnNvVGgh:H:i:I:o:O:P:p:t:T:c:C:Q:q:M:m:L:l:eEs:S:!:")) != EOF) { + while ((s=xgetopt(argc,argv,"bBnNvVGgh:H:i:I:o:O:P:p:t:T:c:C:Q:q:M:m:L:l:eEs:S:!:D:d:")) != EOF) { switch (s) { @@ -1123,6 +1129,13 @@ void HandleSwitches(int argc, char *argv[]) BlackPointCompensation = TRUE; break; + case 'd': + case 'D': ObserverAdaptationState = atof(xoptarg); + if (ObserverAdaptationState < 0 || + ObserverAdaptationState > 1.0) + FatalError("Adaptation state should be 0..1"); + break; + case 'v': case 'V': Verbose = TRUE; diff --git a/utils/tificc/tificc.c b/utils/tificc/tificc.c index 8a0a9a1..a0957aa 100644 --- a/utils/tificc/tificc.c +++ b/utils/tificc/tificc.c @@ -977,9 +977,9 @@ void HandleSwitches(int argc, char *argv[]) case 'd': case 'D': ObserverAdaptationState = atof(xoptarg); - if (ObserverAdaptationState != 0 && - ObserverAdaptationState != 1.0) - Warning("Adaptation states other that 0 or 1 are not yet implemented"); + if (ObserverAdaptationState < 0 || + ObserverAdaptationState > 1.0) + Warning("Adaptation state should be 0..1"); break; case 'e': |