fbbdede3ed226c479a1ab70a9c44907ebb2ea561
[reactos.git] / sdk / 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 enum
180 {
181 WCS_PROFILE_MANAGEMENT_SCOPE_SYSTEM_WIDE,
182 WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER
183 } WCS_PROFILE_MANAGEMENT_SCOPE;
184
185 typedef BOOL (CALLBACK *PBMCALLBACKFN)(ULONG,ULONG,LPARAM);
186 typedef PBMCALLBACKFN LPPBMCALLBACKFN;
187
188 #define INTENT_PERCEPTUAL 0
189 #define INTENT_RELATIVE_COLORIMETRIC 1
190 #define INTENT_SATURATION 2
191 #define INTENT_ABSOLUTE_COLORIMETRIC 3
192
193 typedef struct tagPROFILEHEADER
194 {
195 DWORD phSize;
196 DWORD phCMMType;
197 DWORD phVersion;
198 DWORD phClass;
199 DWORD phDataColorSpace;
200 DWORD phConnectionSpace;
201 DWORD phDateTime[3];
202 DWORD phSignature;
203 DWORD phPlatform;
204 DWORD phProfileFlags;
205 DWORD phManufacturer;
206 DWORD phModel;
207 DWORD phAttributes[2];
208 DWORD phRenderingIntent;
209 CIEXYZ phIlluminant;
210 DWORD phCreator;
211 BYTE phReserved[44];
212 } PROFILEHEADER, *PPROFILEHEADER, *LPPROFILEHEADER;
213
214 typedef struct tagPROFILE
215 {
216 DWORD dwType;
217 PVOID pProfileData;
218 DWORD cbDataSize;
219 } PROFILE, *PPROFILE, *LPPROFILE;
220
221 #define ENUM_TYPE_VERSION 0x0300
222
223 typedef struct tagENUMTYPEA
224 {
225 DWORD dwSize;
226 DWORD dwVersion;
227 DWORD dwFields;
228 PCSTR pDeviceName;
229 DWORD dwMediaType;
230 DWORD dwDitheringMode;
231 DWORD dwResolution[2];
232 DWORD dwCMMType;
233 DWORD dwClass;
234 DWORD dwDataColorSpace;
235 DWORD dwConnectionSpace;
236 DWORD dwSignature;
237 DWORD dwPlatform;
238 DWORD dwProfileFlags;
239 DWORD dwManufacturer;
240 DWORD dwModel;
241 DWORD dwAttributes[2];
242 DWORD dwRenderingIntent;
243 DWORD dwCreator;
244 DWORD dwDeviceClass;
245 } ENUMTYPEA, *PENUMTYPEA, *LPENUMTYPEA;
246
247 typedef struct tagENUMTYPEW
248 {
249 DWORD dwSize;
250 DWORD dwVersion;
251 DWORD dwFields;
252 PCWSTR pDeviceName;
253 DWORD dwMediaType;
254 DWORD dwDitheringMode;
255 DWORD dwResolution[2];
256 DWORD dwCMMType;
257 DWORD dwClass;
258 DWORD dwDataColorSpace;
259 DWORD dwConnectionSpace;
260 DWORD dwSignature;
261 DWORD dwPlatform;
262 DWORD dwProfileFlags;
263 DWORD dwManufacturer;
264 DWORD dwModel;
265 DWORD dwAttributes[2];
266 DWORD dwRenderingIntent;
267 DWORD dwCreator;
268 DWORD dwDeviceClass;
269 } ENUMTYPEW, *PENUMTYPEW, *LPENUMTYPEW;
270
271 #define ET_DEVICENAME 0x00000001
272 #define ET_MEDIATYPE 0x00000002
273 #define ET_DITHERMODE 0x00000004
274 #define ET_RESOLUTION 0x00000008
275 #define ET_CMMTYPE 0x00000010
276 #define ET_CLASS 0x00000020
277 #define ET_DATACOLORSPACE 0x00000040
278 #define ET_CONNECTIONSPACE 0x00000080
279 #define ET_SIGNATURE 0x00000100
280 #define ET_PLATFORM 0x00000200
281 #define ET_PROFILEFLAGS 0x00000400
282 #define ET_MANUFACTURER 0x00000800
283 #define ET_MODEL 0x00001000
284 #define ET_ATTRIBUTES 0x00002000
285 #define ET_RENDERINGINTENT 0x00004000
286 #define ET_CREATOR 0x00008000
287 #define ET_DEVICECLASS 0x00010000
288
289 struct _tagCOLORMATCHSETUPA;
290 struct _tagCOLORMATCHSETUPW;
291
292 typedef BOOL (WINAPI *PCMSCALLBACKA)(struct _tagCOLORMATCHSETUPA*,LPARAM);
293 typedef BOOL (WINAPI *PCMSCALLBACKW)(struct _tagCOLORMATCHSETUPW*,LPARAM);
294
295 typedef struct _tagCOLORMATCHSETUPA
296 {
297 DWORD dwSize;
298 DWORD dwVersion;
299 DWORD dwFlags;
300 HWND hwndOwner;
301 PCSTR pSourceName;
302 PCSTR pDisplayName;
303 PCSTR pPrinterName;
304 DWORD dwRenderIntent;
305 DWORD dwProofingIntent;
306 PSTR pMonitorProfile;
307 DWORD ccMonitorProfile;
308 PSTR pPrinterProfile;
309 DWORD ccPrinterProfile;
310 PSTR pTargetProfile;
311 DWORD ccTargetProfile;
312 DLGPROC lpfnHook;
313 LPARAM lParam;
314 PCMSCALLBACKA lpfnApplyCallback;
315 LPARAM lParamApplyCallback;
316 } COLORMATCHSETUPA, *PCOLORMATCHSETUPA, *LPCOLORMATCHSETUPA;
317
318 typedef struct _tagCOLORMATCHSETUPW
319 {
320 DWORD dwSize;
321 DWORD dwVersion;
322 DWORD dwFlags;
323 HWND hwndOwner;
324 PCWSTR pSourceName;
325 PCWSTR pDisplayName;
326 PCWSTR pPrinterName;
327 DWORD dwRenderIntent;
328 DWORD dwProofingIntent;
329 PWSTR pMonitorProfile;
330 DWORD ccMonitorProfile;
331 PWSTR pPrinterProfile;
332 DWORD ccPrinterProfile;
333 PWSTR pTargetProfile;
334 DWORD ccTargetProfile;
335 DLGPROC lpfnHook;
336 LPARAM lParam;
337 PCMSCALLBACKW lpfnApplyCallback;
338 LPARAM lParamApplyCallback;
339 } COLORMATCHSETUPW, *PCOLORMATCHSETUPW, *LPCOLORMATCHSETUPW;
340
341 BOOL WINAPI AssociateColorProfileWithDeviceA(PCSTR,PCSTR,PCSTR);
342 BOOL WINAPI AssociateColorProfileWithDeviceW(PCWSTR,PCWSTR,PCWSTR);
343 #define AssociateColorProfileWithDevice WINELIB_NAME_AW(AssociateColorProfileWithDevice)
344 BOOL WINAPI CheckBitmapBits(HTRANSFORM,PVOID,BMFORMAT,DWORD,DWORD,DWORD,PBYTE,PBMCALLBACKFN,LPARAM);
345 BOOL WINAPI CheckColors(HTRANSFORM,PCOLOR,DWORD,COLORTYPE,PBYTE);
346 BOOL WINAPI ConvertColorNameToIndex(HPROFILE,PCOLOR_NAME,PDWORD,DWORD);
347 BOOL WINAPI ConvertIndexToColorName(HPROFILE,PDWORD,PCOLOR_NAME,DWORD);
348 BOOL WINAPI CloseColorProfile(HPROFILE);
349 HTRANSFORM WINAPI CreateColorTransformA(LPLOGCOLORSPACEA,HPROFILE,HPROFILE,DWORD);
350 HTRANSFORM WINAPI CreateColorTransformW(LPLOGCOLORSPACEW,HPROFILE,HPROFILE,DWORD);
351 #define CreateColorTransform WINELIB_NAME_AW(CreateColorTransform)
352 BOOL WINAPI CreateDeviceLinkProfile(PHPROFILE,DWORD,PDWORD,DWORD,DWORD,PBYTE*,DWORD);
353 HTRANSFORM WINAPI CreateMultiProfileTransform(PHPROFILE,DWORD,PDWORD,DWORD,DWORD,DWORD);
354 BOOL WINAPI CreateProfileFromLogColorSpaceA(LPLOGCOLORSPACEA,PBYTE*);
355 BOOL WINAPI CreateProfileFromLogColorSpaceW(LPLOGCOLORSPACEW,PBYTE*);
356 #define CreateProfileFromLogColorSpace WINELIB_NAME_AW(CreateProfileFromLogColorSpace)
357 BOOL WINAPI DeleteColorTransform(HTRANSFORM);
358 BOOL WINAPI DisassociateColorProfileFromDeviceA(PCSTR,PCSTR,PCSTR);
359 BOOL WINAPI DisassociateColorProfileFromDeviceW(PCWSTR,PCWSTR,PCWSTR);
360 #define DisassociateColorProfileFromDevice WINELIB_NAME_AW(DisassociateColorProfileFromDevice)
361 BOOL WINAPI EnumColorProfilesA(PCSTR,PENUMTYPEA,PBYTE,PDWORD,PDWORD);
362 BOOL WINAPI EnumColorProfilesW(PCWSTR,PENUMTYPEW,PBYTE,PDWORD,PDWORD);
363 #define EnumColorProfiles WINELIB_NAME_AW(EnumColorProfiles)
364 DWORD WINAPI GenerateCopyFilePaths(LPCWSTR,LPCWSTR,LPBYTE,DWORD,LPWSTR,LPDWORD,LPWSTR,LPDWORD,DWORD);
365 DWORD WINAPI GetCMMInfo(HTRANSFORM,DWORD);
366 BOOL WINAPI GetColorDirectoryA(PCSTR,PSTR,PDWORD);
367 BOOL WINAPI GetColorDirectoryW(PCWSTR,PWSTR,PDWORD);
368 #define GetColorDirectory WINELIB_NAME_AW(GetColorDirectory)
369 BOOL WINAPI GetColorProfileElement(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID,PBOOL);
370 BOOL WINAPI GetColorProfileElementTag(HPROFILE,DWORD,PTAGTYPE);
371 BOOL WINAPI GetColorProfileFromHandle(HPROFILE,PBYTE,PDWORD);
372 BOOL WINAPI GetColorProfileHeader(HPROFILE,PPROFILEHEADER);
373 BOOL WINAPI GetCountColorProfileElements(HPROFILE,PDWORD);
374 BOOL WINAPI GetNamedProfileInfo(HPROFILE,PNAMED_PROFILE_INFO);
375 BOOL WINAPI GetPS2ColorRenderingDictionary(HPROFILE,DWORD,PBYTE,PDWORD,PBOOL);
376 BOOL WINAPI GetPS2ColorRenderingIntent(HPROFILE,DWORD,PBYTE,PDWORD);
377 BOOL WINAPI GetPS2ColorSpaceArray(HPROFILE,DWORD,DWORD,PBYTE,PDWORD,PBOOL);
378 BOOL WINAPI GetStandardColorSpaceProfileA(PCSTR,DWORD,PSTR,PDWORD);
379 BOOL WINAPI GetStandardColorSpaceProfileW(PCWSTR,DWORD,PWSTR,PDWORD);
380 #define GetStandardColorSpaceProfile WINELIB_NAME_AW(GetStandardColorSpaceProfile)
381 BOOL WINAPI InstallColorProfileA(PCSTR,PCSTR);
382 BOOL WINAPI InstallColorProfileW(PCWSTR,PCWSTR);
383 #define InstallColorProfile WINELIB_NAME_AW(InstallColorProfile)
384 BOOL WINAPI IsColorProfileTagPresent(HPROFILE,TAGTYPE,PBOOL);
385 BOOL WINAPI IsColorProfileValid(HPROFILE,PBOOL);
386 HPROFILE WINAPI OpenColorProfileA(PPROFILE,DWORD,DWORD,DWORD);
387 HPROFILE WINAPI OpenColorProfileW(PPROFILE,DWORD,DWORD,DWORD);
388 #define OpenColorProfile WINELIB_NAME_AW(OpenColorProfile)
389 BOOL WINAPI RegisterCMMA(PCSTR,DWORD,PCSTR);
390 BOOL WINAPI RegisterCMMW(PCWSTR,DWORD,PCWSTR);
391 #define RegisterCMM WINELIB_NAME_AW(RegisterCMM)
392 BOOL WINAPI SelectCMM(DWORD id);
393 BOOL WINAPI SetColorProfileElement(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID);
394 BOOL WINAPI SetColorProfileElementReference(HPROFILE,TAGTYPE,TAGTYPE);
395 BOOL WINAPI SetColorProfileElementSize(HPROFILE,TAGTYPE,DWORD);
396 BOOL WINAPI SetColorProfileHeader(HPROFILE,PPROFILEHEADER);
397 BOOL WINAPI SetStandardColorSpaceProfileA(PCSTR,DWORD,PSTR);
398 BOOL WINAPI SetStandardColorSpaceProfileW(PCWSTR,DWORD,PWSTR);
399 #define SetStandardColorSpaceProfile WINELIB_NAME_AW(SetStandardColorSpaceProfile)
400 BOOL WINAPI SetupColorMatchingA(PCOLORMATCHSETUPA);
401 BOOL WINAPI SetupColorMatchingW(PCOLORMATCHSETUPW);
402 #define SetupColorMatching WINELIB_NAME_AW(SetupColorMatching)
403 BOOL WINAPI SpoolerCopyFileEvent(LPWSTR,LPWSTR,DWORD);
404 BOOL WINAPI TranslateBitmapBits(HTRANSFORM,PVOID,BMFORMAT,DWORD,DWORD,DWORD,PVOID,BMFORMAT,DWORD,PBMCALLBACKFN,ULONG);
405 BOOL WINAPI TranslateColors(HTRANSFORM,PCOLOR,DWORD,COLORTYPE,PCOLOR,COLORTYPE);
406 BOOL WINAPI UninstallColorProfileA(PCSTR,PCSTR,BOOL);
407 BOOL WINAPI UninstallColorProfileW(PCWSTR,PCWSTR,BOOL);
408 #define UninstallColorProfile WINELIB_NAME_AW(UninstallColorProfile)
409 BOOL WINAPI UnregisterCMMA(PCSTR,DWORD);
410 BOOL WINAPI UnregisterCMMW(PCWSTR,DWORD);
411 #define UnregisterCMM WINELIB_NAME_AW(UnregisterCMM)
412 BOOL WINAPI WcsEnumColorProfilesSize(WCS_PROFILE_MANAGEMENT_SCOPE,ENUMTYPEW*,DWORD*);
413 BOOL WINAPI WcsGetUsePerUserProfiles(const WCHAR*,DWORD,BOOL*);
414
415 #define PROFILE_FILENAME 1
416 #define PROFILE_MEMBUFFER 2
417
418 #define PROFILE_READ 1
419 #define PROFILE_READWRITE 2
420
421 #define SPACE_XYZ 0x58595A20 /* 'XYZ ' */
422 #define SPACE_Lab 0x4C616220 /* 'Lab ' */
423 #define SPACE_Luv 0x4C757620 /* 'Luv ' */
424 #define SPACE_YCbCr 0x59436272 /* 'YCbr' */
425 #define SPACE_Yxy 0x59787920 /* 'Yxy ' */
426 #define SPACE_RGB 0x52474220 /* 'RGB ' */
427 #define SPACE_GRAY 0x47524159 /* 'GRAY' */
428 #define SPACE_HSV 0x48535620 /* 'HSV ' */
429 #define SPACE_HLS 0x484C5320 /* 'HLS ' */
430 #define SPACE_CMYK 0x434D594B /* 'CMYK' */
431 #define SPACE_CMY 0x434D5920 /* 'CMY ' */
432 #define SPACE_2_CHANNEL 0x32434c52 /* '2CLR' */
433 #define SPACE_3_CHANNEL 0x33434c52 /* '3CLR' */
434 #define SPACE_4_CHANNEL 0x34434c52 /* '4CLR' */
435 #define SPACE_5_CHANNEL 0x35434c52 /* '5CLR' */
436 #define SPACE_6_CHANNEL 0x36434c52 /* '6CLR' */
437 #define SPACE_7_CHANNEL 0x37434c52 /* '7CLR' */
438 #define SPACE_8_CHANNEL 0x38434c52 /* '8CLR' */
439
440 #ifdef __cplusplus
441 }
442 #endif
443
444 #endif /* __WINE_ICM_H */