📄 catmullromfilter.java
字号:
package org.sunflow.core.filter;
import org.sunflow.core.Filter;
public class CatmullRomFilter implements Filter {
public float getSize() {
return 4.0f;
}
public float get(float x, float y) {
return catrom1d(x) * catrom1d(y);
}
private float catrom1d(float x) {
x = Math.abs(x);
float x2 = x * x;
float x3 = x * x2;
if (x >= 2)
return 0;
if (x < 1)
return 3 * x3 - 5 * x2 + 2;
return -x3 + 5 * x2 - 8 * x + 4;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -