summaryrefslogtreecommitdiff
path: root/xicc/iccgamut.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
commitc2ca7be5a751879159f3cb591a64bb9568b79762 (patch)
tree04e38d4f4a2aad4d789bda0a65b7abb80a3439a2 /xicc/iccgamut.c
parent45c152c326d87478fbf41714b4b8e2f7b57a282b (diff)
parent3db384424bd7398ffbb7a355cab8f15f3add009f (diff)
Updated version 1.9.1+repack from 'upstream/1.9.1+repack'
with Debian dir 98a996367aa69ae41accf9c6d369f600bc94de80
Diffstat (limited to 'xicc/iccgamut.c')
-rw-r--r--xicc/iccgamut.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/xicc/iccgamut.c b/xicc/iccgamut.c
index 77f8fdd..ecbab7f 100644
--- a/xicc/iccgamut.c
+++ b/xicc/iccgamut.c
@@ -42,14 +42,13 @@
#include "gamut.h"
#include "counters.h"
#include "vrml.h"
-#include "ui.h"
static void diag_gamut(icxLuBase *p, double detail, int doaxes,
double tlimit, double klimit, char *outname);
void usage(char *diag) {
int i;
- fprintf(stderr,"Create Lab/Jab gamut plot Version %s\n",ARGYLL_VERSION_STR);
+ fprintf(stderr,"Create ICC profile Lab/Jab gamut & plot Version %s\n",ARGYLL_VERSION_STR);
fprintf(stderr,"Author: Graeme W. Gill, licensed under the AGPL Version 3\n");
fprintf(stderr,"usage: iccgamut [options] profile\n");
if (diag != NULL)
@@ -89,7 +88,8 @@ void usage(char *diag) {
fprintf(stderr," g:glare Flare light %% of ambient (default %d)\n",XICC_DEFAULT_GLARE);
fprintf(stderr," g:X:Y:Z Flare color as XYZ (default media white, Abs: D50)\n");
fprintf(stderr," g:x:y Flare color as x, y\n");
- fprintf(stderr," -s Create special cube surface topology plot\n");
+ fprintf(stderr," -x pcent Expand/compress gamut cylindrically by percent\n");
+ fprintf(stderr," -s Create special cube surface topology plot\n");
fprintf(stderr,"\n");
exit(1);
}
@@ -126,6 +126,7 @@ main(int argc, char *argv[]) {
double vc_g = -1.0; /* Glare % overide */
double vc_gXYZ[3] = {-1.0, -1.0, -1.0}; /* Glare color override in XYZ */
double vc_gxy[2] = {-1.0, -1.0}; /* Glare color override in x,y */
+ double expand = 1.0; /* Expand gamut cylindrically */
icxLuBase *luo;
@@ -288,6 +289,18 @@ main(int argc, char *argv[]) {
usage("Parameter after flag -d seems out of range");
}
+ /* Expand gamut cylindrically */
+ else if (argv[fa][1] == 'x') {
+ double rr;
+ fa = nfa;
+ if (na == NULL) usage("No parameter after flag -x");
+ rr = atof(na)/100.0;
+
+ if (rr < 0.01 || rr > 100.0)
+ usage("-x ratio is out of range");
+ expand = rr;
+ }
+
/* Viewing conditions */
else if (argv[fa][1] == 'c' || argv[fa][1] == 'C') {
fa = nfa;
@@ -489,6 +502,19 @@ main(int argc, char *argv[]) {
if ((gam = luo->get_gamut(luo, gamres)) == NULL)
error ("%d, %s",xicco->errc, xicco->err);
+ /* Expand gamut cylindrically */
+ if (expand != 1.0) {
+ gamut *xgam;
+
+ if ((xgam = new_gamut(1.0, 0, 0)) == NULL
+ || xgam->exp_cyl(xgam, gam, expand)) {
+ error ("Creating expanded gamut failed");
+ }
+
+ gam->del(gam);
+ gam = xgam;
+ }
+
if (gam->write_gam(gam, out_name))
error ("write gamut failed on '%s'",out_name);