| 120 | }; |
| 121 | |
| 122 | struct KeysCubicKernelFunc { |
| 123 | // http://ieeexplore.ieee.org/document/1163711/ |
| 124 | // R. G. Keys. Cubic convolution interpolation for digital image |
| 125 | // processing. IEEE Transactions on Acoustics, Speech, and Signal |
| 126 | // Processing, 29(6):1153–1160, 1981. |
| 127 | float operator()(float x) const { |
| 128 | x = std::abs(x); |
| 129 | if (x >= 2.0f) { |
| 130 | return 0.0f; |
| 131 | } else if (x >= 1.0f) { |
| 132 | return ((-0.5f * x + 2.5f) * x - 4.0f) * x + 2.0f; |
| 133 | } else { |
| 134 | return ((1.5f * x - 2.5f) * x) * x + 1.0f; |
| 135 | } |
| 136 | } |
| 137 | float Radius() const { return 2.f; } |
| 138 | }; |
| 139 | |
| 140 | struct MitchellCubicKernelFunc { |
| 141 | // https://doi.org/10.1145/378456.378514 |
no outgoing calls
no test coverage detected