Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/filter-advanced-bloom

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/filter-advanced-bloom - npm Package Compare versions

Comparing version 4.2.0 to 5.0.0

dist/filter-advanced-bloom.mjs

55

dist/filter-advanced-bloom.js

@@ -1,9 +0,54 @@

/*!
* @pixi/filter-advanced-bloom - v4.2.0
* Compiled Fri, 05 Aug 2022 19:53:35 UTC
"use strict";/*!
* @pixi/filter-advanced-bloom - v5.0.0
* Compiled Fri, 23 Sep 2022 20:48:56 UTC
*
* @pixi/filter-advanced-bloom is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var __filters=function(e,t,r,o){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}Object.create;Object.create;var l="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",u=function(e){function t(t){void 0===t&&(t=.5);var r=e.call(this,l,"\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform float threshold;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n // A simple & fast algorithm for getting brightness.\n // It's inaccuracy , but good enought for this feature.\n float _max = max(max(color.r, color.g), color.b);\n float _min = min(min(color.r, color.g), color.b);\n float brightness = (_max + _min) * 0.5;\n\n if(brightness > threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n")||this;return r.threshold=t,r}return i(t,e),Object.defineProperty(t.prototype,"threshold",{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),t}(t.Filter),s=function(e){function t(n){var i=e.call(this,l,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n")||this;i.bloomScale=1,i.brightness=1,i._resolution=o.settings.FILTER_RESOLUTION,"number"==typeof n&&(n={threshold:n});var s=Object.assign(t.defaults,n);i.bloomScale=s.bloomScale,i.brightness=s.brightness;var a=s.kernels,c=s.blur,b=s.quality,f=s.pixelSize,h=s.resolution;return i._extractFilter=new u(s.threshold),i._extractFilter.resolution=h,i._blurFilter=a?new r.KawaseBlurFilter(a):new r.KawaseBlurFilter(c,b),i.pixelSize=f,i.resolution=h,i}return i(t,e),t.prototype.apply=function(e,t,r,o,n){var i=e.getFilterTexture();this._extractFilter.apply(e,t,i,1,n);var l=e.getFilterTexture();this._blurFilter.apply(e,i,l,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=l,e.applyFilter(this,t,r,o),e.returnFilterTexture(l),e.returnFilterTexture(i)},Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"threshold",{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernels",{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blur",{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pixelSize",{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),t.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:o.settings.FILTER_RESOLUTION},t}(t.Filter);return e.AdvancedBloomFilter=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,PIXI.filters,PIXI);Object.assign(PIXI.filters,__filters);
*/Object.defineProperty(exports,"__esModule",{value:!0});var i=require("@pixi/core"),u=require("@pixi/filter-kawase-blur"),a=`attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
}`,b=`
uniform sampler2D uSampler;
varying vec2 vTextureCoord;
uniform float threshold;
void main() {
vec4 color = texture2D(uSampler, vTextureCoord);
// A simple & fast algorithm for getting brightness.
// It's inaccuracy , but good enought for this feature.
float _max = max(max(color.r, color.g), color.b);
float _min = min(min(color.r, color.g), color.b);
float brightness = (_max + _min) * 0.5;
if(brightness > threshold) {
gl_FragColor = color;
} else {
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
}
}
`;class m extends i.Filter{constructor(r=.5){super(a,b),this.threshold=r}get threshold(){return this.uniforms.threshold}set threshold(r){this.uniforms.threshold=r}}var x=`uniform sampler2D uSampler;
varying vec2 vTextureCoord;
uniform sampler2D bloomTexture;
uniform float bloomScale;
uniform float brightness;
void main() {
vec4 color = texture2D(uSampler, vTextureCoord);
color.rgb *= brightness;
vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);
bloomColor.rgb *= bloomScale;
gl_FragColor = color + bloomColor;
}
`;const h=class extends i.Filter{constructor(e){super(a,x),this.bloomScale=1,this.brightness=1,this._resolution=i.settings.FILTER_RESOLUTION,typeof e=="number"&&(e={threshold:e});const r=Object.assign(h.defaults,e);this.bloomScale=r.bloomScale,this.brightness=r.brightness;const{kernels:l,blur:s,quality:n,pixelSize:o,resolution:t}=r;this._extractFilter=new m(r.threshold),this._extractFilter.resolution=t,this._blurFilter=l?new u.KawaseBlurFilter(l):new u.KawaseBlurFilter(s,n),this.pixelSize=o,this.resolution=t}apply(e,r,l,s,n){const o=e.getFilterTexture();this._extractFilter.apply(e,r,o,1,n);const t=e.getFilterTexture();this._blurFilter.apply(e,o,t,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=t,e.applyFilter(this,r,l,s),e.returnFilterTexture(t),e.returnFilterTexture(o)}get resolution(){return this._resolution}set resolution(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)}get threshold(){return this._extractFilter.threshold}set threshold(e){this._extractFilter.threshold=e}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.blur}set blur(e){this._blurFilter.blur=e}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){this._blurFilter.pixelSize=e}};let c=h;c.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:i.settings.FILTER_RESOLUTION},exports.AdvancedBloomFilter=c;
//# sourceMappingURL=filter-advanced-bloom.js.map

