この関数は CamanJS ライブラリからのものです。これは、プラグインのティルトシフト効果のコードです
Caman.Filter.register("tiltShift", function(opts) {
var defaults, gradient;
defaults = {
center: {
x: this.dimensions.width / 2,
y: this.dimensions.height / 2
},
angle: 45,
focusWidth: 200,
startRadius: 3,
radiusFactor: 1.5,
steps: 3
};
opts = Util.extend(defaults, opts);
opts.angle *= Math.PI / 180;
gradient = getLinearGradientMap(this.dimensions.width, this.dimensions.height, opts.center.x, opts.center.y, opts.angle, opts.focusWidth, true);
return this.processPlugin("compoundBlur", [gradient, opts.startRadius, opts.radiusFactor, opts.steps]);
});
以下の値をパラメーターとして指定しました。
this.tiltShift(600,400,300,200,0,200,true).render();
しかし、デフォルトの角度は 45 のままです。どうすれば変更できますか?