From 782564ed6d0d5b8acebbdaf5741812b22f0b1f3b Mon Sep 17 00:00:00 2001 From: Marti Maria Date: Mon, 13 Dec 2010 18:00:28 +0100 Subject: Adding adaptation state control in jpgicc, tificc --- utils/jpgicc/jpgicc.c | 15 ++++++++++++++- 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 - Save embedded profile as \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': -- cgit v1.2.1