14c10c8ca733f72c65ef1b546b4a7782dbd1ab47
[reactos.git] / reactos / include / psdk / icm.h
1 /*
2 * Copyright 2004 (C) Mike McCormack
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef __WINE_ICM_H
20 #define __WINE_ICM_H
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 typedef HANDLE HPROFILE;
27 typedef HPROFILE *PHPROFILE;
28 typedef HANDLE HTRANSFORM;
29
30 typedef DWORD TAGTYPE, *PTAGTYPE, *LPTAGTYPE;
31
32 typedef char COLOR_NAME[32];
33 typedef COLOR_NAME *PCOLOR_NAME, *LPCOLOR_NAME;
34
35 typedef struct tagNAMED_PROFILE_INFO
36 {
37 DWORD dwFlags;
38 DWORD dwCount;
39 DWORD dwCountDevCoordinates;
40 COLOR_NAME szPrefix;
41 COLOR_NAME szSuffix;
42 } NAMED_PROFILE_INFO, *PNAMED_PROFILE_INFO, *LPNAMED_PROFILE_INFO;
43
44 #define MAX_COLOR_CHANNELS 8
45
46 struct GRAYCOLOR
47 {
48 WORD gray;
49 };
50
51 struct RGBCOLOR
52 {
53 WORD red;
54 WORD green;
55 WORD blue;
56 };
57
58 struct CMYKCOLOR
59 {
60 WORD cyan;
61 WORD magenta;
62 WORD yellow;
63 WORD black;
64 };
65
66 struct XYZCOLOR
67 {
68 WORD X;
69 WORD Y;
70 WORD Z;
71 };
72
73 struct YxyCOLOR
74 {
75 WORD Y;
76 WORD x;
77 WORD y;
78 };
79
80 struct LabCOLOR
81 {
82 WORD L;
83 WORD a;
84 WORD b;
85 };
86
87 struct GENERIC3CHANNEL
88 {
89 WORD ch1;
90 WORD ch2;
91 WORD ch3;
92 };
93
94 struct NAMEDCOLOR
95 {
96 DWORD dwIndex;
97 };
98
99 struct HiFiCOLOR
100 {
101 BYTE channel[MAX_COLOR_CHANNELS];
102 };
103
104 typedef union tagCOLOR
105 {
106 struct GRAYCOLOR gray;
107 struct RGBCOLOR rgb;
108 struct CMYKCOLOR cmyk;
109 struct XYZCOLOR XYZ;
110 struct YxyCOLOR Yxy;
111 struct LabCOLOR Lab;
112 struct GENERIC3CHANNEL gen3ch;
113 struct NAMEDCOLOR named;
114 struct HiFiCOLOR hifi;
115 struct
116 {
117 DWORD reserved1;
118 VOID *reserved2;
119 } DUMMYSTRUCTNAME;
120 } COLOR, *PCOLOR, *LPCOLOR;
121
122 typedef enum
123 {
124 COLOR_GRAY = 1,
125 COLOR_RGB,
126 COLOR_XYZ,
127 COLOR_Yxy,
128 COLOR_Lab,
129 COLOR_3_CHANNEL,
130 COLOR_CMYK,
131 COLOR_5_CHANNEL,
132 COLOR_6_CHANNEL,
133 COLOR_7_CHANNEL,
134 COLOR_8_CHANNEL,
135 COLOR_NAMED,
136 } COLORTYPE, *PCOLORTYPE, *LPCOLORTYPE;
137
138 typedef enum
139 {
140 BM_x555RGB = 0x00,
141 BM_565RGB = 0x01,
142 BM_RGBTRIPLETS = 0x02,
143 BM_BGRTRIPLETS = 0x04,
144 BM_xRGBQUADS = 0x08,
145 BM_10b_RGB = 0x09,
146 BM_16b_RGB = 0x0a,
147 BM_xBGRQUADS = 0x10,
148 BM_CMYKQUADS = 0x20,
149 BM_x555XYZ = 0x101,
150 BM_x555Yxz,
151 BM_x555Lab,
152 BM_x555G3CH,
153 BM_XYZTRIPLETS = 0x201,
154 BM_YxyTRIPLETS,
155 BM_LabTRIPLETS,
156 BM_G3CHTRIPLETS,
157 BM_5CHANNEL,
158 BM_6CHANNEL,
159 BM_7CHANNEL,
160 BM_8CHANNEL,
161 BM_GRAY,
162 BM_xXYZQUADS = 0x301,
163 BM_xYxyQUADS,
164 BM_xLabQUADS,
165 BM_xG3CHQUADS,
166 BM_KYMCQUADS,
167 BM_10b_XYZ = 0x401,
168 BM_10b_Yxy,
169 BM_10b_Lab,
170 BM_10b_G3CH,
171 BM_NAMED_INDEX,
172 BM_16b_XYZ = 0x501,
173 BM_16b_Yxy,
174 BM_16b_Lab,
175 BM_16b_G3CH,
176 BM_16b_GRAY,
177 } BMFORMAT, *PBMFORMAT, *LPBMFORMAT;
178
179 typedef BOOL (CALLBACK *PBMCALLBACKFN)(ULONG,ULONG,LPARAM);
180 typedef PBMCALLBACKFN LPPBMCALLBACKFN;
181
182 typedef struct tagPROFILEHEADER
183 {
184 DWORD phSize;
185 DWORD phCMMType;
186 DWORD phVersion;
187 DWORD phClass;
188 DWORD phDataColorSpace;
189 DWORD phConnectionSpace;
190 DWORD phDateTime[3];
191 DWORD phSignature;
192 DWORD phPlatform;
193 DWORD phProfileFlags;
194 DWORD phManufacturer;
195 DWORD phModel;
196 DWORD phAttributes[2];
197 DWORD phRenderingIntent;
198 CIEXYZ phIlluminant;
199 DWORD phCreator;
200 BYTE phReserved[44];
201 } PROFILEHEADER, *PPROFILEHEADER, *LPPROFILEHEADER;
202
203 typedef struct tagPROFILE
204 {
205 DWORD dwType;
206 PVOID pProfileData;
207 DWORD cbDataSize;
208 } PROFILE, *PPROFILE, *LPPROFILE;
209
210 #define ENUM_TYPE_VERSION 0x0300
211
212 typedef struct tagENUMTYPEA
213 {
214 DWORD dwSize;
215 DWORD dwVersion;
216 DWORD dwFields;
217 PCSTR pDeviceName;
218 DWORD dwMediaType;
219 DWORD dwDitheringMode;
220 DWORD dwResolution[2];
221 DWORD dwCMMType;
222 DWORD dwClass;
223 DWORD dwDataColorSpace;
224 DWORD dwConnectionSpace;
225 DWORD dwSignature;
226 DWORD dwPlatform;
227 DWORD dwProfileFlags;
228 DWORD dwManufacturer;
229 DWORD dwModel;
230 DWORD dwAttributes[2];
231 DWORD dwRenderingIntent;
232 DWORD dwCreator;
233 DWORD dwDeviceClass;
234 } ENUMTYPEA, *PENUMTYPEA, *LPENUMTYPEA;
235
236 typedef struct tagENUMTYPEW
237 {
238 DWORD dwSize;
239 DWORD dwVersion;
240 DWORD dwFields;
241 PCWSTR pDeviceName;
242 DWORD dwMediaType;
243 DWORD dwDitheringMode;
244 DWORD dwResolution[2];
245 DWORD dwCMMType;
246 DWORD dwClass;
247 DWORD dwDataColorSpace;
248 DWORD dwConnectionSpace;
249 DWORD dwSignature;
250 DWORD dwPlatform;
251 DWORD dwProfileFlags;
252 DWORD dwManufacturer;
253 DWORD dwModel;
254 DWORD dwAttributes[2];
255 DWORD dwRenderingIntent;
256 DWORD dwCreator;
257 DWORD dwDeviceClass;
258 } ENUMTYPEW, *PENUMTYPEW, *LPENUMTYPEW;
259
260 #define ET_DEVICENAME 0x00000001
261 #define ET_MEDIATYPE 0x00000002
262 #define ET_DITHERMODE 0x00000004
263 #define ET_RESOLUTION 0x00000008
264 #define ET_CMMTYPE 0x00000010
265 #define ET_CLASS 0x00000020
266 #define ET_DATACOLORSPACE 0x00000040
267 #define ET_CONNECTIONSPACE 0x00000080
268 #define ET_SIGNATURE 0x00000100
269 #define ET_PLATFORM 0x00000200
270 #define ET_PROFILEFLAGS 0x00000400
271 #define ET_MANUFACTURER 0x00000800
272 #define ET_MODEL 0x00001000
273 #define ET_ATTRIBUTES 0x00002000
274 #define ET_RENDERINGINTENT 0x00004000
275 #define ET_CREATOR 0x00008000
276 #define ET_DEVICECLASS 0x00010000
277
278 struct _tagCOLORMATCHSETUPA;
279 struct _tagCOLORMATCHSETUPW;
280
281 typedef BOOL (WINAPI *PCMSCALLBACKA)(struct _tagCOLORMATCHSETUPA*,LPARAM);
282 typedef BOOL (WINAPI *PCMSCALLBACKW)(struct _tagCOLORMATCHSETUPW*,LPARAM);
283
284 typedef struct _tagCOLORMATCHSETUPA
285 {
286 DWORD dwSize;
287 DWORD dwVersion;
288 DWORD dwFlags;
289 HWND hwndOwner;
290 PCSTR pSourceName;
291 PCSTR pDisplayName;
292 PCSTR pPrinterName;
293 DWORD dwRenderIntent;
294 DWORD dwProofingIntent;
295 PSTR pMonitorProfile;
296 DWORD ccMonitorProfile;
297 PSTR pPrinterProfile;
298 DWORD ccPrinterProfile;
299 PSTR pTargetProfile;
300 DWORD ccTargetProfile;
301 DLGPROC lpfnHook;
302 LPARAM lParam;
303 PCMSCALLBACKA lpfnApplyCallback;
304 LPARAM lParamApplyCallback;
305 } COLORMATCHSETUPA, *PCOLORMATCHSETUPA, *LPCOLORMATCHSETUPA;
306
307 typedef struct _tagCOLORMATCHSETUPW
308 {
309 DWORD dwSize;
310 DWORD dwVersion;
311 DWORD dwFlags;
312 HWND hwndOwner;
313 PCWSTR pSourceName;
314 PCWSTR pDisplayName;
315 PCWSTR pPrinterName;
316 DWORD dwRenderIntent;
317 DWORD dwProofingIntent;
318 PWSTR pMonitorProfile;
319 DWORD ccMonitorProfile;
320 PWSTR pPrinterProfile;
321 DWORD ccPrinterProfile;
322 PWSTR pTargetProfile;
323 DWORD ccTargetProfile;
324 DLGPROC lpfnHook;
325 LPARAM lParam;
326 PCMSCALLBACKW lpfnApplyCallback;
327 LPARAM lParamApplyCallback;
328 } COLORMATCHSETUPW, *PCOLORMATCHSETUPW, *LPCOLORMATCHSETUPW;
329
330 BOOL WINAPI AssociateColorProfileWithDeviceA(PCSTR,PCSTR,PCSTR);
331 BOOL WINAPI AssociateColorProfileWithDeviceW(PCWSTR,PCWSTR,PCWSTR);
332 #define AssociateColorProfileWithDevice WINELIB_NAME_AW(AssociateColorProfileWithDevice)
333 BOOL WINAPI CheckBitmapBits(HTRANSFORM,PVOID,BMFORMAT,DWORD,DWORD,DWORD,PBYTE,PBMCALLBACKFN,LPARAM);
334 BOOL WINAPI CheckColors(HTRANSFORM,PCOLOR,DWORD,COLORTYPE,PBYTE);
335 BOOL WINAPI ConvertColorNameToIndex(HPROFILE,PCOLOR_NAME,PDWORD,DWORD);
336 BOOL WINAPI ConvertIndexToColorName(HPROFILE,PDWORD,PCOLOR_NAME,DWORD);
337 BOOL WINAPI CloseColorProfile(HPROFILE);
338 HTRANSFORM WINAPI CreateColorTransformA(LPLOGCOLORSPACEA,HPROFILE,HPROFILE,DWORD);
339 HTRANSFORM WINAPI CreateColorTransformW(LPLOGCOLORSPACEW,HPROFILE,HPROFILE,DWORD);
340 #define CreateColorTransform WINELIB_NAME_AW(CreateColorTransform)
341 BOOL WINAPI CreateDeviceLinkProfile(PHPROFILE,DWORD,PDWORD,DWORD,DWORD,PBYTE*,DWORD);
342 HTRANSFORM WINAPI CreateMultiProfileTransform(PHPROFILE,DWORD,PDWORD,DWORD,DWORD,DWORD);
343 BOOL WINAPI CreateProfileFromLogColorSpaceA(LPLOGCOLORSPACEA,PBYTE*);
344 BOOL WINAPI CreateProfileFromLogColorSpaceW(LPLOGCOLORSPACEW,PBYTE*);
345 #define CreateProfileFromLogColorSpace WINELIB_NAME_AW(CreateProfileFromLogColorSpace)
346 BOOL WINAPI DeleteColorTransform(HTRANSFORM);
347 BOOL WINAPI DisassociateColorProfileFromDeviceA(PCSTR,PCSTR,PCSTR);
348 BOOL WINAPI DisassociateColorProfileFromDeviceW(PCWSTR,PCWSTR,PCWSTR);
349 #define DisassociateColorProfileFromDevice WINELIB_NAME_AW(DisassociateColorProfileFromDevice)
350 BOOL WINAPI EnumColorProfilesA(PCSTR,PENUMTYPEA,PBYTE,PDWORD,PDWORD);
351 BOOL WINAPI EnumColorProfilesW(PCWSTR,PENUMTYPEW,PBYTE,PDWORD,PDWORD);
352 #define EnumColorProfiles WINELIB_NAME_AW(EnumColorProfiles)
353 DWORD WINAPI GenerateCopyFilePaths(LPCWSTR,LPCWSTR,LPBYTE,DWORD,LPWSTR,LPDWORD,LPWSTR,LPDWORD,DWORD);
354 DWORD WINAPI GetCMMInfo(HTRANSFORM,DWORD);
355 BOOL WINAPI GetColorDirectoryA(PCSTR,PSTR,PDWORD);
356 BOOL WINAPI GetColorDirectoryW(PCWSTR,PWSTR,PDWORD);
357 #define GetColorDirectory WINELIB_NAME_AW(GetColorDirectory)
358 BOOL WINAPI GetColorProfileElement(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID,PBOOL);
359 BOOL WINAPI GetColorProfileElementTag(HPROFILE,DWORD,PTAGTYPE);
360 BOOL WINAPI GetColorProfileFromHandle(HPROFILE,PBYTE,PDWORD);
361 BOOL WINAPI GetColorProfileHeader(HPROFILE,PPROFILEHEADER);
362 HCOLORSPACE WINAPI GetColorSpace(HDC);
363 BOOL WINAPI GetCountColorProfileElements(HPROFILE,PDWORD);
364 BOOL WINAPI GetNamedProfileInfo(HPROFILE,PNAMED_PROFILE_INFO);
365 BOOL WINAPI GetPS2ColorRenderingDictionary(HPROFILE,DWORD,PBYTE,PDWORD,PBOOL);
366 BOOL WINAPI GetPS2ColorRenderingIntent(HPROFILE,DWORD,PBYTE,PDWORD);
367 BOOL WINAPI GetPS2ColorSpaceArray(HPROFILE,DWORD,DWORD,PBYTE,PDWORD,PBOOL);
368 BOOL WINAPI GetStandardColorSpaceProfileA(PCSTR,DWORD,PSTR,PDWORD);
369 BOOL WINAPI GetStandardColorSpaceProfileW(PCWSTR,DWORD,PWSTR,PDWORD);
370 #define GetStandardColorSpaceProfile WINELIB_NAME_AW(GetStandardColorSpaceProfile)
371 BOOL WINAPI InstallColorProfileA(PCSTR,PCSTR);
372 BOOL WINAPI InstallColorProfileW(PCWSTR,PCWSTR);
373 #define InstallColorProfile WINELIB_NAME_AW(InstallColorProfile)
374 BOOL WINAPI IsColorProfileTagPresent(HPROFILE,TAGTYPE,PBOOL);
375 BOOL WINAPI IsColorProfileValid(HPROFILE,PBOOL);
376 HPROFILE WINAPI OpenColorProfileA(PPROFILE,DWORD,DWORD,DWORD);
377 HPROFILE WINAPI OpenColorProfileW(PPROFILE,DWORD,DWORD,DWORD);
378 #define OpenColorProfile WINELIB_NAME_AW(OpenColorProfile)
379 BOOL WINAPI RegisterCMMA(PCSTR,DWORD,PCSTR);
380 BOOL WINAPI RegisterCMMW(PCWSTR,DWORD,PCWSTR);
381 #define RegisterCMM WINELIB_NAME_AW(RegisterCMM)
382 BOOL WINAPI SelectCMM(DWORD id);
383 BOOL WINAPI SetColorProfileElement(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID);
384 BOOL WINAPI SetColorProfileElementReference(HPROFILE,TAGTYPE,TAGTYPE);
385 BOOL WINAPI SetColorProfileElementSize(HPROFILE,TAGTYPE,DWORD);
386 BOOL WINAPI SetColorProfileHeader(HPROFILE,PPROFILEHEADER);
387 HCOLORSPACE WINAPI SetColorSpace(HDC,HCOLORSPACE);
388 BOOL WINAPI SetStandardColorSpaceProfileA(PCSTR,DWORD,PSTR);
389 BOOL WINAPI SetStandardColorSpaceProfileW(PCWSTR,DWORD,PWSTR);
390 #define SetStandardColorSpaceProfile WINELIB_NAME_AW(SetStandardColorSpaceProfile)
391 BOOL WINAPI SetupColorMatchingA(PCOLORMATCHSETUPA);
392 BOOL WINAPI SetupColorMatchingW(PCOLORMATCHSETUPW);
393 #define SetupColorMatching WINELIB_NAME_AW(SetupColorMatching)
394 BOOL WINAPI SpoolerCopyFileEvent(LPWSTR,LPWSTR,DWORD);
395 BOOL WINAPI TranslateBitmapBits(HTRANSFORM,PVOID,BMFORMAT,DWORD,DWORD,DWORD,PVOID,BMFORMAT,DWORD,PBMCALLBACKFN,ULONG);
396 BOOL WINAPI TranslateColors(HTRANSFORM,PCOLOR,DWORD,COLORTYPE,PCOLOR,COLORTYPE);
397 BOOL WINAPI UninstallColorProfileA(PCSTR,PCSTR,BOOL);
398 BOOL WINAPI UninstallColorProfileW(PCWSTR,PCWSTR,BOOL);
399 #define UninstallColorProfile WINELIB_NAME_AW(UninstallColorProfile)
400 BOOL WINAPI UnregisterCMMA(PCSTR,DWORD);
401 BOOL WINAPI UnregisterCMMW(PCWSTR,DWORD);
402 #define UnregisterCMM WINELIB_NAME_AW(UnregisterCMM)
403
404 #define PROFILE_FILENAME 1
405 #define PROFILE_MEMBUFFER 2
406
407 #define PROFILE_READ 1
408 #define PROFILE_READWRITE 2
409
410 #define SPACE_XYZ 0x58595A20 /* 'XYZ ' */
411 #define SPACE_Lab 0x4C616220 /* 'Lab ' */
412 #define SPACE_Luv 0x4C757620 /* 'Luv ' */
413 #define SPACE_YCbCr 0x59436272 /* 'YCbr' */
414 #define SPACE_Yxy 0x59787920 /* 'Yxy ' */
415 #define SPACE_RGB 0x52474220 /* 'RGB ' */
416 #define SPACE_GRAY 0x47524159 /* 'GRAY' */
417 #define SPACE_HSV 0x48535620 /* 'HSV ' */
418 #define SPACE_HLS 0x484C5320 /* 'HLS ' */
419 #define SPACE_CMYK 0x434D594B /* 'CMYK' */
420 #define SPACE_CMY 0x434D5920 /* 'CMY ' */
421 #define SPACE_2_CHANNEL 0x32434c52 /* '2CLR' */
422 #define SPACE_3_CHANNEL 0x33434c52 /* '3CLR' */
423 #define SPACE_4_CHANNEL 0x34434c52 /* '4CLR' */
424 #define SPACE_5_CHANNEL 0x35434c52 /* '5CLR' */
425 #define SPACE_6_CHANNEL 0x36434c52 /* '6CLR' */
426 #define SPACE_7_CHANNEL 0x37434c52 /* '7CLR' */
427 #define SPACE_8_CHANNEL 0x38434c52 /* '8CLR' */
428
429 #ifdef __cplusplus
430 }
431 #endif
432
433 #endif /* __WINE_ICM_H */