| 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 Corporation | 3 // Copyright (C) 2009 Mozilla Corporation |
| 4 // Copyright (C) 1998-2007 Marti Maria | 4 // Copyright (C) 1998-2007 Marti Maria |
| 5 // | 5 // |
| 6 // Permission is hereby granted, free of charge, to any person obtaining | 6 // Permission is hereby granted, free of charge, to any person obtaining |
| 7 // a copy of this software and associated documentation files (the "Software"), | 7 // a copy of this software and associated documentation files (the "Software"), |
| 8 // to deal in the Software without restriction, including without limitation | 8 // to deal in the Software without restriction, including without limitation |
| 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, | 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e | 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 g = out_linear_g * PRECACHE_OUTPUT_MAX; | 404 g = out_linear_g * PRECACHE_OUTPUT_MAX; |
| 405 b = out_linear_b * PRECACHE_OUTPUT_MAX; | 405 b = out_linear_b * PRECACHE_OUTPUT_MAX; |
| 406 | 406 |
| 407 dest[r_out] = transform->output_table_r->data[r]; | 407 dest[r_out] = transform->output_table_r->data[r]; |
| 408 dest[1] = transform->output_table_g->data[g]; | 408 dest[1] = transform->output_table_g->data[g]; |
| 409 dest[b_out] = transform->output_table_b->data[b]; | 409 dest[b_out] = transform->output_table_b->data[b]; |
| 410 dest += 3; | 410 dest += 3; |
| 411 } | 411 } |
| 412 } | 412 } |
| 413 | 413 |
| 414 static void qcms_transform_data_rgba_out_lut_precache(qcms_transform *transform,
unsigned char *src, unsigned char *dest, size_t length, qcms_format_type output
_format) | 414 void qcms_transform_data_rgba_out_lut_precache(qcms_transform *transform, unsign
ed char *src, unsigned char *dest, size_t length, qcms_format_type output_format
) |
| 415 { | 415 { |
| 416 const int r_out = output_format.r; | 416 const int r_out = output_format.r; |
| 417 const int b_out = output_format.b; | 417 const int b_out = output_format.b; |
| 418 | 418 |
| 419 unsigned int i; | 419 unsigned int i; |
| 420 float (*mat)[4] = transform->matrix; | 420 float (*mat)[4] = transform->matrix; |
| 421 for (i = 0; i < length; i++) { | 421 for (i = 0; i < length; i++) { |
| 422 unsigned char device_r = *src++; | 422 unsigned char device_r = *src++; |
| 423 unsigned char device_g = *src++; | 423 unsigned char device_g = *src++; |
| 424 unsigned char device_b = *src++; | 424 unsigned char device_b = *src++; |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 | 1595 |
| 1596 for (i = 0; i < size; ++i) { | 1596 for (i = 0; i < size; ++i) { |
| 1597 *data++ = float_to_half_float(t->output_gamma_lut_r[i] * inverse
65535); // r | 1597 *data++ = float_to_half_float(t->output_gamma_lut_r[i] * inverse
65535); // r |
| 1598 *data++ = float_to_half_float(t->output_gamma_lut_g[i] * inverse
65535); // g | 1598 *data++ = float_to_half_float(t->output_gamma_lut_g[i] * inverse
65535); // g |
| 1599 *data++ = float_to_half_float(t->output_gamma_lut_b[i] * inverse
65535); // b | 1599 *data++ = float_to_half_float(t->output_gamma_lut_b[i] * inverse
65535); // b |
| 1600 *data++ = half_float_one;
// a | 1600 *data++ = half_float_one;
// a |
| 1601 } | 1601 } |
| 1602 | 1602 |
| 1603 return size; | 1603 return size; |
| 1604 } | 1604 } |
| OLD | NEW |