diff options
author | Marti Maria <info@littlecms.com> | 2010-12-13 20:00:28 +0300 |
---|---|---|
committer | Marti Maria <info@littlecms.com> | 2010-12-13 20:00:28 +0300 |
commit | 782564ed6d0d5b8acebbdaf5741812b22f0b1f3b (patch) | |
tree | a481cfef2c80bb467268ef72abef4cd51c32257f /utils/jpgicc | |
parent | b2edce1a2116b358f77af1e918731cdab78a5e51 (diff) |
Adding adaptation state control in jpgicc, tificc
Diffstat (limited to 'utils/jpgicc')
-rw-r--r-- | utils/jpgicc/jpgicc.c | 15 |
1 files changed, 14 insertions, 1 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; |