summaryrefslogtreecommitdiff
path: root/tweak/refine.c
diff options
context:
space:
mode:
Diffstat (limited to 'tweak/refine.c')
-rwxr-xr-x[-rw-r--r--]tweak/refine.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/tweak/refine.c b/tweak/refine.c
index 4bcdfbb..c9e16bd 100644..100755
--- a/tweak/refine.c
+++ b/tweak/refine.c
@@ -175,7 +175,7 @@ void usage(char *diag, ...) {
fprintf(stderr," -i illum Choose illuminant for computation of CIE XYZ from spectral data & FWA:\n");
fprintf(stderr," A, C, D50 (def.), D50M2, D65, F5, F8, F10 or file.sp\n");
fprintf(stderr," -o observ Choose CIE Observer for spectral data:\n");
- fprintf(stderr," 1931_2 (def), 1964_10, S&B 1955_2, shaw, J&V 1978_2\n");
+ fprintf(stderr," 1931_2, 1964_10, 2012_2 (def), 2012_10, S&B 1955_2, shaw, J&V 1978_2 or file.cmf\n");
fprintf(stderr," cietarget Target CIE or spectral values, CGATS file (e.g. .ti3)\n");
fprintf(stderr," ciecurrent Actual CIE or spectral values, CGATS file (e.g. .ti3)\n");
fprintf(stderr," [outdevicc] Output device ICC profile to set gamut limit (not used if -g)\n");
@@ -276,7 +276,8 @@ main(int argc, char *argv[]) {
xspect cust_tillum, *tillump = NULL; /* Custom target/simulated illumination spectrum */
icxIllumeType illum = icxIT_D50; /* Spectral defaults */
xspect cust_illum; /* Custom illumination spectrum */
- icxObserverType observ = icxOT_Judd_Voss_2;
+ icxObserverType obType = icxOT_CIE_2012_2;
+ xspect custObserver[3]; /* If obType = icxOT_custom */
callback cb; /* Callback support stucture for setting abstract profile */
icmFile *rd_fp = NULL; /* Existing abstract profile to modify */
@@ -457,21 +458,30 @@ main(int argc, char *argv[]) {
if (na == NULL) usage("Expected argument to -o");
if (strcmp(na, "1931_2") == 0) { /* Classic 2 degree */
spec = 1;
- observ = icxOT_CIE_1931_2;
+ obType = icxOT_CIE_1931_2;
} else if (strcmp(na, "1964_10") == 0) { /* Classic 10 degree */
spec = 1;
- observ = icxOT_CIE_1964_10;
+ obType = icxOT_CIE_1964_10;
+ } else if (strcmp(na, "2012_2") == 0) { /* Latest 2 degree */
+ spec = 1;
+ obType = icxOT_CIE_2012_2;
+ } else if (strcmp(na, "2012_10") == 0) { /* Latest 10 degree */
+ spec = 1;
+ obType = icxOT_CIE_2012_10;
} else if (strcmp(na, "1955_2") == 0) { /* Stiles and Burch 1955 2 degree */
spec = 1;
- observ = icxOT_Stiles_Burch_2;
+ obType = icxOT_Stiles_Burch_2;
} else if (strcmp(na, "1978_2") == 0) { /* Judd and Voss 1978 2 degree */
spec = 1;
- observ = icxOT_Judd_Voss_2;
+ obType = icxOT_Judd_Voss_2;
} else if (strcmp(na, "shaw") == 0) { /* Shaw and Fairchilds 1997 2 degree */
spec = 1;
- observ = icxOT_Shaw_Fairchild_2;
- } else
- usage("Unrecogised argument '%s' to -o",na);
+ obType = icxOT_Shaw_Fairchild_2;
+ } else { /* Assume it's a filename */
+ obType = icxOT_custom;
+ if (read_cmf(custObserver, na) != 0)
+ usage(0,"Failed to read custom observer CMF from -o file '%s'",na);
+ }
}
else
@@ -537,7 +547,7 @@ main(int argc, char *argv[]) {
printf("No CIE data found, switching to spectral with standard observer & D50 for file '%s'\n",cg[n].name);
spec = 1;
illum = icxIT_D50;
- observ = icxOT_CIE_1931_2;
+ obType = icxOT_CIE_1931_2;
}
if (spec && cgf->find_kword(cgf, 0, "SPECTRAL_BANDS") < 0)
error ("No spectral data data found in file '%s' when spectral expected",cg[n].name);
@@ -662,7 +672,7 @@ main(int argc, char *argv[]) {
/* Create a spectral conversion object */
if ((sp2cie = new_xsp2cie(illum, illum == icxIT_none ? NULL : &cust_illum,
- observ, NULL, icSigLabData, icxClamp)) == NULL)
+ obType, custObserver, icSigLabData, icxClamp)) == NULL)
error("Creation of spectral conversion object failed");
if (fwacomp) {