3

index.d.ts

@@ -1,2 +0,2 @@

import type { CLEAR_MODES } from '@pixi/constants';
import type { CLEAR_MODES } from '@pixi/core';
import { Filter } from '@pixi/core';

@@ -16,3 +16,2 @@ import type { FilterState } from '@pixi/core';

* @extends PIXI.Filter
* @memberof PIXI.filters
* @see {@link https://www.npmjs.com/package/@pixi/filter-advanced-bloom|@pixi/filter-advanced-bloom}

@@ -19,0 +18,0 @@ * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}

{
"name": "@pixi/filter-advanced-bloom",
"version": "4.2.0",
"main": "dist/filter-advanced-bloom.cjs.js",
"bundle": "dist/filter-advanced-bloom.js",
"version": "5.0.0",
"main": "./dist/filter-advanced-bloom.js",
"description": "PixiJS filter to render Bloom Filter (with highlight) effect",

@@ -11,11 +10,11 @@ "author": "finscn",

],
"module": "dist/filter-advanced-bloom.esm.mjs",
"module": "./dist/filter-advanced-bloom.mjs",
"exports": {
".": {
"import": "./dist/filter-advanced-bloom.esm.mjs",
"require": "./dist/filter-advanced-bloom.cjs.js",
"import": "./dist/filter-advanced-bloom.mjs",
"require": "./dist/filter-advanced-bloom.js",
"types": "./index.d.ts"
}
},
"types": "index.d.ts",
"types": "./index.d.ts",
"homepage": "http://pixijs.com/",

@@ -40,16 +39,12 @@ "bugs": "https://github.com/pixijs/filters/issues",

"dependencies": {
"@pixi/filter-kawase-blur": "4.2.0"
"@pixi/filter-kawase-blur": "5.0.0"
},
"peerDependencies": {
"@pixi/constants": "^6.0.0",
"@pixi/core": "^6.0.0",
"@pixi/settings": "^6.0.0"
"@pixi/core": "^7.0.0-X"
},
"devDependencies": {
"@pixi/constants": "^6.0.0",
"@pixi/core": "^6.0.0",
"@pixi/settings": "^6.0.0",
"@tools/fragments": "4.1.3"
"@pixi/core": "^7.0.0-X",
"@tools/fragments": "5.0.0"
},
"gitHead": "dc16782d00fffb8c02d30cc32146d9c6a40599cb"
"gitHead": "2bec8c5024e4086e5aada8e471820bddc8ede687"
}

@@ -23,2 +23,2 @@ # AdvancedBloomFilter

See https://pixijs.github.io/pixi-filters/docs
See https://filters.pixijs.download/main/docs/AdvancedBloomFilter.html

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc