OLD | NEW |
1 /* vim: set ts=8 sw=8 noexpandtab: */ | 1 /* vim: set ts=8 sw=8 noexpandtab: */ |
2 // qcms | 2 // qcms |
3 // Copyright (C) 2009 Mozilla Foundation | 3 // Copyright (C) 2009 Mozilla Foundation |
4 // | 4 // |
5 // Permission is hereby granted, free of charge, to any person obtaining | 5 // Permission is hereby granted, free of charge, to any person obtaining |
6 // a copy of this software and associated documentation files (the "Software"), | 6 // a copy of this software and associated documentation files (the "Software"), |
7 // to deal in the Software without restriction, including without limitation | 7 // to deal in the Software without restriction, including without limitation |
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense, | 8 // the rights to use, copy, modify, merge, publish, distribute, sublicense, |
9 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e | 9 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e |
10 // is furnished to do so, subject to the following conditions: | 10 // is furnished to do so, subject to the following conditions: |
(...skipping 27 matching lines...) Expand all Loading... |
38 #define PRECACHE_OUTPUT_MAX (PRECACHE_OUTPUT_SIZE-1) | 38 #define PRECACHE_OUTPUT_MAX (PRECACHE_OUTPUT_SIZE-1) |
39 uint8_t data[PRECACHE_OUTPUT_SIZE]; | 39 uint8_t data[PRECACHE_OUTPUT_SIZE]; |
40 }; | 40 }; |
41 | 41 |
42 #ifdef _MSC_VER | 42 #ifdef _MSC_VER |
43 #define ALIGN __declspec(align(16)) | 43 #define ALIGN __declspec(align(16)) |
44 #else | 44 #else |
45 #define ALIGN __attribute__(( aligned (16) )) | 45 #define ALIGN __attribute__(( aligned (16) )) |
46 #endif | 46 #endif |
47 | 47 |
| 48 typedef struct _qcms_format_type { |
| 49 int r; |
| 50 int b; |
| 51 } qcms_format_type; |
| 52 |
48 struct _qcms_transform { | 53 struct _qcms_transform { |
49 float ALIGN matrix[3][4]; | 54 float ALIGN matrix[3][4]; |
50 float *input_gamma_table_r; | 55 float *input_gamma_table_r; |
51 float *input_gamma_table_g; | 56 float *input_gamma_table_g; |
52 float *input_gamma_table_b; | 57 float *input_gamma_table_b; |
53 | 58 |
54 float *input_clut_table_r; | 59 float *input_clut_table_r; |
55 float *input_clut_table_g; | 60 float *input_clut_table_g; |
56 float *input_clut_table_b; | 61 float *input_clut_table_b; |
57 uint16_t input_clut_table_length; | 62 uint16_t input_clut_table_length; |
(...skipping 23 matching lines...) Expand all Loading... |
81 size_t output_gamma_lut_r_length; | 86 size_t output_gamma_lut_r_length; |
82 size_t output_gamma_lut_g_length; | 87 size_t output_gamma_lut_g_length; |
83 size_t output_gamma_lut_b_length; | 88 size_t output_gamma_lut_b_length; |
84 | 89 |
85 size_t output_gamma_lut_gray_length; | 90 size_t output_gamma_lut_gray_length; |
86 | 91 |
87 struct precache_output *output_table_r; | 92 struct precache_output *output_table_r; |
88 struct precache_output *output_table_g; | 93 struct precache_output *output_table_g; |
89 struct precache_output *output_table_b; | 94 struct precache_output *output_table_b; |
90 | 95 |
91 » void (*transform_fn)(struct _qcms_transform *transform, unsigned char *s
rc, unsigned char *dest, size_t length); | 96 » void (*transform_fn)(struct _qcms_transform *transform, unsigned char *s
rc, unsigned char *dest, size_t length, struct _qcms_format_type output_format); |
92 }; | 97 }; |
93 | 98 |
94 struct matrix { | 99 struct matrix { |
95 float m[3][3]; | 100 float m[3][3]; |
96 bool invalid; | 101 bool invalid; |
97 }; | 102 }; |
98 | 103 |
99 struct qcms_modular_transform; | 104 struct qcms_modular_transform; |
100 | 105 |
101 typedef void (*transform_module_fn_t)(struct qcms_modular_transform *transform,
float *src, float *dest, size_t length); | 106 typedef void (*transform_module_fn_t)(struct qcms_modular_transform *transform,
float *src, float *dest, size_t length); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return ((int32_t)a)/65535.f; | 278 return ((int32_t)a)/65535.f; |
274 } | 279 } |
275 | 280 |
276 | 281 |
277 void precache_release(struct precache_output *p); | 282 void precache_release(struct precache_output *p); |
278 qcms_bool set_rgb_colorants(qcms_profile *profile, qcms_CIE_xyY white_point, qcm
s_CIE_xyYTRIPLE primaries); | 283 qcms_bool set_rgb_colorants(qcms_profile *profile, qcms_CIE_xyY white_point, qcm
s_CIE_xyYTRIPLE primaries); |
279 | 284 |
280 void qcms_transform_data_rgb_out_lut_sse2(qcms_transform *transform, | 285 void qcms_transform_data_rgb_out_lut_sse2(qcms_transform *transform, |
281 unsigned char *src, | 286 unsigned char *src, |
282 unsigned char *dest, | 287 unsigned char *dest, |
283 size_t length); | 288 size_t length, |
| 289 qcms_format_type output_format); |
284 void qcms_transform_data_rgba_out_lut_sse2(qcms_transform *transform, | 290 void qcms_transform_data_rgba_out_lut_sse2(qcms_transform *transform, |
285 unsigned char *src, | 291 unsigned char *src, |
286 unsigned char *dest, | 292 unsigned char *dest, |
287 size_t length); | 293 size_t length, |
| 294 qcms_format_type output_format); |
288 void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform, | 295 void qcms_transform_data_rgb_out_lut_sse1(qcms_transform *transform, |
289 unsigned char *src, | 296 unsigned char *src, |
290 unsigned char *dest, | 297 unsigned char *dest, |
291 size_t length); | 298 size_t length, |
| 299 qcms_format_type output_format); |
292 void qcms_transform_data_rgba_out_lut_sse1(qcms_transform *transform, | 300 void qcms_transform_data_rgba_out_lut_sse1(qcms_transform *transform, |
293 unsigned char *src, | 301 unsigned char *src, |
294 unsigned char *dest, | 302 unsigned char *dest, |
295 size_t length); | 303 size_t length, |
| 304 qcms_format_type output_format); |
296 | 305 |
297 extern qcms_bool qcms_supports_iccv4; | 306 extern qcms_bool qcms_supports_iccv4; |
OLD | NEW |