@pixi/filter-bloom
Advanced tools
Comparing version 2.2.0 to 2.3.0
/*! | ||
* @pixi/filter-bloom - v2.2.0 | ||
* Compiled Wed, 18 Oct 2017 20:54:35 UTC | ||
* @pixi/filter-bloom - v2.3.0 | ||
* Compiled Tue, 31 Oct 2017 18:03:05 UTC | ||
* | ||
@@ -8,120 +8,3 @@ * pixi-filters is licensed under the MIT License. | ||
*/ | ||
if (typeof PIXI === 'undefined' || typeof PIXI.filters === 'undefined') { throw 'PixiJS is required'; } | ||
var ref = PIXI.filters; | ||
var BlurXFilter = ref.BlurXFilter; | ||
var BlurYFilter = ref.BlurYFilter; | ||
var VoidFilter = ref.VoidFilter; | ||
/** | ||
* The BloomFilter applies a Gaussian blur to an object. | ||
* The strength of the blur can be set for x- and y-axis separately. | ||
* ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bloom.png) | ||
* | ||
* @class | ||
* @extends PIXI.Filter | ||
* @memberof PIXI.filters | ||
* @param {number|PIXI.Point|number[]} [blur=2] Sets the strength of both the blurX and blurY properties simultaneously | ||
* @param {number} [quality=4] The quality of the blurX & blurY filter. | ||
* @param {number} [resolution=PIXI.settings.RESOLUTION] The resolution of the blurX & blurY filter. | ||
* @param {number} [kernelSize=5] The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15. | ||
*/ | ||
var BloomFilter = (function (superclass) { | ||
function BloomFilter(blur, quality, resolution, kernelSize) { | ||
if ( blur === void 0 ) blur = 2; | ||
if ( quality === void 0 ) quality = 4; | ||
if ( resolution === void 0 ) resolution = PIXI.settings.RESOLUTION; | ||
if ( kernelSize === void 0 ) kernelSize = 5; | ||
superclass.call(this); | ||
var blurX; | ||
var blurY; | ||
if (typeof blur === 'number') { | ||
blurX = blur; | ||
blurY = blur; | ||
} | ||
else if (blur instanceof PIXI.Point) { | ||
blurX = blur.x; | ||
blurY = blur.y; | ||
} | ||
else if (Array.isArray(blur)) { | ||
blurX = blur[0]; | ||
blurY = blur[1]; | ||
} | ||
this.blurXFilter = new BlurXFilter(blurX, quality, resolution, kernelSize); | ||
this.blurYFilter = new BlurYFilter(blurY, quality, resolution, kernelSize); | ||
this.blurYFilter.blendMode = PIXI.BLEND_MODES.SCREEN; | ||
this.defaultFilter = new VoidFilter(); | ||
} | ||
if ( superclass ) BloomFilter.__proto__ = superclass; | ||
BloomFilter.prototype = Object.create( superclass && superclass.prototype ); | ||
BloomFilter.prototype.constructor = BloomFilter; | ||
var prototypeAccessors = { blur: {},blurX: {},blurY: {} }; | ||
BloomFilter.prototype.apply = function apply (filterManager, input, output) { | ||
var renderTarget = filterManager.getRenderTarget(true); | ||
//TODO - copyTexSubImage2D could be used here? | ||
this.defaultFilter.apply(filterManager, input, output); | ||
this.blurXFilter.apply(filterManager, input, renderTarget); | ||
this.blurYFilter.apply(filterManager, renderTarget, output); | ||
filterManager.returnRenderTarget(renderTarget); | ||
}; | ||
/** | ||
* Sets the strength of both the blurX and blurY properties simultaneously | ||
* | ||
* @member {number} | ||
* @default 2 | ||
*/ | ||
prototypeAccessors.blur.get = function () { | ||
return this.blurXFilter.blur; | ||
}; | ||
prototypeAccessors.blur.set = function (value) { | ||
this.blurXFilter.blur = this.blurYFilter.blur = value; | ||
}; | ||
/** | ||
* Sets the strength of the blurX property | ||
* | ||
* @member {number} | ||
* @default 2 | ||
*/ | ||
prototypeAccessors.blurX.get = function () { | ||
return this.blurXFilter.blur; | ||
}; | ||
prototypeAccessors.blurX.set = function (value) { | ||
this.blurXFilter.blur = value; | ||
}; | ||
/** | ||
* Sets the strength of the blurY property | ||
* | ||
* @member {number} | ||
* @default 2 | ||
*/ | ||
prototypeAccessors.blurY.get = function () { | ||
return this.blurYFilter.blur; | ||
}; | ||
prototypeAccessors.blurY.set = function (value) { | ||
this.blurYFilter.blur = value; | ||
}; | ||
Object.defineProperties( BloomFilter.prototype, prototypeAccessors ); | ||
return BloomFilter; | ||
}(PIXI.Filter)); | ||
// Export to PixiJS namespace | ||
PIXI.filters.BloomFilter = BloomFilter; | ||
export { BloomFilter }; | ||
var ref=PIXI.filters,BlurXFilter=ref.BlurXFilter,BlurYFilter=ref.BlurYFilter,AlphaFilter=ref.AlphaFilter,BloomFilter=function(r){function t(t,l,e,i){void 0===t&&(t=2),void 0===l&&(l=4),void 0===e&&(e=PIXI.settings.RESOLUTION),void 0===i&&(i=5),r.call(this);var u,o;"number"==typeof t?(u=t,o=t):t instanceof PIXI.Point?(u=t.x,o=t.y):Array.isArray(t)&&(u=t[0],o=t[1]),this.blurXFilter=new BlurXFilter(u,l,e,i),this.blurYFilter=new BlurYFilter(o,l,e,i),this.blurYFilter.blendMode=PIXI.BLEND_MODES.SCREEN,this.defaultFilter=new AlphaFilter}r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t;var l={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return t.prototype.apply=function(r,t,l){var e=r.getRenderTarget(!0);this.defaultFilter.apply(r,t,l),this.blurXFilter.apply(r,t,e),this.blurYFilter.apply(r,e,l),r.returnRenderTarget(e)},l.blur.get=function(){return this.blurXFilter.blur},l.blur.set=function(r){this.blurXFilter.blur=this.blurYFilter.blur=r},l.blurX.get=function(){return this.blurXFilter.blur},l.blurX.set=function(r){this.blurXFilter.blur=r},l.blurY.get=function(){return this.blurYFilter.blur},l.blurY.set=function(r){this.blurYFilter.blur=r},Object.defineProperties(t.prototype,l),t}(PIXI.Filter);PIXI.filters.BloomFilter=BloomFilter;export{BloomFilter}; | ||
//# sourceMappingURL=filter-bloom.es.js.map |
/*! | ||
* @pixi/filter-bloom - v2.2.0 | ||
* Compiled Wed, 18 Oct 2017 20:54:34 UTC | ||
* @pixi/filter-bloom - v2.3.0 | ||
* Compiled Tue, 31 Oct 2017 18:03:05 UTC | ||
* | ||
@@ -8,130 +8,3 @@ * pixi-filters is licensed under the MIT License. | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.__filter_bloom = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
if (typeof PIXI === 'undefined' || typeof PIXI.filters === 'undefined') { throw 'PixiJS is required'; } | ||
var ref = PIXI.filters; | ||
var BlurXFilter = ref.BlurXFilter; | ||
var BlurYFilter = ref.BlurYFilter; | ||
var VoidFilter = ref.VoidFilter; | ||
/** | ||
* The BloomFilter applies a Gaussian blur to an object. | ||
* The strength of the blur can be set for x- and y-axis separately. | ||
* ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bloom.png) | ||
* | ||
* @class | ||
* @extends PIXI.Filter | ||
* @memberof PIXI.filters | ||
* @param {number|PIXI.Point|number[]} [blur=2] Sets the strength of both the blurX and blurY properties simultaneously | ||
* @param {number} [quality=4] The quality of the blurX & blurY filter. | ||
* @param {number} [resolution=PIXI.settings.RESOLUTION] The resolution of the blurX & blurY filter. | ||
* @param {number} [kernelSize=5] The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15. | ||
*/ | ||
var BloomFilter = (function (superclass) { | ||
function BloomFilter(blur, quality, resolution, kernelSize) { | ||
if ( blur === void 0 ) blur = 2; | ||
if ( quality === void 0 ) quality = 4; | ||
if ( resolution === void 0 ) resolution = PIXI.settings.RESOLUTION; | ||
if ( kernelSize === void 0 ) kernelSize = 5; | ||
superclass.call(this); | ||
var blurX; | ||
var blurY; | ||
if (typeof blur === 'number') { | ||
blurX = blur; | ||
blurY = blur; | ||
} | ||
else if (blur instanceof PIXI.Point) { | ||
blurX = blur.x; | ||
blurY = blur.y; | ||
} | ||
else if (Array.isArray(blur)) { | ||
blurX = blur[0]; | ||
blurY = blur[1]; | ||
} | ||
this.blurXFilter = new BlurXFilter(blurX, quality, resolution, kernelSize); | ||
this.blurYFilter = new BlurYFilter(blurY, quality, resolution, kernelSize); | ||
this.blurYFilter.blendMode = PIXI.BLEND_MODES.SCREEN; | ||
this.defaultFilter = new VoidFilter(); | ||
} | ||
if ( superclass ) BloomFilter.__proto__ = superclass; | ||
BloomFilter.prototype = Object.create( superclass && superclass.prototype ); | ||
BloomFilter.prototype.constructor = BloomFilter; | ||
var prototypeAccessors = { blur: {},blurX: {},blurY: {} }; | ||
BloomFilter.prototype.apply = function apply (filterManager, input, output) { | ||
var renderTarget = filterManager.getRenderTarget(true); | ||
//TODO - copyTexSubImage2D could be used here? | ||
this.defaultFilter.apply(filterManager, input, output); | ||
this.blurXFilter.apply(filterManager, input, renderTarget); | ||
this.blurYFilter.apply(filterManager, renderTarget, output); | ||
filterManager.returnRenderTarget(renderTarget); | ||
}; | ||
/** | ||
* Sets the strength of both the blurX and blurY properties simultaneously | ||
* | ||
* @member {number} | ||
* @default 2 | ||
*/ | ||
prototypeAccessors.blur.get = function () { | ||
return this.blurXFilter.blur; | ||
}; | ||
prototypeAccessors.blur.set = function (value) { | ||
this.blurXFilter.blur = this.blurYFilter.blur = value; | ||
}; | ||
/** | ||
* Sets the strength of the blurX property | ||
* | ||
* @member {number} | ||
* @default 2 | ||
*/ | ||
prototypeAccessors.blurX.get = function () { | ||
return this.blurXFilter.blur; | ||
}; | ||
prototypeAccessors.blurX.set = function (value) { | ||
this.blurXFilter.blur = value; | ||
}; | ||
/** | ||
* Sets the strength of the blurY property | ||
* | ||
* @member {number} | ||
* @default 2 | ||
*/ | ||
prototypeAccessors.blurY.get = function () { | ||
return this.blurYFilter.blur; | ||
}; | ||
prototypeAccessors.blurY.set = function (value) { | ||
this.blurYFilter.blur = value; | ||
}; | ||
Object.defineProperties( BloomFilter.prototype, prototypeAccessors ); | ||
return BloomFilter; | ||
}(PIXI.Filter)); | ||
// Export to PixiJS namespace | ||
PIXI.filters.BloomFilter = BloomFilter; | ||
exports.BloomFilter = BloomFilter; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(t.__filter_bloom={})}(this,function(t){"use strict";var r=PIXI.filters,e=r.BlurXFilter,l=r.BlurYFilter,i=r.AlphaFilter,u=function(t){function r(r,u,o,n){void 0===r&&(r=2),void 0===u&&(u=4),void 0===o&&(o=PIXI.settings.RESOLUTION),void 0===n&&(n=5),t.call(this);var b,s;"number"==typeof r?(b=r,s=r):r instanceof PIXI.Point?(b=r.x,s=r.y):Array.isArray(r)&&(b=r[0],s=r[1]),this.blurXFilter=new e(b,u,o,n),this.blurYFilter=new l(s,u,o,n),this.blurYFilter.blendMode=PIXI.BLEND_MODES.SCREEN,this.defaultFilter=new i}t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r;var u={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return r.prototype.apply=function(t,r,e){var l=t.getRenderTarget(!0);this.defaultFilter.apply(t,r,e),this.blurXFilter.apply(t,r,l),this.blurYFilter.apply(t,l,e),t.returnRenderTarget(l)},u.blur.get=function(){return this.blurXFilter.blur},u.blur.set=function(t){this.blurXFilter.blur=this.blurYFilter.blur=t},u.blurX.get=function(){return this.blurXFilter.blur},u.blurX.set=function(t){this.blurXFilter.blur=t},u.blurY.get=function(){return this.blurYFilter.blur},u.blurY.set=function(t){this.blurYFilter.blur=t},Object.defineProperties(r.prototype,u),r}(PIXI.Filter);PIXI.filters.BloomFilter=u,t.BloomFilter=u,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=filter-bloom.js.map |
{ | ||
"name": "@pixi/filter-bloom", | ||
"version": "2.2.0", | ||
"main": "lib/filter-bloom.min.js", | ||
"version": "2.3.0", | ||
"main": "lib/filter-bloom.js", | ||
"description": "Display filter render as ASCII text", | ||
@@ -10,3 +10,3 @@ "author": "Mat Groves", | ||
], | ||
"module": "lib/filter-bloom.es.min.js", | ||
"module": "lib/filter-bloom.es.js", | ||
"types": "types.d.ts", | ||
@@ -24,5 +24,5 @@ "homepage": "http://pixijs.com/", | ||
"scripts": { | ||
"build:umd": "rollup -c -f umd && rollup -cp -f umd", | ||
"build:es": "rollup -c && rollup -cp", | ||
"build": "npm run build:umd && npm run build:es", | ||
"build:dev": "rollup -c && rollup -c -f umd", | ||
"build": "rollup -cp && rollup -cp -f umd", | ||
"watch": "rollup -cw", | ||
"postversion": "npm run build" | ||
@@ -35,9 +35,10 @@ }, | ||
"peerDependencies": { | ||
"pixi.js": "^4.0.0" | ||
"pixi.js": "^4.6.0" | ||
}, | ||
"devDependencies": { | ||
"@tools/build": "^2.0.1", | ||
"@tools/build": "^2.3.0", | ||
"@tools/fragments": "^2.0.0", | ||
"rollup": "^0.45.2" | ||
"rollup": "^0.45.2", | ||
"rollup-watch": "^4.3.1" | ||
} | ||
} |
/// <reference types="pixi.js" /> | ||
declare namespace PIXI.filters { | ||
class BloomFilter extends PIXI.Filter { | ||
class BloomFilter extends PIXI.Filter<{}> { | ||
constructor(blur?:number|PIXI.Point|number[], quality?:number, resolution?:number, kernelSize?:number); | ||
@@ -5,0 +5,0 @@ blur:number; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15059
4
8
40
1