| OLD | NEW |
| 1 diff --git a/third_party/qcms/src/iccread.c b/third_party/qcms/src/iccread.c | 1 diff --git a/third_party/qcms/src/iccread.c b/third_party/qcms/src/iccread.c |
| 2 index 36b7011..69b7141 100644 | 2 index 36b7011..aca19d3 100644 |
| 3 --- a/third_party/qcms/src/iccread.c | 3 --- a/third_party/qcms/src/iccread.c |
| 4 +++ b/third_party/qcms/src/iccread.c | 4 +++ b/third_party/qcms/src/iccread.c |
| 5 @@ -266,7 +266,7 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile) | 5 @@ -266,7 +266,7 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile) |
| 6 if (profile->color_space != RGB_SIGNATURE) | 6 if (profile->color_space != RGB_SIGNATURE) |
| 7 return false; | 7 return false; |
| 8 | 8 |
| 9 - if (profile->A2B0 || profile->B2A0) | 9 - if (profile->A2B0 || profile->B2A0) |
| 10 + if (qcms_supports_iccv4 && (profile->A2B0 || profile->B2A0)) | 10 + if (qcms_supports_iccv4 && (profile->A2B0 || profile->B2A0)) |
| 11 return false; | 11 return false; |
| 12 | 12 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 @@ -1028,6 +1089,9 @@ qcms_profile* qcms_profile_from_memory(const void *mem, si
ze_t size) | 157 @@ -1028,6 +1089,9 @@ qcms_profile* qcms_profile_from_memory(const void *mem, si
ze_t size) |
| 158 if (!src->valid || !index.tags) | 158 if (!src->valid || !index.tags) |
| 159 goto invalid_tag_table; | 159 goto invalid_tag_table; |
| 160 | 160 |
| 161 + if (!read_tag_descType(profile, src, index, TAG_desc)) | 161 + if (!read_tag_descType(profile, src, index, TAG_desc)) |
| 162 + goto invalid_tag_table; | 162 + goto invalid_tag_table; |
| 163 + | 163 + |
| 164 if (find_tag(index, TAG_CHAD)) { | 164 if (find_tag(index, TAG_CHAD)) { |
| 165 profile->chromaticAdaption = read_tag_s15Fixed16ArrayType(src, i
ndex, TAG_CHAD); | 165 profile->chromaticAdaption = read_tag_s15Fixed16ArrayType(src, i
ndex, TAG_CHAD); |
| 166 } else { | 166 } else { |
| 167 @@ -1098,6 +1162,11 @@ invalid_profile: | 167 @@ -1098,6 +1162,16 @@ invalid_profile: |
| 168 return INVALID_PROFILE; | 168 return INVALID_PROFILE; |
| 169 } | 169 } |
| 170 | 170 |
| 171 +qcms_bool qcms_profile_match(qcms_profile *p1, qcms_profile *p2) | 171 +qcms_bool qcms_profile_match(qcms_profile *p1, qcms_profile *p2) |
| 172 +{ | 172 +{ |
| 173 + return memcmp(p1->description, p2->description, sizeof p1->description) ==
0; | 173 + return memcmp(p1->description, p2->description, sizeof p1->description) ==
0; |
| 174 +} | 174 +} |
| 175 + | 175 + |
| 176 +const char* qcms_profile_get_description(qcms_profile *profile) |
| 177 +{ |
| 178 + return profile->description; |
| 179 +} |
| 180 + |
| 176 qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile) | 181 qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile) |
| 177 { | 182 { |
| 178 return profile->rendering_intent; | 183 return profile->rendering_intent; |
| 179 diff --git a/third_party/qcms/src/qcms.h b/third_party/qcms/src/qcms.h | 184 diff --git a/third_party/qcms/src/qcms.h b/third_party/qcms/src/qcms.h |
| 180 index 7d83623..e59528a 100644 | 185 index 7d83623..c69a772 100644 |
| 181 --- a/third_party/qcms/src/qcms.h | 186 --- a/third_party/qcms/src/qcms.h |
| 182 +++ b/third_party/qcms/src/qcms.h | 187 +++ b/third_party/qcms/src/qcms.h |
| 183 @@ -40,6 +40,12 @@ sale, use or other dealings in this Software without written | 188 @@ -40,6 +40,12 @@ sale, use or other dealings in this Software without written |
| 184 authorization from SunSoft Inc. | 189 authorization from SunSoft Inc. |
| 185 ******************************************************************/ | 190 ******************************************************************/ |
| 186 | 191 |
| 187 +/* | 192 +/* |
| 188 + * QCMS, in general, is not threadsafe. However, it should be safe to create | 193 + * QCMS, in general, is not threadsafe. However, it should be safe to create |
| 189 + * profile and transformation objects on different threads, so long as you | 194 + * profile and transformation objects on different threads, so long as you |
| 190 + * don't use the same objects on different threads at the same time. | 195 + * don't use the same objects on different threads at the same time. |
| 191 + */ | 196 + */ |
| 192 + | 197 + |
| 193 /* | 198 /* |
| 194 * Color Space Signatures | 199 * Color Space Signatures |
| 195 * Note that only icSigXYZData and icSigLabData are valid | 200 * Note that only icSigXYZData and icSigLabData are valid |
| 196 @@ -102,6 +108,12 @@ typedef enum { | 201 @@ -102,6 +108,12 @@ typedef enum { |
| 197 QCMS_DATA_GRAYA_8 | 202 QCMS_DATA_GRAYA_8 |
| 198 } qcms_data_type; | 203 } qcms_data_type; |
| 199 | 204 |
| 200 +/* Format of the output data for qcms_transform_data_type() */ | 205 +/* Format of the output data for qcms_transform_data_type() */ |
| 201 +typedef enum { | 206 +typedef enum { |
| 202 + QCMS_OUTPUT_RGBX, | 207 + QCMS_OUTPUT_RGBX, |
| 203 + QCMS_OUTPUT_BGRX | 208 + QCMS_OUTPUT_BGRX |
| 204 +} qcms_output_type; | 209 +} qcms_output_type; |
| 205 + | 210 + |
| 206 /* the names for the following two types are sort of ugly */ | 211 /* the names for the following two types are sort of ugly */ |
| 207 typedef struct | 212 typedef struct |
| 208 { | 213 { |
| 209 @@ -136,6 +148,8 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile); | 214 @@ -136,6 +148,9 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile); |
| 210 qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile); | 215 qcms_intent qcms_profile_get_rendering_intent(qcms_profile *profile); |
| 211 icColorSpaceSignature qcms_profile_get_color_space(qcms_profile *profile); | 216 icColorSpaceSignature qcms_profile_get_color_space(qcms_profile *profile); |
| 212 | 217 |
| 213 +qcms_bool qcms_profile_match(qcms_profile *p1, qcms_profile *p2); | 218 +qcms_bool qcms_profile_match(qcms_profile *p1, qcms_profile *p2); |
| 219 +const char* qcms_profile_get_description(qcms_profile *profile); |
| 214 + | 220 + |
| 215 void qcms_profile_precache_output_transform(qcms_profile *profile); | 221 void qcms_profile_precache_output_transform(qcms_profile *profile); |
| 216 | 222 |
| 217 qcms_transform* qcms_transform_create( | 223 qcms_transform* qcms_transform_create( |
| 218 @@ -146,6 +160,7 @@ qcms_transform* qcms_transform_create( | 224 @@ -146,6 +161,7 @@ qcms_transform* qcms_transform_create( |
| 219 void qcms_transform_release(qcms_transform *); | 225 void qcms_transform_release(qcms_transform *); |
| 220 | 226 |
| 221 void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size
_t length); | 227 void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size
_t length); |
| 222 +void qcms_transform_data_type(qcms_transform *transform, void *src, void *dest,
size_t length, qcms_output_type type); | 228 +void qcms_transform_data_type(qcms_transform *transform, void *src, void *dest,
size_t length, qcms_output_type type); |
| 223 | 229 |
| 224 void qcms_enable_iccv4(); | 230 void qcms_enable_iccv4(); |
| 225 | 231 |
| 226 diff --git a/third_party/qcms/src/qcmsint.h b/third_party/qcms/src/qcmsint.h | 232 diff --git a/third_party/qcms/src/qcmsint.h b/third_party/qcms/src/qcmsint.h |
| 227 index 53a3420..4116ed5 100644 | 233 index 53a3420..4116ed5 100644 |
| 228 --- a/third_party/qcms/src/qcmsint.h | 234 --- a/third_party/qcms/src/qcmsint.h |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 | 1148 |
| 1143 -float lut_interp_linear(double value, uint16_t *table, int length); | 1149 -float lut_interp_linear(double value, uint16_t *table, int length); |
| 1144 -float lut_interp_linear_float(float value, float *table, int length); | 1150 -float lut_interp_linear_float(float value, float *table, int length); |
| 1145 -uint16_t lut_interp_linear16(uint16_t input_value, uint16_t *table, int length)
; | 1151 -uint16_t lut_interp_linear16(uint16_t input_value, uint16_t *table, int length)
; |
| 1146 +float lut_interp_linear(double value, uint16_t *table, size_t length); | 1152 +float lut_interp_linear(double value, uint16_t *table, size_t length); |
| 1147 +float lut_interp_linear_float(float value, float *table, size_t length); | 1153 +float lut_interp_linear_float(float value, float *table, size_t length); |
| 1148 +uint16_t lut_interp_linear16(uint16_t input_value, uint16_t *table, size_t leng
th); | 1154 +uint16_t lut_interp_linear16(uint16_t input_value, uint16_t *table, size_t leng
th); |
| 1149 | 1155 |
| 1150 | 1156 |
| 1151 static inline float lerp(float a, float b, float t) | 1157 static inline float lerp(float a, float b, float t) |
| OLD | NEW |