@pixi/filter-tilt-shift
Advanced tools
Comparing version 5.1.1 to 5.2.0
"use strict";/*! | ||
* @pixi/filter-tilt-shift - v5.1.1 | ||
* Compiled Wed, 11 Jan 2023 23:10:33 UTC | ||
* @pixi/filter-tilt-shift - v5.2.0 | ||
* Compiled Tue, 28 Feb 2023 14:24:35 UTC | ||
* | ||
@@ -18,3 +18,3 @@ * @pixi/filter-tilt-shift is licensed under the MIT License. | ||
vTextureCoord = aTextureCoord; | ||
}`,d=`varying vec2 vTextureCoord; | ||
}`,f=`varying vec2 vTextureCoord; | ||
@@ -58,3 +58,3 @@ uniform sampler2D uSampler; | ||
} | ||
`;class o extends n.Filter{constructor(t=100,e=600,i,r){super(h,d),this.uniforms.blur=t,this.uniforms.gradientBlur=e,this.uniforms.start=i||new n.Point(0,window.innerHeight/2),this.uniforms.end=r||new n.Point(600,window.innerHeight/2),this.uniforms.delta=new n.Point(30,30),this.uniforms.texSize=new n.Point(window.innerWidth,window.innerHeight),this.updateDelta()}updateDelta(){this.uniforms.delta.x=0,this.uniforms.delta.y=0}get blur(){return this.uniforms.blur}set blur(t){this.uniforms.blur=t}get gradientBlur(){return this.uniforms.gradientBlur}set gradientBlur(t){this.uniforms.gradientBlur=t}get start(){return this.uniforms.start}set start(t){this.uniforms.start=t,this.updateDelta()}get end(){return this.uniforms.end}set end(t){this.uniforms.end=t,this.updateDelta()}}class a extends o{updateDelta(){const t=this.uniforms.end.x-this.uniforms.start.x,e=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(t*t+e*e);this.uniforms.delta.x=t/i,this.uniforms.delta.y=e/i}}class u extends o{updateDelta(){const t=this.uniforms.end.x-this.uniforms.start.x,e=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(t*t+e*e);this.uniforms.delta.x=-e/i,this.uniforms.delta.y=t/i}}class f extends n.Filter{constructor(t=100,e=600,i,r){super(),this.tiltShiftXFilter=new a(t,e,i,r),this.tiltShiftYFilter=new u(t,e,i,r)}apply(t,e,i,r){const l=t.getFilterTexture();this.tiltShiftXFilter.apply(t,e,l,1),this.tiltShiftYFilter.apply(t,l,i,r),t.returnFilterTexture(l)}get blur(){return this.tiltShiftXFilter.blur}set blur(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}get gradientBlur(){return this.tiltShiftXFilter.gradientBlur}set gradientBlur(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}get start(){return this.tiltShiftXFilter.start}set start(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}get end(){return this.tiltShiftXFilter.end}set end(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}exports.TiltShiftAxisFilter=o,exports.TiltShiftFilter=f,exports.TiltShiftXFilter=a,exports.TiltShiftYFilter=u; | ||
`;class l extends n.Filter{constructor(t){var r,i;super(h,f),this.uniforms.blur=t.blur,this.uniforms.gradientBlur=t.gradientBlur,this.uniforms.start=(r=t.start)!=null?r:new n.Point(0,window.innerHeight/2),this.uniforms.end=(i=t.end)!=null?i:new n.Point(600,window.innerHeight/2),this.uniforms.delta=new n.Point(30,30),this.uniforms.texSize=new n.Point(window.innerWidth,window.innerHeight),this.updateDelta()}updateDelta(){this.uniforms.delta.x=0,this.uniforms.delta.y=0}get blur(){return this.uniforms.blur}set blur(t){this.uniforms.blur=t}get gradientBlur(){return this.uniforms.gradientBlur}set gradientBlur(t){this.uniforms.gradientBlur=t}get start(){return this.uniforms.start}set start(t){this.uniforms.start=t,this.updateDelta()}get end(){return this.uniforms.end}set end(t){this.uniforms.end=t,this.updateDelta()}}class o extends l{updateDelta(){const t=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(t*t+r*r);this.uniforms.delta.x=t/i,this.uniforms.delta.y=r/i}}class a extends l{updateDelta(){const t=this.uniforms.end.x-this.uniforms.start.x,r=this.uniforms.end.y-this.uniforms.start.y,i=Math.sqrt(t*t+r*r);this.uniforms.delta.x=-r/i,this.uniforms.delta.y=t/i}}const u=class extends n.Filter{constructor(e,t,r,i){super(),typeof e=="number"&&(n.utils.deprecation("5.3.0","TiltShiftFilter constructor arguments is deprecated, use options."),e={blur:e,gradientBlur:t,start:r,end:i}),e=Object.assign({},u.defaults,e),this.tiltShiftXFilter=new o(e),this.tiltShiftYFilter=new a(e)}apply(e,t,r,i){const s=e.getFilterTexture();this.tiltShiftXFilter.apply(e,t,s,1),this.tiltShiftYFilter.apply(e,s,r,i),e.returnFilterTexture(s)}get blur(){return this.tiltShiftXFilter.blur}set blur(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e}get gradientBlur(){return this.tiltShiftXFilter.gradientBlur}set gradientBlur(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e}get start(){return this.tiltShiftXFilter.start}set start(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e}get end(){return this.tiltShiftXFilter.end}set end(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e}};let d=u;d.defaults={blur:100,gradientBlur:600,start:void 0,end:void 0},exports.TiltShiftAxisFilter=l,exports.TiltShiftFilter=d,exports.TiltShiftXFilter=o,exports.TiltShiftYFilter=a; | ||
//# sourceMappingURL=filter-tilt-shift.js.map |
@@ -15,3 +15,3 @@ import type { CLEAR_MODES } from '@pixi/core'; | ||
export declare class TiltShiftAxisFilter extends Filter { | ||
constructor(blur?: number, gradientBlur?: number, start?: Point, end?: Point); | ||
constructor(options: TiltShiftFilterOptions); | ||
/** | ||
@@ -65,24 +65,27 @@ * Updates the filter delta values. | ||
export declare class TiltShiftFilter extends Filter { | ||
/** Default options */ | ||
static readonly defaults: TiltShiftFilterOptions; | ||
private tiltShiftXFilter; | ||
private tiltShiftYFilter; | ||
/** | ||
* @param {TiltShiftFilterOptions} [options] - The optional parameters of the tilt shift filter. | ||
*/ | ||
constructor(options?: Partial<TiltShiftFilterOptions>); | ||
/** | ||
* @deprecated since 5.3.0 | ||
* @param {number} [blur=100] - The strength of the blur. | ||
* @param {number} [gradientBlur=600] - The strength of the gradient blur. | ||
* @param {PIXI.Point} [start=null] - The Y value to start the effect at. | ||
* @param {PIXI.Point} [end=null] - The Y value to end the effect at. | ||
* @param {PIXI.Point} [start=null] - The position to start the effect at. | ||
* @param {PIXI.Point} [end=null] - The position to end the effect at. | ||
*/ | ||
constructor(blur?: number, gradientBlur?: number, start?: Point, end?: Point); | ||
apply(filterManager: FilterSystem, input: RenderTexture, output: RenderTexture, clearMode: CLEAR_MODES): void; | ||
/** | ||
* The strength of the blur. | ||
*/ | ||
/** The strength of the blur. */ | ||
get blur(): number; | ||
set blur(value: number); | ||
/** | ||
* The strength of the gradient blur. | ||
*/ | ||
/** The strength of the gradient blur. */ | ||
get gradientBlur(): number; | ||
set gradientBlur(value: number); | ||
/** | ||
* The Y value to start the effect at. | ||
* The position to start the effect at. | ||
* | ||
@@ -94,3 +97,3 @@ * @member {PIXI.Point} | ||
/** | ||
* The Y value to end the effect at. | ||
* The position to end the effect at. | ||
* | ||
@@ -104,2 +107,16 @@ * @member {PIXI.Point} | ||
/** | ||
* Options for creating filter. | ||
*/ | ||
export declare interface TiltShiftFilterOptions { | ||
/** The strength of the blur. */ | ||
blur: number; | ||
/** The strength of the blur gradient */ | ||
gradientBlur: number; | ||
/** The position to start the effect at. */ | ||
start?: Point | undefined; | ||
/** The position to end the effect at. */ | ||
end?: Point | undefined; | ||
} | ||
/** | ||
* A TiltShiftXFilter. | ||
@@ -106,0 +123,0 @@ * |
{ | ||
"name": "@pixi/filter-tilt-shift", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"main": "./dist/filter-tilt-shift.js", | ||
@@ -41,3 +41,3 @@ "description": "PixiJS filter to render a tilt-shift-like camera effect", | ||
}, | ||
"gitHead": "d737dd1d7c661823b25741b3fdc0a3045512bebc" | ||
"gitHead": "a37d0789e3237734f9cec754ccd93c77bc52580d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38251
251