MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MitchellCubicKernelFunc

Class MitchellCubicKernelFunc

tensorflow/core/kernels/sampling_kernels.h:140–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138};
139
140struct 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
159inline LanczosKernelFunc CreateLanczos1Kernel() {
160 return LanczosKernelFunc(1.0);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected