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

@pixi/filter-bevel

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/filter-bevel - npm Package Compare versions

Comparing version 4.2.0 to 5.0.0

dist/filter-bevel.mjs

43

dist/filter-bevel.js

@@ -1,9 +0,42 @@

/*!
* @pixi/filter-bevel - v4.2.0
* Compiled Fri, 05 Aug 2022 19:53:35 UTC
"use strict";/*!
* @pixi/filter-bevel - v5.0.0
* Compiled Fri, 23 Sep 2022 20:48:56 UTC
*
* @pixi/filter-bevel is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var __filters=function(o,t,r,e){"use strict";var n=function(o,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r])})(o,t)};Object.create;Object.create;var i=function(o){function t(t){var r=o.call(this,"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}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n")||this;return r._thickness=2,r._angle=0,r.uniforms.lightColor=new Float32Array(3),r.uniforms.shadowColor=new Float32Array(3),Object.assign(r,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),r.padding=1,r}return function(o,t){function r(){this.constructor=o}n(o,t),o.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,o),t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._angle/r.DEG_TO_RAD},set:function(o){this._angle=o*r.DEG_TO_RAD,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(o){this._thickness=o,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightColor",{get:function(){return e.rgb2hex(this.uniforms.lightColor)},set:function(o){e.hex2rgb(o,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightAlpha",{get:function(){return this.uniforms.lightAlpha},set:function(o){this.uniforms.lightAlpha=o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowColor",{get:function(){return e.rgb2hex(this.uniforms.shadowColor)},set:function(o){e.hex2rgb(o,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowAlpha",{get:function(){return this.uniforms.shadowAlpha},set:function(o){this.uniforms.shadowAlpha=o},enumerable:!1,configurable:!0}),t}(t.Filter);return o.BevelFilter=i,Object.defineProperty(o,"__esModule",{value:!0}),o}({},PIXI,PIXI,PIXI.utils);Object.assign(PIXI.filters,__filters);
*/Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@pixi/core"),t=`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;
}`,e=`precision mediump float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec4 filterArea;
uniform float transformX;
uniform float transformY;
uniform vec3 lightColor;
uniform float lightAlpha;
uniform vec3 shadowColor;
uniform float shadowAlpha;
void main(void) {
vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);
vec4 color = texture2D(uSampler, vTextureCoord);
float light = texture2D(uSampler, vTextureCoord - transform).a;
float shadow = texture2D(uSampler, vTextureCoord + transform).a;
color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));
color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));
gl_FragColor = vec4(color.rgb * color.a, color.a);
}
`;class i extends r.Filter{constructor(o){super(t,e),this._thickness=2,this._angle=0,this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),Object.assign(this,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},o),this.padding=1}_updateTransform(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)}get rotation(){return this._angle/r.DEG_TO_RAD}set rotation(o){this._angle=o*r.DEG_TO_RAD,this._updateTransform()}get thickness(){return this._thickness}set thickness(o){this._thickness=o,this._updateTransform()}get lightColor(){return r.utils.rgb2hex(this.uniforms.lightColor)}set lightColor(o){r.utils.hex2rgb(o,this.uniforms.lightColor)}get lightAlpha(){return this.uniforms.lightAlpha}set lightAlpha(o){this.uniforms.lightAlpha=o}get shadowColor(){return r.utils.rgb2hex(this.uniforms.shadowColor)}set shadowColor(o){r.utils.hex2rgb(o,this.uniforms.shadowColor)}get shadowAlpha(){return this.uniforms.shadowAlpha}set shadowAlpha(o){this.uniforms.shadowAlpha=o}}exports.BevelFilter=i;
//# sourceMappingURL=filter-bevel.js.map

1

index.d.ts

@@ -9,3 +9,2 @@ import { Filter } from '@pixi/core';

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

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

{
"name": "@pixi/filter-bevel",
"version": "4.2.0",
"main": "dist/filter-bevel.cjs.js",
"bundle": "dist/filter-bevel.js",
"version": "5.0.0",
"main": "./dist/filter-bevel.js",
"description": "PixiJS filter to apply a bevel effect",

@@ -11,11 +10,11 @@ "author": "Evgeny Shestakov",

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

@@ -37,13 +36,9 @@ "bugs": "https://github.com/pixijs/filters/issues",

"peerDependencies": {
"@pixi/core": "^6.0.0",
"@pixi/math": "^6.0.0",
"@pixi/utils": "^6.0.0"
"@pixi/core": "^7.0.0-X"
},
"devDependencies": {
"@pixi/core": "^6.0.0",
"@pixi/math": "^6.0.0",
"@pixi/utils": "^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 @@ # BevelFilter

See https://pixijs.github.io/pixi-filters/docs
See https://filters.pixijs.download/main/docs/BevelFilter.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