| 138 | }; |
| 139 | |
| 140 | struct MitchellCubicKernelFunc { |
| 141 | // https://doi.org/10.1145/378456.378514 |
| 142 | // D. P. Mitchell and A. N. Netravali. Reconstruction filters in computer |
| 143 | // graphics. Computer Graphics (Proceedings of ACM SIGGRAPH 1988), |
| 144 | // 22(4):221–228, 1988. |
| 145 | float operator()(float x) const { |
| 146 | x = std::abs(x); |
| 147 | if (x >= 2.0f) { |
| 148 | return 0.0f; |
| 149 | } else if (x >= 1.0f) { |
| 150 | return (((-7.0f / 18.0f) * x + 2.0f) * x - 10.0f / 3.0f) * x + |
| 151 | 16.0f / 9.0f; |
| 152 | } else { |
| 153 | return (((7.0f / 6.0f) * x - 2.0f) * x) * x + 8.0f / 9.0f; |
| 154 | } |
| 155 | } |
| 156 | float Radius() const { return 2.f; } |
| 157 | }; |
| 158 | |
| 159 | inline LanczosKernelFunc CreateLanczos1Kernel() { |
| 160 | return LanczosKernelFunc(1.0); |
no outgoing calls
no test coverage detected