Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2656 lines
80 KiB

  1. /*
  2. File: CMApplication.h
  3. Contains: Color Matching Interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1992-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __CMAPPLICATION__
  11. #define __CMAPPLICATION__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __FILES__
  16. #include <Files.h>
  17. #endif
  18. #ifndef __MACERRORS__
  19. #include <MacErrors.h>
  20. #endif
  21. #ifndef __CFSTRING__
  22. #include <CFString.h>
  23. #endif
  24. #ifndef __CFDICTIONARY__
  25. #include <CFDictionary.h>
  26. #endif
  27. #ifndef __CMICCPROFILE__
  28. #include <CMICCProfile.h>
  29. #endif
  30. #ifndef __CMTYPES__
  31. #include <CMTypes.h>
  32. #endif
  33. #define _DECLARE_CS_QD_API_ 1
  34. #ifndef __QUICKDRAW__
  35. #include <Quickdraw.h>
  36. #endif
  37. #if TARGET_API_MAC_OS8
  38. #endif /* TARGET_API_MAC_OS8 */
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #if PRAGMA_IMPORT
  46. #pragma import on
  47. #endif
  48. #if PRAGMA_STRUCT_ALIGN
  49. #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51. #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53. #pragma pack(2)
  54. #endif
  55. enum {
  56. kDefaultCMMSignature = FOUR_CHAR_CODE('appl')
  57. };
  58. /* Macintosh 68K trap word */
  59. enum {
  60. cmTrap = 0xABEE
  61. };
  62. /* PicComment IDs */
  63. enum {
  64. cmBeginProfile = 220,
  65. cmEndProfile = 221,
  66. cmEnableMatching = 222,
  67. cmDisableMatching = 223,
  68. cmComment = 224
  69. };
  70. /* PicComment selectors for cmComment */
  71. enum {
  72. cmBeginProfileSel = 0,
  73. cmContinueProfileSel = 1,
  74. cmEndProfileSel = 2,
  75. cmProfileIdentifierSel = 3
  76. };
  77. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  78. enum {
  79. cmMatchCMMType = 0x00000001,
  80. cmMatchApplProfileVersion = 0x00000002,
  81. cmMatchDataType = 0x00000004,
  82. cmMatchDeviceType = 0x00000008,
  83. cmMatchDeviceManufacturer = 0x00000010,
  84. cmMatchDeviceModel = 0x00000020,
  85. cmMatchDeviceAttributes = 0x00000040,
  86. cmMatchFlags = 0x00000080,
  87. cmMatchOptions = 0x00000100,
  88. cmMatchWhite = 0x00000200,
  89. cmMatchBlack = 0x00000400
  90. };
  91. /* Defines for version 2.0 CMSearchRecord.searchMask */
  92. enum {
  93. cmMatchAnyProfile = 0x00000000,
  94. cmMatchProfileCMMType = 0x00000001,
  95. cmMatchProfileClass = 0x00000002,
  96. cmMatchDataColorSpace = 0x00000004,
  97. cmMatchProfileConnectionSpace = 0x00000008,
  98. cmMatchManufacturer = 0x00000010,
  99. cmMatchModel = 0x00000020,
  100. cmMatchAttributes = 0x00000040,
  101. cmMatchProfileFlags = 0x00000080
  102. };
  103. /* Flags for PostScript-related functions */
  104. enum {
  105. cmPS7bit = 1,
  106. cmPS8bit = 2
  107. };
  108. /* Flags for profile embedding functions */
  109. enum {
  110. cmEmbedWholeProfile = 0x00000000,
  111. cmEmbedProfileIdentifier = 0x00000001
  112. };
  113. /* Commands for CMFlattenUPP() */
  114. enum {
  115. cmOpenReadSpool = 1,
  116. cmOpenWriteSpool = 2,
  117. cmReadSpool = 3,
  118. cmWriteSpool = 4,
  119. cmCloseSpool = 5
  120. };
  121. /* Commands for CMAccessUPP() */
  122. enum {
  123. cmOpenReadAccess = 1,
  124. cmOpenWriteAccess = 2,
  125. cmReadAccess = 3,
  126. cmWriteAccess = 4,
  127. cmCloseAccess = 5,
  128. cmCreateNewAccess = 6,
  129. cmAbortWriteAccess = 7,
  130. cmBeginAccess = 8,
  131. cmEndAccess = 9
  132. };
  133. /* Use types for CMGet/SetDefaultProfileByUse() */
  134. enum {
  135. cmInputUse = FOUR_CHAR_CODE('inpt'),
  136. cmOutputUse = FOUR_CHAR_CODE('outp'),
  137. cmDisplayUse = FOUR_CHAR_CODE('dply'),
  138. cmProofUse = FOUR_CHAR_CODE('pruf')
  139. };
  140. /* Union of 1.0 2.0, and 4.0 profile header variants */
  141. union CMAppleProfileHeader {
  142. CMHeader cm1;
  143. CM2Header cm2;
  144. CM4Header cm4;
  145. };
  146. typedef union CMAppleProfileHeader CMAppleProfileHeader;
  147. /* CWConcatColorWorld() definitions */
  148. struct CMConcatProfileSet {
  149. UInt16 keyIndex; /* Zero-based */
  150. UInt16 count; /* Min 1 */
  151. CMProfileRef profileSet[1]; /* Variable. Ordered from Source -> Dest */
  152. };
  153. typedef struct CMConcatProfileSet CMConcatProfileSet;
  154. /* NCWConcatColorWorld() definitions */
  155. struct NCMConcatProfileSpec {
  156. UInt32 renderingIntent; /* renderingIntent override */
  157. UInt32 transformTag; /* transform enumerations defined below */
  158. CMProfileRef profile; /* profile */
  159. };
  160. typedef struct NCMConcatProfileSpec NCMConcatProfileSpec;
  161. struct NCMConcatProfileSet {
  162. OSType cmm; /* e.g. 'KCMS', 'appl', ... uniquely ids the cmm, or 0000 */
  163. UInt32 flags; /* specify quality, lookup only, no gamut checking ... */
  164. UInt32 flagsMask; /* which bits of 'flags' to use to override profile */
  165. UInt32 profileCount; /* how many ProfileSpecs in the following set */
  166. NCMConcatProfileSpec profileSpecs[1]; /* Variable. Ordered from Source -> Dest */
  167. };
  168. typedef struct NCMConcatProfileSet NCMConcatProfileSet;
  169. enum {
  170. kNoTransform = 0, /* Not used */
  171. kUseAtoB = 1, /* Use 'A2B*' tag from this profile or equivalent */
  172. kUseBtoA = 2, /* Use 'B2A*' tag from this profile or equivalent */
  173. kUseBtoB = 3, /* Use 'pre*' tag from this profile or equivalent */
  174. /* For typical device profiles the following synonyms may be useful */
  175. kDeviceToPCS = kUseAtoB, /* Device Dependent to Device Independent */
  176. kPCSToDevice = kUseBtoA, /* Device Independent to Device Dependent */
  177. kPCSToPCS = kUseBtoB, /* Independent, through device's gamut */
  178. kUseProfileIntent = (long)0xFFFFFFFF /* For renderingIntent in NCMConcatProfileSpec */
  179. };
  180. /* ColorSync color data types */
  181. struct CMRGBColor {
  182. UInt16 red; /* 0..65535 */
  183. UInt16 green;
  184. UInt16 blue;
  185. };
  186. typedef struct CMRGBColor CMRGBColor;
  187. struct CMCMYKColor {
  188. UInt16 cyan; /* 0..65535 */
  189. UInt16 magenta;
  190. UInt16 yellow;
  191. UInt16 black;
  192. };
  193. typedef struct CMCMYKColor CMCMYKColor;
  194. struct CMCMYColor {
  195. UInt16 cyan; /* 0..65535 */
  196. UInt16 magenta;
  197. UInt16 yellow;
  198. };
  199. typedef struct CMCMYColor CMCMYColor;
  200. struct CMHLSColor {
  201. UInt16 hue; /* 0..65535. Fraction of circle. Red at 0 */
  202. UInt16 lightness; /* 0..65535 */
  203. UInt16 saturation; /* 0..65535 */
  204. };
  205. typedef struct CMHLSColor CMHLSColor;
  206. struct CMHSVColor {
  207. UInt16 hue; /* 0..65535. Fraction of circle. Red at 0 */
  208. UInt16 saturation; /* 0..65535 */
  209. UInt16 value; /* 0..65535 */
  210. };
  211. typedef struct CMHSVColor CMHSVColor;
  212. struct CMLabColor {
  213. UInt16 L; /* 0..65535 maps to 0..100 */
  214. UInt16 a; /* 0..65535 maps to -128..127.996 */
  215. UInt16 b; /* 0..65535 maps to -128..127.996 */
  216. };
  217. typedef struct CMLabColor CMLabColor;
  218. struct CMLuvColor {
  219. UInt16 L; /* 0..65535 maps to 0..100 */
  220. UInt16 u; /* 0..65535 maps to -128..127.996 */
  221. UInt16 v; /* 0..65535 maps to -128..127.996 */
  222. };
  223. typedef struct CMLuvColor CMLuvColor;
  224. struct CMYxyColor {
  225. UInt16 capY; /* 0..65535 maps to 0..1 */
  226. UInt16 x; /* 0..65535 maps to 0..1 */
  227. UInt16 y; /* 0..65535 maps to 0..1 */
  228. };
  229. typedef struct CMYxyColor CMYxyColor;
  230. struct CMGrayColor {
  231. UInt16 gray; /* 0..65535 */
  232. };
  233. typedef struct CMGrayColor CMGrayColor;
  234. struct CMMultichannel5Color {
  235. UInt8 components[5]; /* 0..255 */
  236. };
  237. typedef struct CMMultichannel5Color CMMultichannel5Color;
  238. struct CMMultichannel6Color {
  239. UInt8 components[6]; /* 0..255 */
  240. };
  241. typedef struct CMMultichannel6Color CMMultichannel6Color;
  242. struct CMMultichannel7Color {
  243. UInt8 components[7]; /* 0..255 */
  244. };
  245. typedef struct CMMultichannel7Color CMMultichannel7Color;
  246. struct CMMultichannel8Color {
  247. UInt8 components[8]; /* 0..255 */
  248. };
  249. typedef struct CMMultichannel8Color CMMultichannel8Color;
  250. struct CMNamedColor {
  251. UInt32 namedColorIndex; /* 0..a lot */
  252. };
  253. typedef struct CMNamedColor CMNamedColor;
  254. union CMColor {
  255. CMRGBColor rgb;
  256. CMHSVColor hsv;
  257. CMHLSColor hls;
  258. CMXYZColor XYZ;
  259. CMLabColor Lab;
  260. CMLuvColor Luv;
  261. CMYxyColor Yxy;
  262. CMCMYKColor cmyk;
  263. CMCMYColor cmy;
  264. CMGrayColor gray;
  265. CMMultichannel5Color mc5;
  266. CMMultichannel6Color mc6;
  267. CMMultichannel7Color mc7;
  268. CMMultichannel8Color mc8;
  269. CMNamedColor namedColor;
  270. };
  271. typedef union CMColor CMColor;
  272. /* GetIndexedProfile() search definition */
  273. struct CMProfileSearchRecord {
  274. CMHeader header;
  275. UInt32 fieldMask;
  276. UInt32 reserved[2];
  277. };
  278. typedef struct CMProfileSearchRecord CMProfileSearchRecord;
  279. typedef CMProfileSearchRecord * CMProfileSearchRecordPtr;
  280. typedef CMProfileSearchRecordPtr * CMProfileSearchRecordHandle;
  281. /* CMNewProfileSearch() search definition */
  282. struct CMSearchRecord {
  283. OSType CMMType;
  284. OSType profileClass;
  285. OSType dataColorSpace;
  286. OSType profileConnectionSpace;
  287. UInt32 deviceManufacturer;
  288. UInt32 deviceModel;
  289. UInt32 deviceAttributes[2];
  290. UInt32 profileFlags;
  291. UInt32 searchMask;
  292. CMProfileFilterUPP filter;
  293. };
  294. typedef struct CMSearchRecord CMSearchRecord;
  295. /* CMMIterateUPP() structure */
  296. struct CMMInfo {
  297. UInt32 dataSize; /* Size of this structure - compatibility*/
  298. OSType CMMType; /* Signature, e.g. 'appl', 'HDM ' or 'KCMS'*/
  299. OSType CMMMfr; /* Vendor, e.g. 'appl'*/
  300. UInt32 CMMVersion; /* CMM version number*/
  301. unsigned char ASCIIName[32]; /* pascal string - name*/
  302. unsigned char ASCIIDesc[256]; /* pascal string - description or copyright*/
  303. UniCharCount UniCodeNameCount; /* count of UniChars in following array*/
  304. UniChar UniCodeName[32]; /* the name in UniCode chars*/
  305. UniCharCount UniCodeDescCount; /* count of UniChars in following array*/
  306. UniChar UniCodeDesc[256]; /* the description in UniCode chars*/
  307. };
  308. typedef struct CMMInfo CMMInfo;
  309. /* GetCWInfo() structures */
  310. struct CMMInfoRecord {
  311. OSType CMMType;
  312. long CMMVersion;
  313. };
  314. typedef struct CMMInfoRecord CMMInfoRecord;
  315. struct CMCWInfoRecord {
  316. UInt32 cmmCount;
  317. CMMInfoRecord cmmInfo[2];
  318. };
  319. typedef struct CMCWInfoRecord CMCWInfoRecord;
  320. /* profile identifier structures */
  321. struct CMProfileIdentifier {
  322. CM2Header profileHeader;
  323. CMDateTime calibrationDate;
  324. UInt32 ASCIIProfileDescriptionLen;
  325. char ASCIIProfileDescription[1]; /* variable length */
  326. };
  327. typedef struct CMProfileIdentifier CMProfileIdentifier;
  328. typedef CMProfileIdentifier * CMProfileIdentifierPtr;
  329. /* colorspace masks */
  330. enum {
  331. cmColorSpaceSpaceMask = 0x0000003F,
  332. cmColorSpacePremulAlphaMask = 0x00000040,
  333. cmColorSpaceAlphaMask = 0x00000080,
  334. cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
  335. cmColorSpacePackingMask = 0x0000FF00,
  336. cmColorSpaceEncodingMask = 0x000F0000,
  337. cmColorSpaceReservedMask = (long)0xFFF00000
  338. };
  339. /* packing formats */
  340. enum {
  341. cmNoColorPacking = 0x0000,
  342. cmWord5ColorPacking = 0x0500,
  343. cmWord565ColorPacking = 0x0600,
  344. cmLong8ColorPacking = 0x0800,
  345. cmLong10ColorPacking = 0x0A00,
  346. cmAlphaFirstPacking = 0x1000,
  347. cmOneBitDirectPacking = 0x0B00,
  348. cmAlphaLastPacking = 0x0000,
  349. cm8_8ColorPacking = 0x2800,
  350. cm16_8ColorPacking = 0x2000,
  351. cm24_8ColorPacking = 0x2100,
  352. cm32_8ColorPacking = cmLong8ColorPacking,
  353. cm40_8ColorPacking = 0x2200,
  354. cm48_8ColorPacking = 0x2300,
  355. cm56_8ColorPacking = 0x2400,
  356. cm64_8ColorPacking = 0x2500,
  357. cm32_16ColorPacking = 0x2600,
  358. cm48_16ColorPacking = 0x2900,
  359. cm64_16ColorPacking = 0x2A00,
  360. cm32_32ColorPacking = 0x2700,
  361. cmLittleEndianPacking = 0x4000,
  362. cmReverseChannelPacking = 0x8000
  363. };
  364. /* channel encoding format */
  365. enum {
  366. cmSRGB16ChannelEncoding = 0x00010000 /* used for sRGB64 encoding ( .3.12 format)*/
  367. };
  368. /* general colorspaces */
  369. enum {
  370. cmNoSpace = 0x0000,
  371. cmRGBSpace = 0x0001,
  372. cmCMYKSpace = 0x0002,
  373. cmHSVSpace = 0x0003,
  374. cmHLSSpace = 0x0004,
  375. cmYXYSpace = 0x0005,
  376. cmXYZSpace = 0x0006,
  377. cmLUVSpace = 0x0007,
  378. cmLABSpace = 0x0008,
  379. cmReservedSpace1 = 0x0009,
  380. cmGraySpace = 0x000A,
  381. cmReservedSpace2 = 0x000B,
  382. cmGamutResultSpace = 0x000C,
  383. cmNamedIndexedSpace = 0x0010,
  384. cmMCFiveSpace = 0x0011,
  385. cmMCSixSpace = 0x0012,
  386. cmMCSevenSpace = 0x0013,
  387. cmMCEightSpace = 0x0014,
  388. cmAlphaPmulSpace = 0x0040,
  389. cmAlphaSpace = 0x0080,
  390. cmRGBASpace = cmRGBSpace + cmAlphaSpace,
  391. cmGrayASpace = cmGraySpace + cmAlphaSpace,
  392. cmRGBAPmulSpace = cmRGBASpace + cmAlphaPmulSpace,
  393. cmGrayAPmulSpace = cmGrayASpace + cmAlphaPmulSpace
  394. };
  395. /* supported CMBitmapColorSpaces - Each of the following is a */
  396. /* combination of a general colospace and a packing formats. */
  397. /* Each can also be or'd with cmReverseChannelPacking. */
  398. enum {
  399. cmGray8Space = cmGraySpace + cm8_8ColorPacking,
  400. cmGray16Space = cmGraySpace,
  401. cmGray16LSpace = cmGraySpace + cmLittleEndianPacking,
  402. cmGrayA16Space = cmGrayASpace + cm16_8ColorPacking,
  403. cmGrayA32Space = cmGrayASpace,
  404. cmGrayA32LSpace = cmGrayASpace + cmLittleEndianPacking,
  405. cmGrayA16PmulSpace = cmGrayAPmulSpace + cm16_8ColorPacking,
  406. cmGrayA32PmulSpace = cmGrayAPmulSpace,
  407. cmGrayA32LPmulSpace = cmGrayAPmulSpace + cmLittleEndianPacking,
  408. cmRGB16Space = cmRGBSpace + cmWord5ColorPacking,
  409. cmRGB16LSpace = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
  410. cmRGB565Space = cmRGBSpace + cmWord565ColorPacking,
  411. cmRGB565LSpace = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
  412. cmRGB24Space = cmRGBSpace + cm24_8ColorPacking,
  413. cmRGB32Space = cmRGBSpace + cm32_8ColorPacking,
  414. cmRGB48Space = cmRGBSpace + cm48_16ColorPacking,
  415. cmRGB48LSpace = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  416. cmARGB32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
  417. cmARGB64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
  418. cmARGB64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
  419. cmRGBA32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
  420. cmRGBA64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
  421. cmRGBA64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
  422. cmARGB32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaFirstPacking,
  423. cmARGB64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking,
  424. cmARGB64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
  425. cmRGBA32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaLastPacking,
  426. cmRGBA64PmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking,
  427. cmRGBA64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
  428. cmCMYK32Space = cmCMYKSpace + cm32_8ColorPacking,
  429. cmCMYK64Space = cmCMYKSpace + cm64_16ColorPacking,
  430. cmCMYK64LSpace = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
  431. cmHSV32Space = cmHSVSpace + cmLong10ColorPacking,
  432. cmHLS32Space = cmHLSSpace + cmLong10ColorPacking,
  433. cmYXY32Space = cmYXYSpace + cmLong10ColorPacking,
  434. cmXYZ24Space = cmXYZSpace + cm24_8ColorPacking,
  435. cmXYZ32Space = cmXYZSpace + cmLong10ColorPacking,
  436. cmXYZ48Space = cmXYZSpace + cm48_16ColorPacking,
  437. cmXYZ48LSpace = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  438. cmLUV32Space = cmLUVSpace + cmLong10ColorPacking,
  439. cmLAB24Space = cmLABSpace + cm24_8ColorPacking,
  440. cmLAB32Space = cmLABSpace + cmLong10ColorPacking,
  441. cmLAB48Space = cmLABSpace + cm48_16ColorPacking,
  442. cmLAB48LSpace = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  443. cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace,
  444. cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace,
  445. cmNamedIndexed32LSpace = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
  446. cmMCFive8Space = cm40_8ColorPacking + cmMCFiveSpace,
  447. cmMCSix8Space = cm48_8ColorPacking + cmMCSixSpace,
  448. cmMCSeven8Space = cm56_8ColorPacking + cmMCSevenSpace,
  449. cmMCEight8Space = cm64_8ColorPacking + cmMCEightSpace
  450. };
  451. typedef UInt32 CMBitmapColorSpace;
  452. struct CMBitmap {
  453. char * image;
  454. long width;
  455. long height;
  456. long rowBytes;
  457. long pixelSize;
  458. CMBitmapColorSpace space;
  459. long user1;
  460. long user2;
  461. };
  462. typedef struct CMBitmap CMBitmap;
  463. /* CMConvertXYZToXYZ() definitions */
  464. typedef UInt32 CMChromaticAdaptation;
  465. enum {
  466. cmUseDefaultChromaticAdaptation = 0,
  467. cmLinearChromaticAdaptation = 1,
  468. cmVonKriesChromaticAdaptation = 2,
  469. cmBradfordChromaticAdaptation = 3
  470. };
  471. /* Profile Locations */
  472. enum {
  473. CS_MAX_PATH = 256
  474. };
  475. enum {
  476. cmNoProfileBase = 0,
  477. cmFileBasedProfile = 1,
  478. cmHandleBasedProfile = 2,
  479. cmPtrBasedProfile = 3,
  480. cmProcedureBasedProfile = 4,
  481. cmPathBasedProfile = 5,
  482. cmBufferBasedProfile = 6
  483. };
  484. struct CMFileLocation {
  485. FSSpec spec;
  486. };
  487. typedef struct CMFileLocation CMFileLocation;
  488. struct CMHandleLocation {
  489. Handle h;
  490. };
  491. typedef struct CMHandleLocation CMHandleLocation;
  492. struct CMPtrLocation {
  493. Ptr p;
  494. };
  495. typedef struct CMPtrLocation CMPtrLocation;
  496. struct CMProcedureLocation {
  497. CMProfileAccessUPP proc;
  498. void * refCon;
  499. };
  500. typedef struct CMProcedureLocation CMProcedureLocation;
  501. struct CMPathLocation {
  502. char path[256];
  503. };
  504. typedef struct CMPathLocation CMPathLocation;
  505. struct CMBufferLocation {
  506. void * buffer;
  507. UInt32 size;
  508. };
  509. typedef struct CMBufferLocation CMBufferLocation;
  510. union CMProfLoc {
  511. CMFileLocation fileLoc;
  512. CMHandleLocation handleLoc;
  513. CMPtrLocation ptrLoc;
  514. CMProcedureLocation procLoc;
  515. CMPathLocation pathLoc;
  516. CMBufferLocation bufferLoc;
  517. };
  518. typedef union CMProfLoc CMProfLoc;
  519. struct CMProfileLocation {
  520. short locType;
  521. CMProfLoc u;
  522. };
  523. typedef struct CMProfileLocation CMProfileLocation;
  524. #if TARGET_OS_MAC
  525. enum {
  526. cmOriginalProfileLocationSize = 72,
  527. cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  528. };
  529. #else
  530. enum {
  531. cmOriginalProfileLocationSize = 2 + CS_MAX_PATH,
  532. cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  533. };
  534. #endif /* TARGET_OS_MAC */
  535. /* Struct and enums used for Profile iteration */
  536. enum {
  537. cmProfileIterateDataVersion1 = 0x00010000,
  538. cmProfileIterateDataVersion2 = 0x00020000, /* Added makeAndModel*/
  539. cmProfileIterateDataVersion3 = 0x00030000 /* Added MD5 digest*/
  540. };
  541. struct CMProfileIterateData {
  542. UInt32 dataVersion; /* cmProfileIterateDataVersion2 */
  543. CM2Header header;
  544. ScriptCode code;
  545. Str255 name;
  546. CMProfileLocation location;
  547. UniCharCount uniCodeNameCount;
  548. UniChar * uniCodeName;
  549. unsigned char * asciiName;
  550. CMMakeAndModel * makeAndModel;
  551. CMProfileMD5 * digest; /* Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm */
  552. };
  553. typedef struct CMProfileIterateData CMProfileIterateData;
  554. /* Caller-supplied callback function for Profile & CMM iteration */
  555. typedef CALLBACK_API( OSErr , CMProfileIterateProcPtr )(CMProfileIterateData *iterateData, void *refCon);
  556. typedef CALLBACK_API( OSErr , CMMIterateProcPtr )(CMMInfo *iterateData, void *refCon);
  557. typedef STACK_UPP_TYPE(CMProfileIterateProcPtr) CMProfileIterateUPP;
  558. typedef STACK_UPP_TYPE(CMMIterateProcPtr) CMMIterateUPP;
  559. /*
  560. * NewCMProfileIterateUPP()
  561. *
  562. * Availability:
  563. * Non-Carbon CFM: available as macro/inline
  564. * CarbonLib: in CarbonLib 1.0 and later
  565. * Mac OS X: in version 10.0 and later
  566. */
  567. EXTERN_API_C( CMProfileIterateUPP )
  568. NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine);
  569. #if !OPAQUE_UPP_TYPES
  570. enum { uppCMProfileIterateProcInfo = 0x000003E0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  571. #ifdef __cplusplus
  572. inline DEFINE_API_C(CMProfileIterateUPP) NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine) { return (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileIterateProcInfo, GetCurrentArchitecture()); }
  573. #else
  574. #define NewCMProfileIterateUPP(userRoutine) (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileIterateProcInfo, GetCurrentArchitecture())
  575. #endif
  576. #endif
  577. /*
  578. * NewCMMIterateUPP()
  579. *
  580. * Availability:
  581. * Non-Carbon CFM: available as macro/inline
  582. * CarbonLib: in CarbonLib 1.0 and later
  583. * Mac OS X: in version 10.0 and later
  584. */
  585. EXTERN_API_C( CMMIterateUPP )
  586. NewCMMIterateUPP(CMMIterateProcPtr userRoutine);
  587. #if !OPAQUE_UPP_TYPES
  588. enum { uppCMMIterateProcInfo = 0x000003E0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  589. #ifdef __cplusplus
  590. inline DEFINE_API_C(CMMIterateUPP) NewCMMIterateUPP(CMMIterateProcPtr userRoutine) { return (CMMIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture()); }
  591. #else
  592. #define NewCMMIterateUPP(userRoutine) (CMMIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture())
  593. #endif
  594. #endif
  595. /*
  596. * DisposeCMProfileIterateUPP()
  597. *
  598. * Availability:
  599. * Non-Carbon CFM: available as macro/inline
  600. * CarbonLib: in CarbonLib 1.0 and later
  601. * Mac OS X: in version 10.0 and later
  602. */
  603. EXTERN_API_C( void )
  604. DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP);
  605. #if !OPAQUE_UPP_TYPES
  606. #ifdef __cplusplus
  607. inline DEFINE_API_C(void) DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  608. #else
  609. #define DisposeCMProfileIterateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  610. #endif
  611. #endif
  612. /*
  613. * DisposeCMMIterateUPP()
  614. *
  615. * Availability:
  616. * Non-Carbon CFM: available as macro/inline
  617. * CarbonLib: in CarbonLib 1.0 and later
  618. * Mac OS X: in version 10.0 and later
  619. */
  620. EXTERN_API_C( void )
  621. DisposeCMMIterateUPP(CMMIterateUPP userUPP);
  622. #if !OPAQUE_UPP_TYPES
  623. #ifdef __cplusplus
  624. inline DEFINE_API_C(void) DisposeCMMIterateUPP(CMMIterateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  625. #else
  626. #define DisposeCMMIterateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  627. #endif
  628. #endif
  629. /*
  630. * InvokeCMProfileIterateUPP()
  631. *
  632. * Availability:
  633. * Non-Carbon CFM: available as macro/inline
  634. * CarbonLib: in CarbonLib 1.0 and later
  635. * Mac OS X: in version 10.0 and later
  636. */
  637. EXTERN_API_C( OSErr )
  638. InvokeCMProfileIterateUPP(
  639. CMProfileIterateData * iterateData,
  640. void * refCon,
  641. CMProfileIterateUPP userUPP);
  642. #if !OPAQUE_UPP_TYPES
  643. #ifdef __cplusplus
  644. inline DEFINE_API_C(OSErr) InvokeCMProfileIterateUPP(CMProfileIterateData * iterateData, void * refCon, CMProfileIterateUPP userUPP) { return (OSErr)CALL_TWO_PARAMETER_UPP(userUPP, uppCMProfileIterateProcInfo, iterateData, refCon); }
  645. #else
  646. #define InvokeCMProfileIterateUPP(iterateData, refCon, userUPP) (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileIterateProcInfo, (iterateData), (refCon))
  647. #endif
  648. #endif
  649. /*
  650. * InvokeCMMIterateUPP()
  651. *
  652. * Availability:
  653. * Non-Carbon CFM: available as macro/inline
  654. * CarbonLib: in CarbonLib 1.0 and later
  655. * Mac OS X: in version 10.0 and later
  656. */
  657. EXTERN_API_C( OSErr )
  658. InvokeCMMIterateUPP(
  659. CMMInfo * iterateData,
  660. void * refCon,
  661. CMMIterateUPP userUPP);
  662. #if !OPAQUE_UPP_TYPES
  663. #ifdef __cplusplus
  664. inline DEFINE_API_C(OSErr) InvokeCMMIterateUPP(CMMInfo * iterateData, void * refCon, CMMIterateUPP userUPP) { return (OSErr)CALL_TWO_PARAMETER_UPP(userUPP, uppCMMIterateProcInfo, iterateData, refCon); }
  665. #else
  666. #define InvokeCMMIterateUPP(iterateData, refCon, userUPP) (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMMIterateProcInfo, (iterateData), (refCon))
  667. #endif
  668. #endif
  669. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  670. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  671. #define NewCMProfileIterateProc(userRoutine) NewCMProfileIterateUPP(userRoutine)
  672. #define NewCMMIterateProc(userRoutine) NewCMMIterateUPP(userRoutine)
  673. #define CallCMProfileIterateProc(userRoutine, iterateData, refCon) InvokeCMProfileIterateUPP(iterateData, refCon, userRoutine)
  674. #define CallCMMIterateProc(userRoutine, iterateData, refCon) InvokeCMMIterateUPP(iterateData, refCon, userRoutine)
  675. #endif /* CALL_NOT_IN_CARBON */
  676. /*
  677. Clients can register for notifications of ColorSync preference changes by
  678. using the kCMPrefsChangedNotification key. This notification will be sent if the
  679. user changes ColorSync preferences such as:
  680. the default profile by colors space, (CMSetDefaultProfileBySpace)
  681. the default profile by device useage, (CMSetDefaultProfileByUse)
  682. or the preferred CMM.
  683. See <CMDeviceIntegration.h> for more notifications that can be sent.
  684. */
  685. #define kCMPrefsChangedNotification CFSTR("AppleColorSyncPreferencesChangedNotification")
  686. /* Profile file and element access */
  687. /*
  688. * CMNewProfile()
  689. *
  690. * Availability:
  691. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  692. * CarbonLib: in CarbonLib 1.0 and later
  693. * Mac OS X: in version 10.0 and later
  694. */
  695. EXTERN_API( CMError )
  696. CMNewProfile(
  697. CMProfileRef * prof,
  698. const CMProfileLocation * theProfile) FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  699. /*
  700. * CMOpenProfile()
  701. *
  702. * Availability:
  703. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  704. * CarbonLib: in CarbonLib 1.0 and later
  705. * Mac OS X: in version 10.0 and later
  706. */
  707. EXTERN_API( CMError )
  708. CMOpenProfile(
  709. CMProfileRef * prof,
  710. const CMProfileLocation * theProfile) FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  711. /*
  712. * CMCloseProfile()
  713. *
  714. * Availability:
  715. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  716. * CarbonLib: in CarbonLib 1.0 and later
  717. * Mac OS X: in version 10.0 and later
  718. */
  719. EXTERN_API( CMError )
  720. CMCloseProfile(CMProfileRef prof) FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  721. /*
  722. * CMUpdateProfile()
  723. *
  724. * Availability:
  725. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  726. * CarbonLib: in CarbonLib 1.0 and later
  727. * Mac OS X: in version 10.0 and later
  728. */
  729. EXTERN_API( CMError )
  730. CMUpdateProfile(CMProfileRef prof) FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  731. /*
  732. * CMCopyProfile()
  733. *
  734. * Availability:
  735. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  736. * CarbonLib: in CarbonLib 1.0 and later
  737. * Mac OS X: in version 10.0 and later
  738. */
  739. EXTERN_API( CMError )
  740. CMCopyProfile(
  741. CMProfileRef * targetProf,
  742. const CMProfileLocation * targetLocation,
  743. CMProfileRef srcProf) FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  744. /*
  745. * CMValidateProfile()
  746. *
  747. * Availability:
  748. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  749. * CarbonLib: in CarbonLib 1.0 and later
  750. * Mac OS X: in version 10.0 and later
  751. */
  752. EXTERN_API( CMError )
  753. CMValidateProfile(
  754. CMProfileRef prof,
  755. Boolean * valid,
  756. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  757. /*
  758. * CMGetProfileLocation()
  759. *
  760. * Availability:
  761. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  762. * CarbonLib: in CarbonLib 1.0 and later
  763. * Mac OS X: in version 10.0 and later
  764. */
  765. EXTERN_API( CMError )
  766. CMGetProfileLocation(
  767. CMProfileRef prof,
  768. CMProfileLocation * theProfile) FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  769. /*
  770. * NCMGetProfileLocation()
  771. *
  772. * Availability:
  773. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  774. * CarbonLib: in CarbonLib 1.0 and later
  775. * Mac OS X: in version 10.0 and later
  776. */
  777. EXTERN_API( CMError )
  778. NCMGetProfileLocation(
  779. CMProfileRef prof,
  780. CMProfileLocation * theProfile,
  781. UInt32 * locationSize) FOURWORDINLINE(0x203C, 0x000C, 0x0059, 0xABEE);
  782. /*
  783. * CMFlattenProfile()
  784. *
  785. * Availability:
  786. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  787. * CarbonLib: in CarbonLib 1.0 and later
  788. * Mac OS X: in version 10.0 and later
  789. */
  790. EXTERN_API( CMError )
  791. CMFlattenProfile(
  792. CMProfileRef prof,
  793. UInt32 flags,
  794. CMFlattenUPP proc,
  795. void * refCon,
  796. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  797. #if TARGET_OS_MAC
  798. #if CALL_NOT_IN_CARBON
  799. /*
  800. * CMUnflattenProfile()
  801. *
  802. * Availability:
  803. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  804. * CarbonLib: not available
  805. * Mac OS X: not available
  806. */
  807. EXTERN_API( CMError )
  808. CMUnflattenProfile(
  809. FSSpec * resultFileSpec,
  810. CMFlattenUPP proc,
  811. void * refCon,
  812. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  813. #endif /* CALL_NOT_IN_CARBON */
  814. #endif /* TARGET_OS_MAC */
  815. /*
  816. * CMGetProfileHeader()
  817. *
  818. * Availability:
  819. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  820. * CarbonLib: in CarbonLib 1.0 and later
  821. * Mac OS X: in version 10.0 and later
  822. */
  823. EXTERN_API( CMError )
  824. CMGetProfileHeader(
  825. CMProfileRef prof,
  826. CMAppleProfileHeader * header) FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  827. /*
  828. * CMSetProfileHeader()
  829. *
  830. * Availability:
  831. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  832. * CarbonLib: in CarbonLib 1.0 and later
  833. * Mac OS X: in version 10.0 and later
  834. */
  835. EXTERN_API( CMError )
  836. CMSetProfileHeader(
  837. CMProfileRef prof,
  838. const CMAppleProfileHeader * header) FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  839. /*
  840. * CMProfileElementExists()
  841. *
  842. * Availability:
  843. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  844. * CarbonLib: in CarbonLib 1.0 and later
  845. * Mac OS X: in version 10.0 and later
  846. */
  847. EXTERN_API( CMError )
  848. CMProfileElementExists(
  849. CMProfileRef prof,
  850. OSType tag,
  851. Boolean * found) FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  852. /*
  853. * CMCountProfileElements()
  854. *
  855. * Availability:
  856. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  857. * CarbonLib: in CarbonLib 1.0 and later
  858. * Mac OS X: in version 10.0 and later
  859. */
  860. EXTERN_API( CMError )
  861. CMCountProfileElements(
  862. CMProfileRef prof,
  863. UInt32 * elementCount) FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  864. /*
  865. * CMGetProfileElement()
  866. *
  867. * Availability:
  868. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  869. * CarbonLib: in CarbonLib 1.0 and later
  870. * Mac OS X: in version 10.0 and later
  871. */
  872. EXTERN_API( CMError )
  873. CMGetProfileElement(
  874. CMProfileRef prof,
  875. OSType tag,
  876. UInt32 * elementSize,
  877. void * elementData) FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  878. /*
  879. * CMSetProfileElement()
  880. *
  881. * Availability:
  882. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  883. * CarbonLib: in CarbonLib 1.0 and later
  884. * Mac OS X: in version 10.0 and later
  885. */
  886. EXTERN_API( CMError )
  887. CMSetProfileElement(
  888. CMProfileRef prof,
  889. OSType tag,
  890. UInt32 elementSize,
  891. const void * elementData) FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  892. /*
  893. * CMSetProfileElementSize()
  894. *
  895. * Availability:
  896. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  897. * CarbonLib: in CarbonLib 1.0 and later
  898. * Mac OS X: in version 10.0 and later
  899. */
  900. EXTERN_API( CMError )
  901. CMSetProfileElementSize(
  902. CMProfileRef prof,
  903. OSType tag,
  904. UInt32 elementSize) FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  905. /*
  906. * CMSetProfileElementReference()
  907. *
  908. * Availability:
  909. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  910. * CarbonLib: in CarbonLib 1.0 and later
  911. * Mac OS X: in version 10.0 and later
  912. */
  913. EXTERN_API( CMError )
  914. CMSetProfileElementReference(
  915. CMProfileRef prof,
  916. OSType elementTag,
  917. OSType referenceTag) FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  918. /*
  919. * CMGetPartialProfileElement()
  920. *
  921. * Availability:
  922. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  923. * CarbonLib: in CarbonLib 1.0 and later
  924. * Mac OS X: in version 10.0 and later
  925. */
  926. EXTERN_API( CMError )
  927. CMGetPartialProfileElement(
  928. CMProfileRef prof,
  929. OSType tag,
  930. UInt32 offset,
  931. UInt32 * byteCount,
  932. void * elementData) FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  933. /*
  934. * CMSetPartialProfileElement()
  935. *
  936. * Availability:
  937. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  938. * CarbonLib: in CarbonLib 1.0 and later
  939. * Mac OS X: in version 10.0 and later
  940. */
  941. EXTERN_API( CMError )
  942. CMSetPartialProfileElement(
  943. CMProfileRef prof,
  944. OSType tag,
  945. UInt32 offset,
  946. UInt32 byteCount,
  947. const void * elementData) FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  948. /*
  949. * CMGetIndProfileElementInfo()
  950. *
  951. * Availability:
  952. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  953. * CarbonLib: in CarbonLib 1.0 and later
  954. * Mac OS X: in version 10.0 and later
  955. */
  956. EXTERN_API( CMError )
  957. CMGetIndProfileElementInfo(
  958. CMProfileRef prof,
  959. UInt32 index,
  960. OSType * tag,
  961. UInt32 * elementSize,
  962. Boolean * refs) FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  963. /*
  964. * CMGetIndProfileElement()
  965. *
  966. * Availability:
  967. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  968. * CarbonLib: in CarbonLib 1.0 and later
  969. * Mac OS X: in version 10.0 and later
  970. */
  971. EXTERN_API( CMError )
  972. CMGetIndProfileElement(
  973. CMProfileRef prof,
  974. UInt32 index,
  975. UInt32 * elementSize,
  976. void * elementData) FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  977. /*
  978. * CMRemoveProfileElement()
  979. *
  980. * Availability:
  981. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  982. * CarbonLib: in CarbonLib 1.0 and later
  983. * Mac OS X: in version 10.0 and later
  984. */
  985. EXTERN_API( CMError )
  986. CMRemoveProfileElement(
  987. CMProfileRef prof,
  988. OSType tag) FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  989. /*
  990. * CMGetScriptProfileDescription()
  991. *
  992. * Availability:
  993. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  994. * CarbonLib: in CarbonLib 1.0 and later
  995. * Mac OS X: in version 10.0 and later
  996. */
  997. EXTERN_API( CMError )
  998. CMGetScriptProfileDescription(
  999. CMProfileRef prof,
  1000. Str255 name,
  1001. ScriptCode * code) FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  1002. /*
  1003. * CMGetProfileDescriptions()
  1004. *
  1005. * Availability:
  1006. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1007. * CarbonLib: in CarbonLib 1.0 and later
  1008. * Mac OS X: in version 10.0 and later
  1009. */
  1010. EXTERN_API( CMError )
  1011. CMGetProfileDescriptions(
  1012. CMProfileRef prof,
  1013. char * aName,
  1014. UInt32 * aCount,
  1015. Str255 mName,
  1016. ScriptCode * mCode,
  1017. UniChar * uName,
  1018. UniCharCount * uCount) FOURWORDINLINE(0x203C, 0x001A, 0x0067, 0xABEE);
  1019. /*
  1020. * CMSetProfileDescriptions()
  1021. *
  1022. * Availability:
  1023. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1024. * CarbonLib: in CarbonLib 1.0 and later
  1025. * Mac OS X: in version 10.0 and later
  1026. */
  1027. EXTERN_API( CMError )
  1028. CMSetProfileDescriptions(
  1029. CMProfileRef prof,
  1030. const char * aName,
  1031. UInt32 aCount,
  1032. ConstStr255Param mName,
  1033. ScriptCode mCode,
  1034. const UniChar * uName,
  1035. UniCharCount uCount) FOURWORDINLINE(0x203C, 0x001A, 0x0068, 0xABEE);
  1036. /*
  1037. * CMCopyProfileLocalizedStringDictionary()
  1038. *
  1039. * Availability:
  1040. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  1041. * CarbonLib: not available
  1042. * Mac OS X: in version 10.1 and later
  1043. */
  1044. EXTERN_API( CMError )
  1045. CMCopyProfileLocalizedStringDictionary(
  1046. CMProfileRef prof,
  1047. OSType tag,
  1048. CFDictionaryRef * theDict);
  1049. /*
  1050. * CMSetProfileLocalizedStringDictionary()
  1051. *
  1052. * Availability:
  1053. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  1054. * CarbonLib: not available
  1055. * Mac OS X: in version 10.1 and later
  1056. */
  1057. EXTERN_API( CMError )
  1058. CMSetProfileLocalizedStringDictionary(
  1059. CMProfileRef prof,
  1060. OSType tag,
  1061. CFDictionaryRef theDict);
  1062. /*
  1063. * CMCopyProfileLocalizedString()
  1064. *
  1065. * Availability:
  1066. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  1067. * CarbonLib: not available
  1068. * Mac OS X: in version 10.1 and later
  1069. */
  1070. EXTERN_API( CMError )
  1071. CMCopyProfileLocalizedString(
  1072. CMProfileRef prof,
  1073. OSType tag,
  1074. CFStringRef reqLocale,
  1075. CFStringRef * locale,
  1076. CFStringRef * str);
  1077. /*
  1078. * CMCloneProfileRef()
  1079. *
  1080. * Availability:
  1081. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1082. * CarbonLib: in CarbonLib 1.0 and later
  1083. * Mac OS X: in version 10.0 and later
  1084. */
  1085. EXTERN_API( CMError )
  1086. CMCloneProfileRef(CMProfileRef prof) FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  1087. /*
  1088. * CMGetProfileRefCount()
  1089. *
  1090. * Availability:
  1091. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1092. * CarbonLib: in CarbonLib 1.0 and later
  1093. * Mac OS X: in version 10.0 and later
  1094. */
  1095. EXTERN_API( CMError )
  1096. CMGetProfileRefCount(
  1097. CMProfileRef prof,
  1098. long * count) FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  1099. /*
  1100. * CMProfileModified()
  1101. *
  1102. * Availability:
  1103. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1104. * CarbonLib: in CarbonLib 1.0 and later
  1105. * Mac OS X: in version 10.0 and later
  1106. */
  1107. EXTERN_API( CMError )
  1108. CMProfileModified(
  1109. CMProfileRef prof,
  1110. Boolean * modified) FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  1111. /*
  1112. * CMGetProfileMD5()
  1113. *
  1114. * Availability:
  1115. * Non-Carbon CFM: not available
  1116. * CarbonLib: not available
  1117. * Mac OS X: in version 10.1 and later
  1118. */
  1119. EXTERN_API( CMError )
  1120. CMGetProfileMD5(
  1121. CMProfileRef prof,
  1122. CMProfileMD5 digest);
  1123. /* named Color access functions */
  1124. /*
  1125. * CMGetNamedColorInfo()
  1126. *
  1127. * Availability:
  1128. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1129. * CarbonLib: in CarbonLib 1.0 and later
  1130. * Mac OS X: in version 10.0 and later
  1131. */
  1132. EXTERN_API( CMError )
  1133. CMGetNamedColorInfo(
  1134. CMProfileRef prof,
  1135. UInt32 * deviceChannels,
  1136. OSType * deviceColorSpace,
  1137. OSType * PCSColorSpace,
  1138. UInt32 * count,
  1139. StringPtr prefix,
  1140. StringPtr suffix) FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  1141. /*
  1142. * CMGetNamedColorValue()
  1143. *
  1144. * Availability:
  1145. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1146. * CarbonLib: in CarbonLib 1.0 and later
  1147. * Mac OS X: in version 10.0 and later
  1148. */
  1149. EXTERN_API( CMError )
  1150. CMGetNamedColorValue(
  1151. CMProfileRef prof,
  1152. StringPtr name,
  1153. CMColor * deviceColor,
  1154. CMColor * PCSColor) FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  1155. /*
  1156. * CMGetIndNamedColorValue()
  1157. *
  1158. * Availability:
  1159. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1160. * CarbonLib: in CarbonLib 1.0 and later
  1161. * Mac OS X: in version 10.0 and later
  1162. */
  1163. EXTERN_API( CMError )
  1164. CMGetIndNamedColorValue(
  1165. CMProfileRef prof,
  1166. UInt32 index,
  1167. CMColor * deviceColor,
  1168. CMColor * PCSColor) FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  1169. /*
  1170. * CMGetNamedColorIndex()
  1171. *
  1172. * Availability:
  1173. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1174. * CarbonLib: in CarbonLib 1.0 and later
  1175. * Mac OS X: in version 10.0 and later
  1176. */
  1177. EXTERN_API( CMError )
  1178. CMGetNamedColorIndex(
  1179. CMProfileRef prof,
  1180. StringPtr name,
  1181. UInt32 * index) FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  1182. /*
  1183. * CMGetNamedColorName()
  1184. *
  1185. * Availability:
  1186. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1187. * CarbonLib: in CarbonLib 1.0 and later
  1188. * Mac OS X: in version 10.0 and later
  1189. */
  1190. EXTERN_API( CMError )
  1191. CMGetNamedColorName(
  1192. CMProfileRef prof,
  1193. UInt32 index,
  1194. StringPtr name) FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  1195. /* General-purpose matching functions */
  1196. /*
  1197. * NCWNewColorWorld()
  1198. *
  1199. * Availability:
  1200. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1201. * CarbonLib: in CarbonLib 1.0 and later
  1202. * Mac OS X: in version 10.0 and later
  1203. */
  1204. EXTERN_API( CMError )
  1205. NCWNewColorWorld(
  1206. CMWorldRef * cw,
  1207. CMProfileRef src,
  1208. CMProfileRef dst) FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  1209. /*
  1210. * CWConcatColorWorld()
  1211. *
  1212. * Availability:
  1213. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1214. * CarbonLib: in CarbonLib 1.0 and later
  1215. * Mac OS X: in version 10.0 and later
  1216. */
  1217. EXTERN_API( CMError )
  1218. CWConcatColorWorld(
  1219. CMWorldRef * cw,
  1220. CMConcatProfileSet * profileSet) FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  1221. /*
  1222. * CWNewLinkProfile()
  1223. *
  1224. * Availability:
  1225. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1226. * CarbonLib: in CarbonLib 1.0 and later
  1227. * Mac OS X: in version 10.0 and later
  1228. */
  1229. EXTERN_API( CMError )
  1230. CWNewLinkProfile(
  1231. CMProfileRef * prof,
  1232. const CMProfileLocation * targetLocation,
  1233. CMConcatProfileSet * profileSet) FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  1234. /*
  1235. * NCWConcatColorWorld()
  1236. *
  1237. * Availability:
  1238. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1239. * CarbonLib: in CarbonLib 1.0 and later
  1240. * Mac OS X: in version 10.0 and later
  1241. */
  1242. EXTERN_API( CMError )
  1243. NCWConcatColorWorld(
  1244. CMWorldRef * cw,
  1245. NCMConcatProfileSet * profileSet,
  1246. CMConcatCallBackUPP proc,
  1247. void * refCon) FOURWORDINLINE(0x203C, 0x0008, 0x0061, 0xABEE);
  1248. /*
  1249. * NCWNewLinkProfile()
  1250. *
  1251. * Availability:
  1252. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1253. * CarbonLib: in CarbonLib 1.0 and later
  1254. * Mac OS X: in version 10.0 and later
  1255. */
  1256. EXTERN_API( CMError )
  1257. NCWNewLinkProfile(
  1258. CMProfileRef * prof,
  1259. const CMProfileLocation * targetLocation,
  1260. NCMConcatProfileSet * profileSet,
  1261. CMConcatCallBackUPP proc,
  1262. void * refCon) FOURWORDINLINE(0x203C, 0x000C, 0x0062, 0xABEE);
  1263. /*
  1264. * CWDisposeColorWorld()
  1265. *
  1266. * Availability:
  1267. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1268. * CarbonLib: in CarbonLib 1.0 and later
  1269. * Mac OS X: in version 10.0 and later
  1270. */
  1271. EXTERN_API( void )
  1272. CWDisposeColorWorld(CMWorldRef cw) FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  1273. /*
  1274. * CWMatchColors()
  1275. *
  1276. * Availability:
  1277. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1278. * CarbonLib: in CarbonLib 1.0 and later
  1279. * Mac OS X: in version 10.0 and later
  1280. */
  1281. EXTERN_API( CMError )
  1282. CWMatchColors(
  1283. CMWorldRef cw,
  1284. CMColor * myColors,
  1285. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  1286. /*
  1287. * CWCheckColors()
  1288. *
  1289. * Availability:
  1290. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1291. * CarbonLib: in CarbonLib 1.0 and later
  1292. * Mac OS X: in version 10.0 and later
  1293. */
  1294. EXTERN_API( CMError )
  1295. CWCheckColors(
  1296. CMWorldRef cw,
  1297. CMColor * myColors,
  1298. UInt32 count,
  1299. UInt32 * result) FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  1300. /*
  1301. * CWMatchBitmap()
  1302. *
  1303. * Availability:
  1304. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1305. * CarbonLib: in CarbonLib 1.0 and later
  1306. * Mac OS X: in version 10.0 and later
  1307. */
  1308. EXTERN_API( CMError )
  1309. CWMatchBitmap(
  1310. CMWorldRef cw,
  1311. CMBitmap * bitmap,
  1312. CMBitmapCallBackUPP progressProc,
  1313. void * refCon,
  1314. CMBitmap * matchedBitmap) FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  1315. /*
  1316. * CWCheckBitmap()
  1317. *
  1318. * Availability:
  1319. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1320. * CarbonLib: in CarbonLib 1.0 and later
  1321. * Mac OS X: in version 10.0 and later
  1322. */
  1323. EXTERN_API( CMError )
  1324. CWCheckBitmap(
  1325. CMWorldRef cw,
  1326. const CMBitmap * bitmap,
  1327. CMBitmapCallBackUPP progressProc,
  1328. void * refCon,
  1329. CMBitmap * resultBitmap) FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  1330. /* Quickdraw-specific matching */
  1331. #if TARGET_OS_MAC && _DECLARE_CS_QD_API_
  1332. /*
  1333. * CWMatchPixMap()
  1334. *
  1335. * Availability:
  1336. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1337. * CarbonLib: in CarbonLib 1.0 and later
  1338. * Mac OS X: not available
  1339. */
  1340. EXTERN_API( CMError )
  1341. CWMatchPixMap(
  1342. CMWorldRef cw,
  1343. PixMap * myPixMap,
  1344. CMBitmapCallBackUPP progressProc,
  1345. void * refCon) FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  1346. /*
  1347. * CWCheckPixMap()
  1348. *
  1349. * Availability:
  1350. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1351. * CarbonLib: in CarbonLib 1.0 and later
  1352. * Mac OS X: not available
  1353. */
  1354. EXTERN_API( CMError )
  1355. CWCheckPixMap(
  1356. CMWorldRef cw,
  1357. PixMap * myPixMap,
  1358. CMBitmapCallBackUPP progressProc,
  1359. void * refCon,
  1360. BitMap * resultBitMap) FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  1361. /*
  1362. * NCMBeginMatching()
  1363. *
  1364. * Availability:
  1365. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1366. * CarbonLib: in CarbonLib 1.0 and later
  1367. * Mac OS X: not available
  1368. */
  1369. EXTERN_API( CMError )
  1370. NCMBeginMatching(
  1371. CMProfileRef src,
  1372. CMProfileRef dst,
  1373. CMMatchRef * myRef) FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  1374. /*
  1375. * CMEndMatching()
  1376. *
  1377. * Availability:
  1378. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1379. * CarbonLib: in CarbonLib 1.0 and later
  1380. * Mac OS X: not available
  1381. */
  1382. EXTERN_API( void )
  1383. CMEndMatching(CMMatchRef myRef) FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  1384. /*
  1385. * NCMDrawMatchedPicture()
  1386. *
  1387. * Availability:
  1388. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1389. * CarbonLib: in CarbonLib 1.0 and later
  1390. * Mac OS X: not available
  1391. */
  1392. EXTERN_API( void )
  1393. NCMDrawMatchedPicture(
  1394. PicHandle myPicture,
  1395. CMProfileRef dst,
  1396. Rect * myRect) FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  1397. /*
  1398. * CMEnableMatchingComment()
  1399. *
  1400. * Availability:
  1401. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1402. * CarbonLib: in CarbonLib 1.0 and later
  1403. * Mac OS X: not available
  1404. */
  1405. EXTERN_API( void )
  1406. CMEnableMatchingComment(Boolean enableIt) FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  1407. /*
  1408. * NCMUseProfileComment()
  1409. *
  1410. * Availability:
  1411. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1412. * CarbonLib: in CarbonLib 1.0 and later
  1413. * Mac OS X: not available
  1414. */
  1415. EXTERN_API( CMError )
  1416. NCMUseProfileComment(
  1417. CMProfileRef prof,
  1418. UInt32 flags) FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  1419. #endif /* TARGET_OS_MAC && _DECLARE_CS_QD_API_ */
  1420. #if TARGET_OS_WIN32
  1421. #if CALL_NOT_IN_CARBON
  1422. /*
  1423. * CWMatchHBITMAP()
  1424. *
  1425. * Availability:
  1426. * Non-Carbon CFM: not available
  1427. * CarbonLib: not available
  1428. * Mac OS X: not available
  1429. */
  1430. EXTERN_API( CMError )
  1431. CWMatchHBITMAP(
  1432. CMWorldRef cw,
  1433. void * hBitmap,
  1434. CMBitmapCallBackUPP progressProc,
  1435. void * refCon);
  1436. #endif /* CALL_NOT_IN_CARBON */
  1437. #endif /* TARGET_OS_WIN32 */
  1438. /*
  1439. * CMCreateProfileIdentifier()
  1440. *
  1441. * Availability:
  1442. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1443. * CarbonLib: in CarbonLib 1.0 and later
  1444. * Mac OS X: in version 10.0 and later
  1445. */
  1446. EXTERN_API( CMError )
  1447. CMCreateProfileIdentifier(
  1448. CMProfileRef prof,
  1449. CMProfileIdentifierPtr ident,
  1450. UInt32 * size) FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  1451. /* System Profile access */
  1452. /*
  1453. * CMGetSystemProfile()
  1454. *
  1455. * Availability:
  1456. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1457. * CarbonLib: in CarbonLib 1.0 and later
  1458. * Mac OS X: in version 10.0 and later
  1459. */
  1460. EXTERN_API( CMError )
  1461. CMGetSystemProfile(CMProfileRef * prof) FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  1462. /*
  1463. * CMSetSystemProfile()
  1464. *
  1465. * Availability:
  1466. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1467. * CarbonLib: in CarbonLib 1.0 and later
  1468. * Mac OS X: in version 10.0 and later
  1469. */
  1470. EXTERN_API( CMError )
  1471. CMSetSystemProfile(const FSSpec * profileFileSpec) FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  1472. /*
  1473. * NCMSetSystemProfile()
  1474. *
  1475. * Availability:
  1476. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1477. * CarbonLib: in CarbonLib 1.0 and later
  1478. * Mac OS X: in version 10.0 and later
  1479. */
  1480. EXTERN_API( CMError )
  1481. NCMSetSystemProfile(const CMProfileLocation * profLoc) FOURWORDINLINE(0x203C, 0x0004, 0x0064, 0xABEE);
  1482. /*
  1483. * CMGetDefaultProfileBySpace()
  1484. *
  1485. * Availability:
  1486. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1487. * CarbonLib: in CarbonLib 1.0 and later
  1488. * Mac OS X: in version 10.0 and later
  1489. */
  1490. EXTERN_API( CMError )
  1491. CMGetDefaultProfileBySpace(
  1492. OSType dataColorSpace,
  1493. CMProfileRef * prof) FOURWORDINLINE(0x203C, 0x0008, 0x005A, 0xABEE);
  1494. /*
  1495. * CMSetDefaultProfileBySpace()
  1496. *
  1497. * Availability:
  1498. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1499. * CarbonLib: in CarbonLib 1.0 and later
  1500. * Mac OS X: in version 10.0 and later
  1501. */
  1502. EXTERN_API( CMError )
  1503. CMSetDefaultProfileBySpace(
  1504. OSType dataColorSpace,
  1505. CMProfileRef prof) FOURWORDINLINE(0x203C, 0x0008, 0x005B, 0xABEE);
  1506. #if TARGET_OS_MAC
  1507. /*
  1508. * CMGetProfileByAVID()
  1509. *
  1510. * Availability:
  1511. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1512. * CarbonLib: in CarbonLib 1.0 and later
  1513. * Mac OS X: in version 10.0 and later
  1514. */
  1515. EXTERN_API( CMError )
  1516. CMGetProfileByAVID(
  1517. CMDisplayIDType theID,
  1518. CMProfileRef * prof) FOURWORDINLINE(0x203C, 0x0008, 0x005C, 0xABEE);
  1519. /*
  1520. * CMSetProfileByAVID()
  1521. *
  1522. * Availability:
  1523. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1524. * CarbonLib: in CarbonLib 1.0 and later
  1525. * Mac OS X: in version 10.0 and later
  1526. */
  1527. EXTERN_API( CMError )
  1528. CMSetProfileByAVID(
  1529. CMDisplayIDType theID,
  1530. CMProfileRef prof) FOURWORDINLINE(0x203C, 0x0008, 0x005D, 0xABEE);
  1531. /*
  1532. * CMGetGammaByAVID()
  1533. *
  1534. * Availability:
  1535. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1536. * CarbonLib: in CarbonLib 1.0 and later
  1537. * Mac OS X: in version 10.0 and later
  1538. */
  1539. EXTERN_API( CMError )
  1540. CMGetGammaByAVID(
  1541. CMDisplayIDType theID,
  1542. CMVideoCardGamma * gamma,
  1543. UInt32 * size);
  1544. /*
  1545. * CMSetGammaByAVID()
  1546. *
  1547. * Availability:
  1548. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1549. * CarbonLib: in CarbonLib 1.0 and later
  1550. * Mac OS X: in version 10.0 and later
  1551. */
  1552. EXTERN_API( CMError )
  1553. CMSetGammaByAVID(
  1554. CMDisplayIDType theID,
  1555. CMVideoCardGamma * gamma);
  1556. #endif /* TARGET_OS_MAC */
  1557. /* Profile access by Use */
  1558. /*
  1559. * CMGetDefaultProfileByUse()
  1560. *
  1561. * Availability:
  1562. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1563. * CarbonLib: in CarbonLib 1.0 and later
  1564. * Mac OS X: in version 10.0 and later
  1565. */
  1566. EXTERN_API( CMError )
  1567. CMGetDefaultProfileByUse(
  1568. OSType use,
  1569. CMProfileRef * prof) FOURWORDINLINE(0x203C, 0x0008, 0x0069, 0xABEE);
  1570. /*
  1571. * CMSetDefaultProfileByUse()
  1572. *
  1573. * Availability:
  1574. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1575. * CarbonLib: in CarbonLib 1.0 and later
  1576. * Mac OS X: in version 10.0 and later
  1577. */
  1578. EXTERN_API( CMError )
  1579. CMSetDefaultProfileByUse(
  1580. OSType use,
  1581. CMProfileRef prof) FOURWORDINLINE(0x203C, 0x0008, 0x0079, 0xABEE);
  1582. /* Profile Management */
  1583. /*
  1584. * CMNewProfileSearch()
  1585. *
  1586. * Availability:
  1587. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1588. * CarbonLib: in CarbonLib 1.0 and later
  1589. * Mac OS X: in version 10.0 and later
  1590. */
  1591. EXTERN_API( CMError )
  1592. CMNewProfileSearch(
  1593. CMSearchRecord * searchSpec,
  1594. void * refCon,
  1595. UInt32 * count,
  1596. CMProfileSearchRef * searchResult) FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  1597. /*
  1598. * CMUpdateProfileSearch()
  1599. *
  1600. * Availability:
  1601. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1602. * CarbonLib: in CarbonLib 1.0 and later
  1603. * Mac OS X: in version 10.0 and later
  1604. */
  1605. EXTERN_API( CMError )
  1606. CMUpdateProfileSearch(
  1607. CMProfileSearchRef search,
  1608. void * refCon,
  1609. UInt32 * count) FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  1610. /*
  1611. * CMDisposeProfileSearch()
  1612. *
  1613. * Availability:
  1614. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1615. * CarbonLib: in CarbonLib 1.0 and later
  1616. * Mac OS X: in version 10.0 and later
  1617. */
  1618. EXTERN_API( void )
  1619. CMDisposeProfileSearch(CMProfileSearchRef search) FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  1620. /*
  1621. * CMSearchGetIndProfile()
  1622. *
  1623. * Availability:
  1624. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1625. * CarbonLib: in CarbonLib 1.0 and later
  1626. * Mac OS X: in version 10.0 and later
  1627. */
  1628. EXTERN_API( CMError )
  1629. CMSearchGetIndProfile(
  1630. CMProfileSearchRef search,
  1631. UInt32 index,
  1632. CMProfileRef * prof) FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  1633. /*
  1634. * CMSearchGetIndProfileFileSpec()
  1635. *
  1636. * Availability:
  1637. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1638. * CarbonLib: in CarbonLib 1.0 and later
  1639. * Mac OS X: in version 10.0 and later
  1640. */
  1641. EXTERN_API( CMError )
  1642. CMSearchGetIndProfileFileSpec(
  1643. CMProfileSearchRef search,
  1644. UInt32 index,
  1645. FSSpec * profileFile) FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  1646. /*
  1647. * CMProfileIdentifierFolderSearch()
  1648. *
  1649. * Availability:
  1650. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1651. * CarbonLib: in CarbonLib 1.0 and later
  1652. * Mac OS X: in version 10.0 and later
  1653. */
  1654. EXTERN_API( CMError )
  1655. CMProfileIdentifierFolderSearch(
  1656. CMProfileIdentifierPtr ident,
  1657. UInt32 * matchedCount,
  1658. CMProfileSearchRef * searchResult) FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  1659. /*
  1660. * CMProfileIdentifierListSearch()
  1661. *
  1662. * Availability:
  1663. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1664. * CarbonLib: in CarbonLib 1.0 and later
  1665. * Mac OS X: in version 10.0 and later
  1666. */
  1667. EXTERN_API( CMError )
  1668. CMProfileIdentifierListSearch(
  1669. CMProfileIdentifierPtr ident,
  1670. CMProfileRef * profileList,
  1671. UInt32 listSize,
  1672. UInt32 * matchedCount,
  1673. CMProfileRef * matchedList) FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  1674. /*
  1675. * CMIterateColorSyncFolder()
  1676. *
  1677. * Availability:
  1678. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1679. * CarbonLib: in CarbonLib 1.0 and later
  1680. * Mac OS X: in version 10.0 and later
  1681. */
  1682. EXTERN_API( CMError )
  1683. CMIterateColorSyncFolder(
  1684. CMProfileIterateUPP proc,
  1685. UInt32 * seed,
  1686. UInt32 * count,
  1687. void * refCon) FOURWORDINLINE(0x203C, 0x0010, 0x0058, 0xABEE);
  1688. /*
  1689. * NCMUnflattenProfile()
  1690. *
  1691. * Availability:
  1692. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1693. * CarbonLib: in CarbonLib 1.0 and later
  1694. * Mac OS X: in version 10.0 and later
  1695. */
  1696. EXTERN_API( CMError )
  1697. NCMUnflattenProfile(
  1698. CMProfileLocation * targetLocation,
  1699. CMFlattenUPP proc,
  1700. void * refCon,
  1701. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0010, 0x0065, 0xABEE);
  1702. /* Utilities */
  1703. #if TARGET_OS_MAC
  1704. /*
  1705. * CMGetColorSyncFolderSpec()
  1706. *
  1707. * Availability:
  1708. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1709. * CarbonLib: in CarbonLib 1.0 and later
  1710. * Mac OS X: in version 10.0 and later
  1711. */
  1712. EXTERN_API( CMError )
  1713. CMGetColorSyncFolderSpec(
  1714. short vRefNum,
  1715. Boolean createFolder,
  1716. short * foundVRefNum,
  1717. long * foundDirID) FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  1718. #endif /* TARGET_OS_MAC */
  1719. #if TARGET_OS_WIN32 || TARGET_OS_UNIX
  1720. #if CALL_NOT_IN_CARBON
  1721. /*
  1722. * CMGetColorSyncFolderPath()
  1723. *
  1724. * Availability:
  1725. * Non-Carbon CFM: not available
  1726. * CarbonLib: not available
  1727. * Mac OS X: not available
  1728. */
  1729. EXTERN_API( CMError )
  1730. CMGetColorSyncFolderPath(
  1731. Boolean createFolder,
  1732. char * lpBuffer,
  1733. UInt32 uSize);
  1734. #endif /* CALL_NOT_IN_CARBON */
  1735. #endif /* TARGET_OS_WIN32 || TARGET_OS_UNIX */
  1736. /*
  1737. * CMGetCWInfo()
  1738. *
  1739. * Availability:
  1740. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1741. * CarbonLib: in CarbonLib 1.0 and later
  1742. * Mac OS X: in version 10.0 and later
  1743. */
  1744. EXTERN_API( CMError )
  1745. CMGetCWInfo(
  1746. CMWorldRef cw,
  1747. CMCWInfoRecord * info) FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  1748. #if TARGET_API_MAC_OS8
  1749. #if CALL_NOT_IN_CARBON
  1750. /*
  1751. * CMConvertProfile2to1()
  1752. *
  1753. * Availability:
  1754. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1755. * CarbonLib: not available
  1756. * Mac OS X: not available
  1757. */
  1758. EXTERN_API( CMError )
  1759. CMConvertProfile2to1(
  1760. CMProfileRef profv2,
  1761. CMProfileHandle * profv1) FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  1762. #endif /* CALL_NOT_IN_CARBON */
  1763. #endif /* TARGET_API_MAC_OS8 */
  1764. /*
  1765. * CMGetPreferredCMM()
  1766. *
  1767. * Availability:
  1768. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1769. * CarbonLib: in CarbonLib 1.0 and later
  1770. * Mac OS X: in version 10.0 and later
  1771. */
  1772. EXTERN_API( CMError )
  1773. CMGetPreferredCMM(
  1774. OSType * cmmType,
  1775. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0008, 0x005E, 0xABEE);
  1776. /*
  1777. * CMIterateCMMInfo()
  1778. *
  1779. * Availability:
  1780. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1781. * CarbonLib: in CarbonLib 1.0 and later
  1782. * Mac OS X: in version 10.0 and later
  1783. */
  1784. EXTERN_API( CMError )
  1785. CMIterateCMMInfo(
  1786. CMMIterateUPP proc,
  1787. UInt32 * count,
  1788. void * refCon) FOURWORDINLINE(0x203C, 0x000C, 0x0063, 0xABEE);
  1789. /*
  1790. * CMGetColorSyncVersion()
  1791. *
  1792. * Availability:
  1793. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1794. * CarbonLib: in CarbonLib 1.0 and later
  1795. * Mac OS X: in version 10.0 and later
  1796. */
  1797. EXTERN_API( CMError )
  1798. CMGetColorSyncVersion(UInt32 * version) FOURWORDINLINE(0x203C, 0x0004, 0x0066, 0xABEE);
  1799. /*
  1800. * CMLaunchControlPanel()
  1801. *
  1802. * Availability:
  1803. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1804. * CarbonLib: in CarbonLib 1.0 and later
  1805. * Mac OS X: in version 10.0 and later
  1806. */
  1807. EXTERN_API( CMError )
  1808. CMLaunchControlPanel(UInt32 flags);
  1809. /* ColorSpace conversion functions */
  1810. /*
  1811. * CMConvertXYZToLab()
  1812. *
  1813. * Availability:
  1814. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1815. * CarbonLib: in CarbonLib 1.0 and later
  1816. * Mac OS X: in version 10.0 and later
  1817. */
  1818. EXTERN_API( CMError )
  1819. CMConvertXYZToLab(
  1820. const CMColor * src,
  1821. const CMXYZColor * white,
  1822. CMColor * dst,
  1823. UInt32 count) FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  1824. /*
  1825. * CMConvertLabToXYZ()
  1826. *
  1827. * Availability:
  1828. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1829. * CarbonLib: in CarbonLib 1.0 and later
  1830. * Mac OS X: in version 10.0 and later
  1831. */
  1832. EXTERN_API( CMError )
  1833. CMConvertLabToXYZ(
  1834. const CMColor * src,
  1835. const CMXYZColor * white,
  1836. CMColor * dst,
  1837. UInt32 count) FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  1838. /*
  1839. * CMConvertXYZToLuv()
  1840. *
  1841. * Availability:
  1842. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1843. * CarbonLib: in CarbonLib 1.0 and later
  1844. * Mac OS X: in version 10.0 and later
  1845. */
  1846. EXTERN_API( CMError )
  1847. CMConvertXYZToLuv(
  1848. const CMColor * src,
  1849. const CMXYZColor * white,
  1850. CMColor * dst,
  1851. UInt32 count) FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  1852. /*
  1853. * CMConvertLuvToXYZ()
  1854. *
  1855. * Availability:
  1856. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1857. * CarbonLib: in CarbonLib 1.0 and later
  1858. * Mac OS X: in version 10.0 and later
  1859. */
  1860. EXTERN_API( CMError )
  1861. CMConvertLuvToXYZ(
  1862. const CMColor * src,
  1863. const CMXYZColor * white,
  1864. CMColor * dst,
  1865. UInt32 count) FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  1866. /*
  1867. * CMConvertXYZToYxy()
  1868. *
  1869. * Availability:
  1870. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1871. * CarbonLib: in CarbonLib 1.0 and later
  1872. * Mac OS X: in version 10.0 and later
  1873. */
  1874. EXTERN_API( CMError )
  1875. CMConvertXYZToYxy(
  1876. const CMColor * src,
  1877. CMColor * dst,
  1878. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  1879. /*
  1880. * CMConvertYxyToXYZ()
  1881. *
  1882. * Availability:
  1883. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1884. * CarbonLib: in CarbonLib 1.0 and later
  1885. * Mac OS X: in version 10.0 and later
  1886. */
  1887. EXTERN_API( CMError )
  1888. CMConvertYxyToXYZ(
  1889. const CMColor * src,
  1890. CMColor * dst,
  1891. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  1892. /*
  1893. * CMConvertRGBToHLS()
  1894. *
  1895. * Availability:
  1896. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1897. * CarbonLib: in CarbonLib 1.0 and later
  1898. * Mac OS X: in version 10.0 and later
  1899. */
  1900. EXTERN_API( CMError )
  1901. CMConvertRGBToHLS(
  1902. const CMColor * src,
  1903. CMColor * dst,
  1904. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  1905. /*
  1906. * CMConvertHLSToRGB()
  1907. *
  1908. * Availability:
  1909. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1910. * CarbonLib: in CarbonLib 1.0 and later
  1911. * Mac OS X: in version 10.0 and later
  1912. */
  1913. EXTERN_API( CMError )
  1914. CMConvertHLSToRGB(
  1915. const CMColor * src,
  1916. CMColor * dst,
  1917. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  1918. /*
  1919. * CMConvertRGBToHSV()
  1920. *
  1921. * Availability:
  1922. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1923. * CarbonLib: in CarbonLib 1.0 and later
  1924. * Mac OS X: in version 10.0 and later
  1925. */
  1926. EXTERN_API( CMError )
  1927. CMConvertRGBToHSV(
  1928. const CMColor * src,
  1929. CMColor * dst,
  1930. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  1931. /*
  1932. * CMConvertHSVToRGB()
  1933. *
  1934. * Availability:
  1935. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1936. * CarbonLib: in CarbonLib 1.0 and later
  1937. * Mac OS X: in version 10.0 and later
  1938. */
  1939. EXTERN_API( CMError )
  1940. CMConvertHSVToRGB(
  1941. const CMColor * src,
  1942. CMColor * dst,
  1943. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  1944. /*
  1945. * CMConvertRGBToGray()
  1946. *
  1947. * Availability:
  1948. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1949. * CarbonLib: in CarbonLib 1.0 and later
  1950. * Mac OS X: in version 10.0 and later
  1951. */
  1952. EXTERN_API( CMError )
  1953. CMConvertRGBToGray(
  1954. const CMColor * src,
  1955. CMColor * dst,
  1956. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  1957. /*
  1958. * CMConvertXYZToFixedXYZ()
  1959. *
  1960. * Availability:
  1961. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1962. * CarbonLib: in CarbonLib 1.0 and later
  1963. * Mac OS X: in version 10.0 and later
  1964. */
  1965. EXTERN_API( CMError )
  1966. CMConvertXYZToFixedXYZ(
  1967. const CMXYZColor * src,
  1968. CMFixedXYZColor * dst,
  1969. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  1970. /*
  1971. * CMConvertFixedXYZToXYZ()
  1972. *
  1973. * Availability:
  1974. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1975. * CarbonLib: in CarbonLib 1.0 and later
  1976. * Mac OS X: in version 10.0 and later
  1977. */
  1978. EXTERN_API( CMError )
  1979. CMConvertFixedXYZToXYZ(
  1980. const CMFixedXYZColor * src,
  1981. CMXYZColor * dst,
  1982. UInt32 count) FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  1983. /*
  1984. * CMConvertXYZToXYZ()
  1985. *
  1986. * Availability:
  1987. * Non-Carbon CFM: not available
  1988. * CarbonLib: not available
  1989. * Mac OS X: in version 10.1 and later
  1990. */
  1991. EXTERN_API( CMError )
  1992. CMConvertXYZToXYZ(
  1993. const CMColor * src,
  1994. const CMXYZColor * srcIlluminant,
  1995. CMColor * dst,
  1996. const CMXYZColor * dstIlluminant,
  1997. CMChromaticAdaptation method,
  1998. UInt32 count);
  1999. /* PS-related */
  2000. /*
  2001. * CMGetPS2ColorSpace()
  2002. *
  2003. * Availability:
  2004. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  2005. * CarbonLib: in CarbonLib 1.0 and later
  2006. * Mac OS X: in version 10.0 and later
  2007. */
  2008. EXTERN_API( CMError )
  2009. CMGetPS2ColorSpace(
  2010. CMProfileRef srcProf,
  2011. UInt32 flags,
  2012. CMFlattenUPP proc,
  2013. void * refCon,
  2014. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  2015. /*
  2016. * CMGetPS2ColorRenderingIntent()
  2017. *
  2018. * Availability:
  2019. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  2020. * CarbonLib: in CarbonLib 1.0 and later
  2021. * Mac OS X: in version 10.0 and later
  2022. */
  2023. EXTERN_API( CMError )
  2024. CMGetPS2ColorRenderingIntent(
  2025. CMProfileRef srcProf,
  2026. UInt32 flags,
  2027. CMFlattenUPP proc,
  2028. void * refCon,
  2029. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  2030. /*
  2031. * CMGetPS2ColorRendering()
  2032. *
  2033. * Availability:
  2034. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  2035. * CarbonLib: in CarbonLib 1.0 and later
  2036. * Mac OS X: in version 10.0 and later
  2037. */
  2038. EXTERN_API( CMError )
  2039. CMGetPS2ColorRendering(
  2040. CMProfileRef srcProf,
  2041. CMProfileRef dstProf,
  2042. UInt32 flags,
  2043. CMFlattenUPP proc,
  2044. void * refCon,
  2045. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  2046. /*
  2047. * CMGetPS2ColorRenderingVMSize()
  2048. *
  2049. * Availability:
  2050. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  2051. * CarbonLib: in CarbonLib 1.0 and later
  2052. * Mac OS X: in version 10.0 and later
  2053. */
  2054. EXTERN_API( CMError )
  2055. CMGetPS2ColorRenderingVMSize(
  2056. CMProfileRef srcProf,
  2057. CMProfileRef dstProf,
  2058. UInt32 * vmSize,
  2059. Boolean * preferredCMMnotfound) FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  2060. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  2061. #if TARGET_API_MAC_OS8
  2062. #if CALL_NOT_IN_CARBON
  2063. /*
  2064. * CWNewColorWorld()
  2065. *
  2066. * Availability:
  2067. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2068. * CarbonLib: not available
  2069. * Mac OS X: not available
  2070. */
  2071. EXTERN_API( CMError )
  2072. CWNewColorWorld(
  2073. CMWorldRef * cw,
  2074. CMProfileHandle src,
  2075. CMProfileHandle dst) FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  2076. /*
  2077. * ConcatenateProfiles()
  2078. *
  2079. * Availability:
  2080. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2081. * CarbonLib: not available
  2082. * Mac OS X: not available
  2083. */
  2084. EXTERN_API( CMError )
  2085. ConcatenateProfiles(
  2086. CMProfileHandle thru,
  2087. CMProfileHandle dst,
  2088. CMProfileHandle * newDst) FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  2089. /*
  2090. * CMBeginMatching()
  2091. *
  2092. * Availability:
  2093. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  2094. * CarbonLib: not available
  2095. * Mac OS X: not available
  2096. */
  2097. EXTERN_API( CMError )
  2098. CMBeginMatching(
  2099. CMProfileHandle src,
  2100. CMProfileHandle dst,
  2101. CMMatchRef * myRef) FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  2102. /*
  2103. * CMDrawMatchedPicture()
  2104. *
  2105. * Availability:
  2106. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2107. * CarbonLib: not available
  2108. * Mac OS X: not available
  2109. */
  2110. EXTERN_API( void )
  2111. CMDrawMatchedPicture(
  2112. PicHandle myPicture,
  2113. CMProfileHandle dst,
  2114. Rect * myRect) FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  2115. /*
  2116. * CMUseProfileComment()
  2117. *
  2118. * Availability:
  2119. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2120. * CarbonLib: not available
  2121. * Mac OS X: not available
  2122. */
  2123. EXTERN_API( CMError )
  2124. CMUseProfileComment(CMProfileHandle profile) FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  2125. /*
  2126. * CMGetProfileName()
  2127. *
  2128. * Availability:
  2129. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2130. * CarbonLib: not available
  2131. * Mac OS X: not available
  2132. */
  2133. EXTERN_API( void )
  2134. CMGetProfileName(
  2135. CMProfileHandle myProfile,
  2136. CMIString * IStringResult) FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  2137. /*
  2138. * CMGetProfileAdditionalDataOffset()
  2139. *
  2140. * Availability:
  2141. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2142. * CarbonLib: not available
  2143. * Mac OS X: not available
  2144. */
  2145. EXTERN_API( long )
  2146. CMGetProfileAdditionalDataOffset(CMProfileHandle myProfile) FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  2147. /* ProfileResponder definitions */
  2148. #endif /* CALL_NOT_IN_CARBON */
  2149. enum {
  2150. cmSystemDevice = FOUR_CHAR_CODE('sys '),
  2151. cmGDevice = FOUR_CHAR_CODE('gdev')
  2152. };
  2153. /* ProfileResponder functions */
  2154. #if CALL_NOT_IN_CARBON
  2155. /*
  2156. * GetProfile()
  2157. *
  2158. * Availability:
  2159. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2160. * CarbonLib: not available
  2161. * Mac OS X: not available
  2162. */
  2163. EXTERN_API( CMError )
  2164. GetProfile(
  2165. OSType deviceType,
  2166. long refNum,
  2167. CMProfileHandle aProfile,
  2168. CMProfileHandle * returnedProfile) FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  2169. /*
  2170. * SetProfile()
  2171. *
  2172. * Availability:
  2173. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2174. * CarbonLib: not available
  2175. * Mac OS X: not available
  2176. */
  2177. EXTERN_API( CMError )
  2178. SetProfile(
  2179. OSType deviceType,
  2180. long refNum,
  2181. CMProfileHandle newProfile) FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  2182. /*
  2183. * SetProfileDescription()
  2184. *
  2185. * Availability:
  2186. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2187. * CarbonLib: not available
  2188. * Mac OS X: not available
  2189. */
  2190. EXTERN_API( CMError )
  2191. SetProfileDescription(
  2192. OSType deviceType,
  2193. long refNum,
  2194. long deviceData,
  2195. CMProfileHandle hProfile) FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  2196. /*
  2197. * GetIndexedProfile()
  2198. *
  2199. * Availability:
  2200. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2201. * CarbonLib: not available
  2202. * Mac OS X: not available
  2203. */
  2204. EXTERN_API( CMError )
  2205. GetIndexedProfile(
  2206. OSType deviceType,
  2207. long refNum,
  2208. CMProfileSearchRecordHandle search,
  2209. CMProfileHandle * returnProfile,
  2210. long * index) FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  2211. /*
  2212. * DeleteDeviceProfile()
  2213. *
  2214. * Availability:
  2215. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2216. * CarbonLib: not available
  2217. * Mac OS X: not available
  2218. */
  2219. EXTERN_API( CMError )
  2220. DeleteDeviceProfile(
  2221. OSType deviceType,
  2222. long refNum,
  2223. CMProfileHandle deleteMe) FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  2224. #endif /* CALL_NOT_IN_CARBON */
  2225. #if OLDROUTINENAMES
  2226. /* old constants */
  2227. typedef CMFlattenProcPtr CMFlattenProc;
  2228. typedef CMBitmapCallBackProcPtr CMBitmapCallBackProc;
  2229. typedef CMProfileFilterProcPtr CMProfileFilterProc;
  2230. enum {
  2231. CMTrap = cmTrap,
  2232. CMBeginProfile = cmBeginProfile,
  2233. CMEndProfile = cmEndProfile,
  2234. CMEnableMatching = cmEnableMatching,
  2235. CMDisableMatching = cmDisableMatching
  2236. };
  2237. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  2238. enum {
  2239. CMNoError = 0, /* obsolete name, use noErr */
  2240. CMProfileError = cmProfileError,
  2241. CMMethodError = cmMethodError,
  2242. CMMemFullError = -172, /* obsolete, 2.0 uses memFullErr */
  2243. CMUnimplementedError = -173, /* obsolete, 2.0 uses unimpErr */
  2244. CMParamError = -174, /* obsolete, 2.0 uses paramErr */
  2245. CMMethodNotFound = cmMethodNotFound,
  2246. CMProfileNotFound = cmProfileNotFound,
  2247. CMProfilesIdentical = cmProfilesIdentical,
  2248. CMCantConcatenateError = cmCantConcatenateError,
  2249. CMCantXYZ = cmCantXYZ,
  2250. CMCantDeleteProfile = cmCantDeleteProfile,
  2251. CMUnsupportedDataType = cmUnsupportedDataType,
  2252. CMNoCurrentProfile = cmNoCurrentProfile
  2253. };
  2254. enum {
  2255. qdSystemDevice = cmSystemDevice,
  2256. qdGDevice = cmGDevice
  2257. };
  2258. enum {
  2259. kMatchCMMType = cmMatchCMMType,
  2260. kMatchApplProfileVersion = cmMatchApplProfileVersion,
  2261. kMatchDataType = cmMatchDataType,
  2262. kMatchDeviceType = cmMatchDeviceType,
  2263. kMatchDeviceManufacturer = cmMatchDeviceManufacturer,
  2264. kMatchDeviceModel = cmMatchDeviceModel,
  2265. kMatchDeviceAttributes = cmMatchDeviceAttributes,
  2266. kMatchFlags = cmMatchFlags,
  2267. kMatchOptions = cmMatchOptions,
  2268. kMatchWhite = cmMatchWhite,
  2269. kMatchBlack = cmMatchBlack
  2270. };
  2271. /* old types */
  2272. typedef CMCMYKColor CMYKColor;
  2273. typedef CMWorldRef CWorld;
  2274. typedef long * CMGamutResult;
  2275. /* old functions */
  2276. #define EndMatching(myRef) CMEndMatching(myRef)
  2277. #define EnableMatching(enableIt) CMEnableMatchingComment(enableIt)
  2278. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID) CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  2279. #define BeginMatching(src, dst, myRef) CMBeginMatching(src, dst, myRef)
  2280. #define DrawMatchedPicture(myPicture, dst, myRect) CMDrawMatchedPicture(myPicture, dst, myRect)
  2281. #define UseProfile(profile) CMUseProfileComment(profile)
  2282. #define GetProfileName(myProfile, IStringResult) CMGetProfileName(myProfile, IStringResult)
  2283. #define GetProfileAdditionalDataOffset(myProfile) CMGetProfileAdditionalDataOffset(myProfile)
  2284. #endif /* OLDROUTINENAMES */
  2285. /* Deprecated stuff*/
  2286. /* PrGeneral parameter blocks */
  2287. enum {
  2288. enableColorMatchingOp = 12,
  2289. registerProfileOp = 13
  2290. };
  2291. struct TEnableColorMatchingBlk {
  2292. short iOpCode;
  2293. short iError;
  2294. long lReserved;
  2295. void * hPrint; /* THPrint*/
  2296. Boolean fEnableIt;
  2297. SInt8 filler;
  2298. };
  2299. typedef struct TEnableColorMatchingBlk TEnableColorMatchingBlk;
  2300. struct TRegisterProfileBlk {
  2301. short iOpCode;
  2302. short iError;
  2303. long lReserved;
  2304. void * hPrint; /* THPrint*/
  2305. Boolean fRegisterIt;
  2306. SInt8 filler;
  2307. };
  2308. typedef struct TRegisterProfileBlk TRegisterProfileBlk;
  2309. #endif /* TARGET_API_MAC_OS8 */
  2310. #if PRAGMA_STRUCT_ALIGN
  2311. #pragma options align=reset
  2312. #elif PRAGMA_STRUCT_PACKPUSH
  2313. #pragma pack(pop)
  2314. #elif PRAGMA_STRUCT_PACK
  2315. #pragma pack()
  2316. #endif
  2317. #ifdef PRAGMA_IMPORT_OFF
  2318. #pragma import off
  2319. #elif PRAGMA_IMPORT
  2320. #pragma import reset
  2321. #endif
  2322. #ifdef __cplusplus
  2323. }
  2324. #endif
  2325. #endif /* __CMAPPLICATION__ */