summaryrefslogtreecommitdiff
path: root/dmagick/c/colorspace.d
blob: 30ba8dafaacf80c9677377ecee9a8cdb39aca975 (plain)
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
module dmagick.c.colorspace;

import dmagick.c.image;
import dmagick.c.magickType;

extern(C)
{
	/**
	 * Specify the colorspace that quantization (color reduction and mapping)
	 * is done under or to specify the colorspace when encoding an output
	 * image. Colorspaces are ways of describing colors to fit the
	 * requirements of a particular application (e.g. Television, offset
	 * printing, color monitors).  Color reduction, by default, takes place
	 * in the RGBColorspace. Empirical evidence suggests that distances in
	 * color spaces such as YUVColorspace or YIQColorspace correspond to
	 * perceptual color differences more closely than do distances in RGB
	 * space. These color spaces may give better results when color reducing
	 * an image.
	 * 
	 * When encoding an output image, the colorspaces RGBColorspace,
	 * CMYKColorspace, and GRAYColorspace may be specified. The
	 * CMYKColorspace option is only applicable when writing TIFF, JPEG,
	 * and Adobe Photoshop bitmap (PSD) files.
	 */
	enum ColorspaceType
	{
		/**
		 * No colorspace has been specified.
		 */
		UndefinedColorspace,

		/**
		 * Linear RGB colorspace
		 */
		RGBColorspace,
		
		/**
		 * Full-range grayscale
		 */
		GRAYColorspace,
		
		/**
		 * The Transparent color space behaves uniquely in that it preserves
		 * the matte channel of the image if it exists.
		 */
		TransparentColorspace,
		
		/**
		 * Red-Green-Blue colorspace
		 */
		OHTAColorspace,
		
		/**
		 * ditto
		 */
		LabColorspace,
		
		/**
		 * CIE XYZ
		 */
		XYZColorspace,
		
		/**
		 * Kodak PhotoCD PhotoYCC
		 */
		YCbCrColorspace,
		
		/**
		 * ditto
		 */
		YCCColorspace,
		
		/**
		 * Y-signal, U-signal, and V-signal colorspace. YUV is most widely
		 * used to encode color for use in television transmission.
		 */
		YIQColorspace,
		
		/**
		 * ditto
		 */
		YPbPrColorspace,
		
		/**
		 * ditto
		 */
		YUVColorspace,
		
		/**
		 * Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color
		 * system used by printers and photographers for the rendering of
		 * colors with ink or emulsion, normally on a white surface.
		 */
		CMYKColorspace,
		
		/**
		 * Kodak PhotoCD sRGB.
		 */
		sRGBColorspace,
		
		/**
		 * Hue, saturation, luminosity
		 */
		HSBColorspace,
		
		/**
		 * ditto
		 */
		HSLColorspace,
		
		/**
		 * Hue, whiteness, blackness
		 */
		HWBColorspace,
		
		/**
		 * Luma (Y) according to ITU-R 601
		 */
		Rec601LumaColorspace,
		
		/**
		 * YCbCr according to ITU-R 601
		 */
		Rec601YCbCrColorspace,
		
		/**
		 * Luma (Y) according to ITU-R 709
		 */
		Rec709LumaColorspace,
		
		/**
		 * YCbCr according to ITU-R 709
		 */
		Rec709YCbCrColorspace,
		
		/**
		 * Red-Green-Blue colorspace
		 */
		LogColorspace,
		
		/**
		 * Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color
		 * system used by printers and photographers for the rendering of
		 * colors with ink or emulsion, normally on a white surface.
		 */
		CMYColorspace,

		/**
		 * CIE 1976 (L*, u*, v*) color space.
		 */
		LuvColorspace,

		/**
		 * HCL is a color space that tries to combine the advantages of
		 * perceptual uniformity of Luv, and the simplicity of specification
		 * of HSV and HSL.
		 */
		HCLColorspace,

		/** Alias for LCHuv. */
		LCHColorspace,

		/**
		 * LMS is a color space represented by the response of the three types
		 * of cones of the human eye, named after their responsivity
		 * (sensitivity) at long, medium and short wavelengths.
		 */
		LMSColorspace,

		/**
		 * CIE 1976 cylindrical version of Lab.
		 */
		LCHabColorspace,

		/**
		 * CIE 1976 cylindrical version of Luv
		 */
		LCHuvColorspace,

		/**
		 * scRGB is a wide color gamut RGB (Red Green Blue) color space
		 * created by Microsoft and HP that uses the same color primaries
		 * and white/black points as the sRGB color space but allows
		 * coordinates below zero and greater than one.
		 */
		scRGBColorspace,

		/** */
		HSIColorspace,

		/* Alias for HSB. */
		HSVColorspace,

		/** */
		HCLpColorspace,

		/** */
		YDbDrColorspace,

		/**
		 * In CIE xyY, Y is the luminance and x and y represents the chrominance
		 * values derived from the tristimulus values X, Y and Z in the CIE XYZ
		 * color space.
		 */
		xyYColorspace
	}

	MagickBooleanType RGBTransformImage(Image*, const ColorspaceType);
	MagickBooleanType SetImageColorspace(Image*, const ColorspaceType);
	MagickBooleanType TransformImageColorspace(Image*, const ColorspaceType);
	MagickBooleanType TransformRGBImage(Image*, const ColorspaceType);
}