| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkColorLookUpTable.h" | 8 #include "SkColorLookUpTable.h" |
| 9 #include "SkFloatingPoint.h" | 9 #include "SkFloatingPoint.h" |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 dst[i] = (ptr[n000] + diffZ * (ptr[n100] - ptr[n000]) + | 85 dst[i] = (ptr[n000] + diffZ * (ptr[n100] - ptr[n000]) + |
| 86 diffY * (ptr[n111] - ptr[n101]) + | 86 diffY * (ptr[n111] - ptr[n101]) + |
| 87 diffX * (ptr[n101] - ptr[n100])); | 87 diffX * (ptr[n101] - ptr[n100])); |
| 88 } else { | 88 } else { |
| 89 dst[i] = (ptr[n000] + diffZ * (ptr[n100] - ptr[n000]) + | 89 dst[i] = (ptr[n000] + diffZ * (ptr[n100] - ptr[n000]) + |
| 90 diffY * (ptr[n110] - ptr[n100]) + | 90 diffY * (ptr[n110] - ptr[n100]) + |
| 91 diffX * (ptr[n111] - ptr[n110])); | 91 diffX * (ptr[n111] - ptr[n110])); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 // TODO(raftias): Figure out why this is going out of range (up to 1.035
9!) |
| 96 if (dst[i] > 1.f) { |
| 97 dst[i] = 1.f; |
| 98 } else if (dst[i] < 0.f) { |
| 99 dst[i] = 0.f; |
| 100 } |
| 101 |
| 95 // Increment the table ptr in order to handle the next component. | 102 // Increment the table ptr in order to handle the next component. |
| 96 // Note that this is the how table is designed: all of nXXX | 103 // Note that this is the how table is designed: all of nXXX |
| 97 // variables are multiples of 3 because there are 3 output | 104 // variables are multiples of 3 because there are 3 output |
| 98 // components. | 105 // components. |
| 99 ptr++; | 106 ptr++; |
| 100 } | 107 } |
| 101 } | 108 } |
| OLD | NEW |