1 #ifndef QCMS_H 2 #define QCMS_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 /* if we've already got an ICC_H header we can ignore the following */ 9 #ifndef ICC_H 10 /* icc34 defines */ 11 12 /***************************************************************** 13 Copyright (c) 1994-1996 SunSoft, Inc. 14 15 Rights Reserved 16 17 Permission is hereby granted, free of charge, to any person 18 obtaining a copy of this software and associated documentation 19 files (the "Software"), to deal in the Software without restrict- 20 ion, including without limitation the rights to use, copy, modify, 21 merge, publish distribute, sublicense, and/or sell copies of the 22 Software, and to permit persons to whom the Software is furnished 23 to do so, subject to the following conditions: 24 25 The above copyright notice and this permission notice shall be 26 included in all copies or substantial portions of the Software. 27 28 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 29 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 30 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- 31 INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT 32 COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 33 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 34 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 35 OTHER DEALINGS IN THE SOFTWARE. 36 37 Except as contained in this notice, the name of SunSoft, Inc. 38 shall not be used in advertising or otherwise to promote the 39 sale, use or other dealings in this Software without written 40 authorization from SunSoft Inc. 41 ******************************************************************/ 42 43 /* 44 * Color Space Signatures 45 * Note that only icSigXYZData and icSigLabData are valid 46 * Profile Connection Spaces (PCSs) 47 */ 48 typedef enum { 49 icSigXYZData = 0x58595A20L, /* 'XYZ ' */ 50 icSigLabData = 0x4C616220L, /* 'Lab ' */ 51 icSigLuvData = 0x4C757620L, /* 'Luv ' */ 52 icSigYCbCrData = 0x59436272L, /* 'YCbr' */ 53 icSigYxyData = 0x59787920L, /* 'Yxy ' */ 54 icSigRgbData = 0x52474220L, /* 'RGB ' */ 55 icSigGrayData = 0x47524159L, /* 'GRAY' */ 56 icSigHsvData = 0x48535620L, /* 'HSV ' */ 57 icSigHlsData = 0x484C5320L, /* 'HLS ' */ 58 icSigCmykData = 0x434D594BL, /* 'CMYK' */ 59 icSigCmyData = 0x434D5920L, /* 'CMY ' */ 60 icSig2colorData = 0x32434C52L, /* '2CLR' */ 61 icSig3colorData = 0x33434C52L, /* '3CLR' */ 62 icSig4colorData = 0x34434C52L, /* '4CLR' */ 63 icSig5colorData = 0x35434C52L, /* '5CLR' */ 64 icSig6colorData = 0x36434C52L, /* '6CLR' */ 65 icSig7colorData = 0x37434C52L, /* '7CLR' */ 66 icSig8colorData = 0x38434C52L, /* '8CLR' */ 67 icSig9colorData = 0x39434C52L, /* '9CLR' */ 68 icSig10colorData = 0x41434C52L, /* 'ACLR' */ 69 icSig11colorData = 0x42434C52L, /* 'BCLR' */ 70 icSig12colorData = 0x43434C52L, /* 'CCLR' */ 71 icSig13colorData = 0x44434C52L, /* 'DCLR' */ 72 icSig14colorData = 0x45434C52L, /* 'ECLR' */ 73 icSig15colorData = 0x46434C52L, /* 'FCLR' */ 74 icMaxEnumData = 0xFFFFFFFFL 75 } icColorSpaceSignature; 76 #endif 77 78 #include <stdio.h> 79 80 typedef int qcms_bool; 81 82 struct _qcms_transform; 83 typedef struct _qcms_transform qcms_transform; 84 85 struct _qcms_profile; 86 typedef struct _qcms_profile qcms_profile; 87 88 /* these values match the Rendering Intent values from the ICC spec */ 89 typedef enum { 90 QCMS_INTENT_DEFAULT = 0, 91 QCMS_INTENT_PERCEPTUAL = 0, 92 QCMS_INTENT_RELATIVE_COLORIMETRIC = 1, 93 QCMS_INTENT_SATURATION = 2, 94 QCMS_INTENT_ABSOLUTE_COLORIMETRIC = 3 95 } qcms_intent; 96 97 //XXX: I don't really like the _DATA_ prefix 98 typedef enum { 99 QCMS_DATA_RGB_8, 100 QCMS_DATA_RGBA_8, 101 QCMS_DATA_GRAY_8, 102 QCMS_DATA_GRAYA_8 103 } qcms_data_type; 104 105 /* Format of the output data for qcms_transform_data_type() */ 106 typedef enum { 107 QCMS_OUTPUT_RGBX, 108 QCMS_OUTPUT_BGRX 109 } qcms_output_type; 110 111 /* the names for the following two types are sort of ugly */ 112 typedef struct 113 { 114 double x; 115 double y; 116 double Y; 117 } qcms_CIE_xyY; 118 119 typedef struct 120 { 121 qcms_CIE_xyY red; 122 qcms_CIE_xyY green; 123 qcms_CIE_xyY blue; 124 } qcms_CIE_xyYTRIPLE; 125 126 qcms_profile* qcms_profile_create_rgb_with_gamma( 127 qcms_CIE_xyY white_point, 128 qcms_CIE_xyYTRIPLE primaries, 129 float gamma); 130 131 qcms_profile* qcms_profile_from_memory(const void *mem, size_t size); 132 133 qcms_profile* qcms_profile_from_file(FILE *file); 134 qcms_profile* qcms_profile_from_path(const char *path); 135 #ifdef _WIN32 136 qcms_profile* qcms_profile_from_unicode_path(const wchar_t *path); 137 #endif 138 qcms_profile* qcms_profile_sRGB(void); 139 void qcms_profile_release(qcms_profile *profile); 140 141 qcms_bool qcms_profile_is_bogus(qcms_profile *profile); 142 qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile); 143 icColorSpaceSignature qcms_profile_get_color_space(qcms_profile *profile); 144 145 void qcms_profile_precache_output_transform(qcms_profile *profile); 146 147 qcms_transform* qcms_transform_create( 148 qcms_profile *in, qcms_data_type in_type, 149 qcms_profile* out, qcms_data_type out_type, 150 qcms_intent intent); 151 152 void qcms_transform_release(qcms_transform *); 153 154 void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_t length); 155 void qcms_transform_data_type(qcms_transform *transform, void *src, void *dest, size_t length, qcms_output_type type); 156 157 void qcms_enable_iccv4(); 158 159 #ifdef __cplusplus 160 } 161 #endif 162 163 #endif 164