michael@0: #ifndef QCMS_H michael@0: #define QCMS_H michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: /* if we've already got an ICC_H header we can ignore the following */ michael@0: #ifndef ICC_H michael@0: /* icc34 defines */ michael@0: michael@0: /***************************************************************** michael@0: Copyright (c) 1994-1996 SunSoft, Inc. michael@0: michael@0: Rights Reserved michael@0: michael@0: Permission is hereby granted, free of charge, to any person michael@0: obtaining a copy of this software and associated documentation michael@0: files (the "Software"), to deal in the Software without restrict- michael@0: ion, including without limitation the rights to use, copy, modify, michael@0: merge, publish distribute, sublicense, and/or sell copies of the michael@0: Software, and to permit persons to whom the Software is furnished michael@0: to do so, subject to the following conditions: michael@0: michael@0: The above copyright notice and this permission notice shall be michael@0: included in all copies or substantial portions of the Software. michael@0: michael@0: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, michael@0: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES michael@0: OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- michael@0: INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT michael@0: COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, michael@0: WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING michael@0: FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR michael@0: OTHER DEALINGS IN THE SOFTWARE. michael@0: michael@0: Except as contained in this notice, the name of SunSoft, Inc. michael@0: shall not be used in advertising or otherwise to promote the michael@0: sale, use or other dealings in this Software without written michael@0: authorization from SunSoft Inc. michael@0: ******************************************************************/ michael@0: michael@0: /* michael@0: * QCMS, in general, is not threadsafe. However, it should be safe to create michael@0: * profile and transformation objects on different threads, so long as you michael@0: * don't use the same objects on different threads at the same time. michael@0: */ michael@0: michael@0: /* michael@0: * Color Space Signatures michael@0: * Note that only icSigXYZData and icSigLabData are valid michael@0: * Profile Connection Spaces (PCSs) michael@0: */ michael@0: typedef enum { michael@0: icSigXYZData = 0x58595A20L, /* 'XYZ ' */ michael@0: icSigLabData = 0x4C616220L, /* 'Lab ' */ michael@0: icSigLuvData = 0x4C757620L, /* 'Luv ' */ michael@0: icSigYCbCrData = 0x59436272L, /* 'YCbr' */ michael@0: icSigYxyData = 0x59787920L, /* 'Yxy ' */ michael@0: icSigRgbData = 0x52474220L, /* 'RGB ' */ michael@0: icSigGrayData = 0x47524159L, /* 'GRAY' */ michael@0: icSigHsvData = 0x48535620L, /* 'HSV ' */ michael@0: icSigHlsData = 0x484C5320L, /* 'HLS ' */ michael@0: icSigCmykData = 0x434D594BL, /* 'CMYK' */ michael@0: icSigCmyData = 0x434D5920L, /* 'CMY ' */ michael@0: icSig2colorData = 0x32434C52L, /* '2CLR' */ michael@0: icSig3colorData = 0x33434C52L, /* '3CLR' */ michael@0: icSig4colorData = 0x34434C52L, /* '4CLR' */ michael@0: icSig5colorData = 0x35434C52L, /* '5CLR' */ michael@0: icSig6colorData = 0x36434C52L, /* '6CLR' */ michael@0: icSig7colorData = 0x37434C52L, /* '7CLR' */ michael@0: icSig8colorData = 0x38434C52L, /* '8CLR' */ michael@0: icSig9colorData = 0x39434C52L, /* '9CLR' */ michael@0: icSig10colorData = 0x41434C52L, /* 'ACLR' */ michael@0: icSig11colorData = 0x42434C52L, /* 'BCLR' */ michael@0: icSig12colorData = 0x43434C52L, /* 'CCLR' */ michael@0: icSig13colorData = 0x44434C52L, /* 'DCLR' */ michael@0: icSig14colorData = 0x45434C52L, /* 'ECLR' */ michael@0: icSig15colorData = 0x46434C52L, /* 'FCLR' */ michael@0: icMaxEnumData = 0xFFFFFFFFL michael@0: } icColorSpaceSignature; michael@0: #endif michael@0: michael@0: #include michael@0: michael@0: typedef int qcms_bool; michael@0: michael@0: struct _qcms_transform; michael@0: typedef struct _qcms_transform qcms_transform; michael@0: michael@0: struct _qcms_profile; michael@0: typedef struct _qcms_profile qcms_profile; michael@0: michael@0: /* these values match the Rendering Intent values from the ICC spec */ michael@0: typedef enum { michael@0: QCMS_INTENT_MIN = 0, michael@0: QCMS_INTENT_PERCEPTUAL = 0, michael@0: QCMS_INTENT_RELATIVE_COLORIMETRIC = 1, michael@0: QCMS_INTENT_SATURATION = 2, michael@0: QCMS_INTENT_ABSOLUTE_COLORIMETRIC = 3, michael@0: QCMS_INTENT_MAX = 3, michael@0: michael@0: /* Chris Murphy (CM consultant) suggests this as a default in the event that we michael@0: * cannot reproduce relative + Black Point Compensation. BPC brings an michael@0: * unacceptable performance overhead, so we go with perceptual. */ michael@0: QCMS_INTENT_DEFAULT = QCMS_INTENT_PERCEPTUAL, michael@0: } qcms_intent; michael@0: michael@0: //XXX: I don't really like the _DATA_ prefix michael@0: typedef enum { michael@0: QCMS_DATA_RGB_8, michael@0: QCMS_DATA_RGBA_8, michael@0: QCMS_DATA_GRAY_8, michael@0: QCMS_DATA_GRAYA_8 michael@0: } qcms_data_type; michael@0: michael@0: /* the names for the following two types are sort of ugly */ michael@0: typedef struct michael@0: { michael@0: double x; michael@0: double y; michael@0: double Y; michael@0: } qcms_CIE_xyY; michael@0: michael@0: typedef struct michael@0: { michael@0: qcms_CIE_xyY red; michael@0: qcms_CIE_xyY green; michael@0: qcms_CIE_xyY blue; michael@0: } qcms_CIE_xyYTRIPLE; michael@0: michael@0: qcms_profile* qcms_profile_create_rgb_with_gamma( michael@0: qcms_CIE_xyY white_point, michael@0: qcms_CIE_xyYTRIPLE primaries, michael@0: float gamma); michael@0: michael@0: void qcms_data_create_rgb_with_gamma( michael@0: qcms_CIE_xyY white_point, michael@0: qcms_CIE_xyYTRIPLE primaries, michael@0: float gamma, michael@0: void **mem, michael@0: size_t *size); michael@0: michael@0: qcms_profile* qcms_profile_from_memory(const void *mem, size_t size); michael@0: michael@0: qcms_profile* qcms_profile_from_file(FILE *file); michael@0: qcms_profile* qcms_profile_from_path(const char *path); michael@0: michael@0: void qcms_data_from_path(const char *path, void **mem, size_t *size); michael@0: michael@0: #ifdef _WIN32 michael@0: qcms_profile* qcms_profile_from_unicode_path(const wchar_t *path); michael@0: void qcms_data_from_unicode_path(const wchar_t *path, void **mem, size_t *size); michael@0: #endif michael@0: qcms_profile* qcms_profile_sRGB(void); michael@0: void qcms_profile_release(qcms_profile *profile); michael@0: michael@0: qcms_bool qcms_profile_is_bogus(qcms_profile *profile); michael@0: qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile); michael@0: icColorSpaceSignature qcms_profile_get_color_space(qcms_profile *profile); michael@0: michael@0: void qcms_profile_precache_output_transform(qcms_profile *profile); michael@0: michael@0: qcms_transform* qcms_transform_create( michael@0: qcms_profile *in, qcms_data_type in_type, michael@0: qcms_profile* out, qcms_data_type out_type, michael@0: qcms_intent intent); michael@0: michael@0: void qcms_transform_release(qcms_transform *); michael@0: michael@0: void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_t length); michael@0: michael@0: void qcms_enable_iccv4(); michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif