-
-
Notifications
You must be signed in to change notification settings - Fork 648
/
colour.h
306 lines (267 loc) · 7.68 KB
/
colour.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
/* Definitions for VIPS colour package.
*
* J.Cupitt, 8/4/93
* 15/7/96 JC
* - C++ stuff added
* 20/2/98 JC
* - new display calibration added
* 26/9/05
* - added IM_ prefix to colour temps
*/
/*
This file is part of VIPS.
VIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#ifndef VIPS_COLOUR_H
#define VIPS_COLOUR_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
/* Areas under curves for Dxx. 2 degree observer.
*/
#define VIPS_D93_X0 (89.7400)
#define VIPS_D93_Y0 (100.0)
#define VIPS_D93_Z0 (130.7700)
#define VIPS_D75_X0 (94.9682)
#define VIPS_D75_Y0 (100.0)
#define VIPS_D75_Z0 (122.5710)
/* D65 temp 6504.
*/
#define VIPS_D65_X0 (95.0470)
#define VIPS_D65_Y0 (100.0)
#define VIPS_D65_Z0 (108.8827)
#define VIPS_D55_X0 (95.6831)
#define VIPS_D55_Y0 (100.0)
#define VIPS_D55_Z0 (92.0871)
#define VIPS_D50_X0 (96.4250)
#define VIPS_D50_Y0 (100.0)
#define VIPS_D50_Z0 (82.4680)
/* A temp 2856k.
*/
#define VIPS_A_X0 (109.8503)
#define VIPS_A_Y0 (100.0)
#define VIPS_A_Z0 (35.5849)
/* B temp 4874k.
*/
#define VIPS_B_X0 (99.0720)
#define VIPS_B_Y0 (100.0)
#define VIPS_B_Z0 (85.2230)
/* C temp 6774k.
*/
#define VIPS_C_X0 (98.0700)
#define VIPS_C_Y0 (100.0)
#define VIPS_C_Z0 (118.2300)
#define VIPS_E_X0 (100.0)
#define VIPS_E_Y0 (100.0)
#define VIPS_E_Z0 (100.0)
#define VIPS_D3250_X0 (105.6590)
#define VIPS_D3250_Y0 (100.0)
#define VIPS_D3250_Z0 (45.8501)
typedef enum {
VIPS_INTENT_PERCEPTUAL = 0,
VIPS_INTENT_RELATIVE,
VIPS_INTENT_SATURATION,
VIPS_INTENT_ABSOLUTE,
VIPS_INTENT_LAST
} VipsIntent;
typedef enum {
VIPS_PCS_LAB,
VIPS_PCS_XYZ,
VIPS_PCS_LAST
} VipsPCS;
VIPS_API
gboolean vips_colourspace_issupported(const VipsImage *image);
VIPS_API
int vips_colourspace(VipsImage *in, VipsImage **out,
VipsInterpretation space, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LabQ2sRGB(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_rad2float(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_float2rad(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LabS2LabQ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LabQ2LabS(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LabQ2Lab(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_Lab2LabQ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LCh2Lab(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_Lab2LCh(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_Yxy2Lab(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_CMC2XYZ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_Lab2XYZ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_XYZ2Lab(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_XYZ2scRGB(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_scRGB2sRGB(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_scRGB2BW(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_sRGB2scRGB(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_scRGB2XYZ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_HSV2sRGB(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_sRGB2HSV(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LCh2CMC(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_CMC2LCh(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_XYZ2Yxy(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_Yxy2XYZ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_LabS2Lab(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_Lab2LabS(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_CMYK2XYZ(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_XYZ2CMYK(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_profile_load(const char *name, VipsBlob **profile, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_icc_present(void);
VIPS_API
int vips_icc_transform(VipsImage *in, VipsImage **out,
const char *output_profile, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_icc_import(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_icc_export(VipsImage *in, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_icc_ac2rc(VipsImage *in, VipsImage **out,
const char *profile_filename);
VIPS_API
gboolean vips_icc_is_compatible_profile(VipsImage *image,
const void *data, size_t data_length);
VIPS_API
int vips_dE76(VipsImage *left, VipsImage *right, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_dE00(VipsImage *left, VipsImage *right, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
int vips_dECMC(VipsImage *left, VipsImage *right, VipsImage **out, ...)
G_GNUC_NULL_TERMINATED;
VIPS_API
void vips_col_Lab2XYZ(float L, float a, float b,
float *X, float *Y, float *Z);
VIPS_API
void vips_col_XYZ2Lab(float X, float Y, float Z,
float *L, float *a, float *b);
VIPS_API
double vips_col_ab2h(double a, double b);
VIPS_API
void vips_col_ab2Ch(float a, float b, float *C, float *h);
VIPS_API
void vips_col_Ch2ab(float C, float h, float *a, float *b);
VIPS_API
float vips_col_L2Lcmc(float L);
VIPS_API
float vips_col_C2Ccmc(float C);
VIPS_API
float vips_col_Ch2hcmc(float C, float h);
VIPS_API
void vips_col_make_tables_CMC(void);
VIPS_API
float vips_col_Lcmc2L(float Lcmc);
VIPS_API
float vips_col_Ccmc2C(float Ccmc);
VIPS_API
float vips_col_Chcmc2h(float C, float hcmc);
VIPS_API
int vips_col_sRGB2scRGB_8(int r, int g, int b, float *R, float *G, float *B);
VIPS_API
int vips_col_sRGB2scRGB_16(int r, int g, int b, float *R, float *G, float *B);
VIPS_API
int vips_col_sRGB2scRGB_8_noclip(int r, int g, int b,
float *R, float *G, float *B);
VIPS_API
int vips_col_sRGB2scRGB_16_noclip(int r, int g, int b,
float *R, float *G, float *B);
VIPS_API
int vips_col_scRGB2XYZ(float R, float G, float B,
float *X, float *Y, float *Z);
VIPS_API
int vips_col_XYZ2scRGB(float X, float Y, float Z,
float *R, float *G, float *B);
VIPS_API
int vips_col_scRGB2sRGB_8(float R, float G, float B,
int *r, int *g, int *b, int *og);
VIPS_API
int vips_col_scRGB2sRGB_16(float R, float G, float B,
int *r, int *g, int *b, int *og);
VIPS_API
int vips_col_scRGB2BW_16(float R, float G, float B, int *g, int *og);
VIPS_API
int vips_col_scRGB2BW_8(float R, float G, float B, int *g, int *og);
VIPS_API
float vips_pythagoras(float L1, float a1, float b1,
float L2, float a2, float b2);
VIPS_API
float vips_col_dE00(
float L1, float a1, float b1, float L2, float a2, float b2);
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /*VIPS_COLOUR_H*/