| 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 // 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 | 49 |
| 50 float *build_input_gamma_table(struct curveType *TRC); | 50 float *build_input_gamma_table(struct curveType *TRC); |
| 51 struct matrix build_colorant_matrix(qcms_profile *p); | 51 struct matrix build_colorant_matrix(qcms_profile *p); |
| 52 void build_output_lut(struct curveType *trc, | 52 void build_output_lut(struct curveType *trc, |
| 53 uint16_t **output_gamma_lut, size_t *output_gamma_lut_leng
th); | 53 uint16_t **output_gamma_lut, size_t *output_gamma_lut_leng
th); |
| 54 | 54 |
| 55 struct matrix matrix_invert(struct matrix mat); | 55 struct matrix matrix_invert(struct matrix mat); |
| 56 qcms_bool compute_precache(struct curveType *trc, uint8_t *output); | 56 qcms_bool compute_precache(struct curveType *trc, uint8_t *output); |
| 57 | 57 |
| 58 static inline unsigned short float_to_half_float(float f) | |
| 59 { | |
| 60 extern const unsigned short qcms_half_float_base_table[512]; | |
| 61 extern const unsigned char qcms_half_float_shift_table[512]; | |
| 62 | |
| 63 // See Blink::Source/platform/graphics/gpu/WebGLImageConversion.cpp::con
vertFloatToHalfFloat() | |
| 64 // and http://crbug.com/491784 | |
| 65 | |
| 66 unsigned temp = *((unsigned *)(&f)); | |
| 67 unsigned signexp = (temp >> 23) & 0x1ff; | |
| 68 return qcms_half_float_base_table[signexp] + ((temp & 0x007fffff) >> qcm
s_half_float_shift_table[signexp]); | |
| 69 } | |
| 70 | |
| 71 #endif | 58 #endif |
| OLD | NEW |