Sha256: 24688731358bbbb6e18b00c0fc2bf64815903ad06e39e8a59c13b0e4b3765386
Contents?: true
Size: 647 Bytes
Versions: 6
Compression:
Stored size: 647 Bytes
Contents
package org.sunflow.core.filter; import org.sunflow.core.Filter; public class CubicBSpline implements Filter { @Override public float get(float x, float y) { return B3(x) * B3(y); } @Override public float getSize() { return 4.0f; } private float B3(float t) { t = Math.abs(t); if (t <= 1) { return b1(1 - t); } return b0(2 - t); } private float b0(float t) { return t * t * t * (1.0f / 6); } private float b1(float t) { return (1.0f / 6) * (-3 * t * t * t + 3 * t * t + 3 * t + 1); } }
Version data entries
6 entries across 6 versions & 1 rubygems