package yi.iu.processor.resample;

public class HermiteResampler extends Resampler
{
    public HermiteResampler () {
        super(); fwidth=1.0;
    }

    public HermiteResampler(int w, int h) {
        super(w,h); fwidth=1.0;
    }

    public double filter(double value) {
        double result;
        // f(t) = 2|t|^3 - 3|t|^2 + 1, -1 <= t <= 1
        if (value < 0.0) value= -value;
        if (value < 1.0) result= (2.0 * value - 3.0) * value * value + 1.0;
        else result= 0.0;
        return result;
    }
}