summaryrefslogtreecommitdiff
path: root/dmagick/c/colorspace.d
blob: 7f5a06021e23d0609db04b595344101a9fe69d9c (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
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,

		/**
		 * Red-Green-Blue 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
	}

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