1 #ifndef GAMMAP_H
2 #define GAMMAP_H
3 
4 /*
5  * Argyll Gamut Mapping Library
6  *
7  * Author:  Graeme W. Gill
8  * Date:    1/10/2000
9  * Version: 2.00
10  *
11  * Copyright 2000 - 2006 Graeme W. Gill
12  * All rights reserved.
13  *
14  * This material is licenced under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 :-
15  * see the License.txt file for licencing details.
16  */
17 
18 
19 /* Gamut mapping object */
20 struct _gammap {
21 
22 /* Private: */
23 	int dbg;			/* NZ to turn on debug messages */
24 						/* neutral axis alignment transform applied to source: */
25 	double grot[3][4];	/* Incoming grey axis rotation matrix */
26 	double igrot[3][4];	/* Inverse of above */
27 	rspl *grey;			/* Forward L map */
28 	rspl *igrey;		/* Inverse L map */
29 						/* Source to destination gamut map applied */
30 						/* to transformed source: */
31 	rspl *map;			/* Rotated, L mapped Lab -> Lab gamut map */
32 	double imin[3], imax[3];	/* Input range limits of map */
33 
34 	double tv[3];		/* Inversion target value */
35 /* Public: */
36 
37 	/* Methods */
38 	void (*del)(struct _gammap *s);			/* Free ourselves */
39 	void (*domap)(struct _gammap *s, double *out, double *in);	/* Do the mapping */
40 	void (*invdomap1)(struct _gammap *s, double *out, double *in);	/* Do the inverse mapping */
41 
42 }; typedef struct _gammap gammap;
43 
44 #ifdef NEVER
45 /* Method of black point adaptation */
46 typedef enum {
47 	gmm_BPadpt    = 0,		/* Adapt source black point to destination */
48 	gmm_noBPadpt  = 1,		/* Don't adapt black point to destination */
49 	gmm_bendBP    = 2,		/* Don't adapt black point, bend it to dest. at end */
50 	gmm_clipBP    = 3		/* Don't adapt black point, clip it to dest. at end */
51 } gmm_BPmap;
52 #endif
53 
54 /* Creator */
55 gammap *new_gammap(
56 	int verb,			/* Verbose flag */
57 	gamut *sc_gam,		/* Source colorspace gamut */
58 	gamut *s_gam,		/* Source image gamut (NULL if none) */
59 	gamut *d_gam,		/* Destination colorspace gamut */
60 	icxGMappingIntent *gmi, /* Gamut mapping specification */
61 	gamut *sh_gam,		/* If not NULL, then use sc_gam for the luminence */
62 						/* mapping, and sh_gam for the hull mapping (i.e. general compression) */
63 	int src_kbp,		/* Use K only black point as src gamut black point */
64 	int dst_kbp,		/* Use K only black point as dst gamut black point */
65 	int dst_cmymap,		/* masks C = 1, M = 2, Y = 4 to force 100% cusp map */
66 	int rel_oride,		/* 0 = normal, 1 = override min relative, 2 = max relative */
67 	int    mapres,		/* Gamut map resolution, typically 9 - 33 */
68 	double *mn,			/* If not NULL, set minimum mapping input range */
69 	double *mx,			/* for rspl grid */
70 	char *diagname		/* If non-NULL, write a gamut mapping diagnostic WRL */
71 );
72 
73 
74 #endif /* GAMMAP_H */
75