1 module dmagick.c.colorspace;
2 
3 import dmagick.c.image;
4 import dmagick.c.magickType;
5 
6 extern(C)
7 {
8 	/**
9 	 * Specify the colorspace that quantization (color reduction and mapping)
10 	 * is done under or to specify the colorspace when encoding an output
11 	 * image. Colorspaces are ways of describing colors to fit the
12 	 * requirements of a particular application (e.g. Television, offset
13 	 * printing, color monitors).  Color reduction, by default, takes place
14 	 * in the RGBColorspace. Empirical evidence suggests that distances in
15 	 * color spaces such as YUVColorspace or YIQColorspace correspond to
16 	 * perceptual color differences more closely than do distances in RGB
17 	 * space. These color spaces may give better results when color reducing
18 	 * an image.
19 	 * 
20 	 * When encoding an output image, the colorspaces RGBColorspace,
21 	 * CMYKColorspace, and GRAYColorspace may be specified. The
22 	 * CMYKColorspace option is only applicable when writing TIFF, JPEG,
23 	 * and Adobe Photoshop bitmap (PSD) files.
24 	 */
25 	enum ColorspaceType
26 	{
27 		/**
28 		 * No colorspace has been specified.
29 		 */
30 		UndefinedColorspace,
31 
32 		/**
33 		 * Linear RGB colorspace
34 		 */
35 		RGBColorspace,
36 		
37 		/**
38 		 * Full-range grayscale
39 		 */
40 		GRAYColorspace,
41 		
42 		/**
43 		 * The Transparent color space behaves uniquely in that it preserves
44 		 * the matte channel of the image if it exists.
45 		 */
46 		TransparentColorspace,
47 		
48 		/**
49 		 * Red-Green-Blue colorspace
50 		 */
51 		OHTAColorspace,
52 		
53 		/**
54 		 * ditto
55 		 */
56 		LabColorspace,
57 		
58 		/**
59 		 * CIE XYZ
60 		 */
61 		XYZColorspace,
62 		
63 		/**
64 		 * Kodak PhotoCD PhotoYCC
65 		 */
66 		YCbCrColorspace,
67 		
68 		/**
69 		 * ditto
70 		 */
71 		YCCColorspace,
72 		
73 		/**
74 		 * Y-signal, U-signal, and V-signal colorspace. YUV is most widely
75 		 * used to encode color for use in television transmission.
76 		 */
77 		YIQColorspace,
78 		
79 		/**
80 		 * ditto
81 		 */
82 		YPbPrColorspace,
83 		
84 		/**
85 		 * ditto
86 		 */
87 		YUVColorspace,
88 		
89 		/**
90 		 * Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color
91 		 * system used by printers and photographers for the rendering of
92 		 * colors with ink or emulsion, normally on a white surface.
93 		 */
94 		CMYKColorspace,
95 		
96 		/**
97 		 * Kodak PhotoCD sRGB.
98 		 */
99 		sRGBColorspace,
100 		
101 		/**
102 		 * Hue, saturation, luminosity
103 		 */
104 		HSBColorspace,
105 		
106 		/**
107 		 * ditto
108 		 */
109 		HSLColorspace,
110 		
111 		/**
112 		 * Hue, whiteness, blackness
113 		 */
114 		HWBColorspace,
115 		
116 		/**
117 		 * Luma (Y) according to ITU-R 601
118 		 */
119 		Rec601LumaColorspace,
120 		
121 		/**
122 		 * YCbCr according to ITU-R 601
123 		 */
124 		Rec601YCbCrColorspace,
125 		
126 		/**
127 		 * Luma (Y) according to ITU-R 709
128 		 */
129 		Rec709LumaColorspace,
130 		
131 		/**
132 		 * YCbCr according to ITU-R 709
133 		 */
134 		Rec709YCbCrColorspace,
135 		
136 		/**
137 		 * Red-Green-Blue colorspace
138 		 */
139 		LogColorspace,
140 		
141 		/**
142 		 * Cyan-Magenta-Yellow-Black colorspace. CYMK is a subtractive color
143 		 * system used by printers and photographers for the rendering of
144 		 * colors with ink or emulsion, normally on a white surface.
145 		 */
146 		CMYColorspace,
147 
148 		/**
149 		 * CIE 1976 (L*, u*, v*) color space.
150 		 */
151 		LuvColorspace,
152 
153 		/**
154 		 * HCL is a color space that tries to combine the advantages of
155 		 * perceptual uniformity of Luv, and the simplicity of specification
156 		 * of HSV and HSL.
157 		 */
158 		HCLColorspace,
159 
160 		/** Alias for LCHuv. */
161 		LCHColorspace,
162 
163 		/**
164 		 * LMS is a color space represented by the response of the three types
165 		 * of cones of the human eye, named after their responsivity
166 		 * (sensitivity) at long, medium and short wavelengths.
167 		 */
168 		LMSColorspace,
169 
170 		/**
171 		 * CIE 1976 cylindrical version of Lab.
172 		 */
173 		LCHabColorspace,
174 
175 		/**
176 		 * CIE 1976 cylindrical version of Luv
177 		 */
178 		LCHuvColorspace,
179 
180 		/**
181 		 * scRGB is a wide color gamut RGB (Red Green Blue) color space
182 		 * created by Microsoft and HP that uses the same color primaries
183 		 * and white/black points as the sRGB color space but allows
184 		 * coordinates below zero and greater than one.
185 		 */
186 		scRGBColorspace,
187 
188 		/** */
189 		HSIColorspace,
190 
191 		/* Alias for HSB. */
192 		HSVColorspace,
193 
194 		/** */
195 		HCLpColorspace,
196 
197 		/** */
198 		YDbDrColorspace,
199 
200 		/**
201 		 * In CIE xyY, Y is the luminance and x and y represents the chrominance
202 		 * values derived from the tristimulus values X, Y and Z in the CIE XYZ
203 		 * color space.
204 		 */
205 		xyYColorspace
206 	}
207 
208 	MagickBooleanType RGBTransformImage(Image*, const ColorspaceType);
209 	MagickBooleanType SetImageColorspace(Image*, const ColorspaceType);
210 	MagickBooleanType TransformImageColorspace(Image*, const ColorspaceType);
211 	MagickBooleanType TransformRGBImage(Image*, const ColorspaceType);
212 }