diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-09-01 15:43:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-09-01 15:43:52 +0200 |
commit | c07d0c2d2f6f7b0eb6e92cc6204bf05037957e82 (patch) | |
tree | 41791cbe367cf023b98043fee56f9346b2592b49 /xicc/transplot.c | |
parent | d7f89e6fe63b8697fab5a901cfce457b375638b3 (diff) |
Imported Upstream version 1.6.3upstream/1.6.3
Diffstat (limited to 'xicc/transplot.c')
-rw-r--r-- | xicc/transplot.c | 68 |
1 files changed, 62 insertions, 6 deletions
diff --git a/xicc/transplot.c b/xicc/transplot.c index e196544..d4600d9 100644 --- a/xicc/transplot.c +++ b/xicc/transplot.c @@ -1,7 +1,7 @@ /* * International Color Consortium Format Library (icclib) - * Check various aspects of CMYK device link, + * Check various aspects of RGB or CMYK device link, * and RGB/CMYK profile transfer characteristics. * * Author: Graeme W. Gill @@ -35,6 +35,10 @@ void usage(void) { fprintf(stderr,"Author: Graeme W. Gill\n"); fprintf(stderr,"usage: transplot [-v] infile\n"); fprintf(stderr," -v verbose\n"); + fprintf(stderr," -i intent p = perceptual, r = relative colorimetric,\n"); + fprintf(stderr," s = saturation, a = absolute\n"); + fprintf(stderr," -o order n = normal (priority: lut > matrix > monochrome)\n"); + fprintf(stderr," r = reverse (priority: monochrome > matrix > lut)\n"); fprintf(stderr," -c -m -y -k Check Cyan and/or Magenta and/or Yellow and/or Black input\n"); fprintf(stderr," -r -g -b Check Red and/or Green and/or Blue input\n"); fprintf(stderr," -L -A -B Check L and/or a* and/or b* input\n"); @@ -57,6 +61,10 @@ main( icc *rd_icco; /* Keep object separate */ int rv = 0; + /* Lookup parameters */ + icRenderingIntent intent = icmDefaultIntent; /* Default */ + icmLookupOrder order = icmLuOrdNorm; /* Default */ + /* Check variables */ icmLuBase *luo; icmLuLut *luluto; /* Lookup xLut type object */ @@ -94,6 +102,54 @@ main( if (argv[fa][1] == 'v' || argv[fa][1] == 'V') { verb = 1; } + + /* Intent */ + else if (argv[fa][1] == 'i' || argv[fa][1] == 'I') { + fa = nfa; + if (na == NULL) usage(); + switch (na[0]) { + case 'p': + intent = icPerceptual; + break; + case 'r': + intent = icRelativeColorimetric; + break; + case 's': + intent = icSaturation; + break; + case 'a': + intent = icAbsoluteColorimetric; + break; + /* Special function icclib intents */ + case 'P': + intent = icmAbsolutePerceptual; + break; + case 'S': + intent = icmAbsoluteSaturation; + break; + default: + usage(); + } + } + + /* Search order */ + else if (argv[fa][1] == 'o' || argv[fa][1] == 'O') { + fa = nfa; + if (na == NULL) usage(); + switch (na[0]) { + case 'n': + case 'N': + order = icmLuOrdNorm; + break; + case 'r': + case 'R': + order = icmLuOrdRev; + break; + default: + usage(); + } + } + /* Cyan, Red */ else if (argv[fa][1] == 'c' || argv[fa][1] == 'C' || argv[fa][1] == 'r' || argv[fa][1] == 'R') { @@ -153,12 +209,12 @@ main( if (labin) { /* Get a Device to PCS conversion object */ - if ((luo = rd_icco->get_luobj(rd_icco, icmBwd, icmDefaultIntent, icSigLabData, icmLuOrdNorm)) == NULL) + if ((luo = rd_icco->get_luobj(rd_icco, icmBwd, intent, icSigLabData, order)) == NULL) error ("%d, %s",rd_icco->errc, rd_icco->err); } else { /* Get a PCS to Device conversion object */ - if ((luo = rd_icco->get_luobj(rd_icco, icmFwd, icmDefaultIntent, icSigLabData, icmLuOrdNorm)) == NULL) { - if ((luo = rd_icco->get_luobj(rd_icco, icmFwd, icmDefaultIntent, icmSigDefaultData, icmLuOrdNorm)) == NULL) { + if ((luo = rd_icco->get_luobj(rd_icco, icmFwd, intent, icSigLabData, order)) == NULL) { + if ((luo = rd_icco->get_luobj(rd_icco, icmFwd, intent, icmSigDefaultData, order)) == NULL) { error ("%d, %s",rd_icco->errc, rd_icco->err); } } @@ -188,8 +244,8 @@ main( chans[3] = 0; } - if (outs != icSigCmykData && outs != icSigLabData) { - error("Expecting Lab or CMYK output space"); + if (outs != icSigCmykData && outs != icSigLabData && outs != icSigRgbData) { + error("Expecting Lab or CMYK or RGB output space"); } if (outs == icSigLabData) |