@pixi/utils
Advanced tools
Comparing version 7.0.0-beta.3 to 7.0.0-beta.4
/*! | ||
* @pixi/utils - v7.0.0-beta.3 | ||
* Compiled Thu, 13 Oct 2022 15:35:43 UTC | ||
* @pixi/utils - v7.0.0-beta.4 | ||
* Compiled Thu, 20 Oct 2022 19:45:44 UTC | ||
* | ||
@@ -1047,3 +1047,5 @@ * @pixi/utils is licensed under the MIT License. | ||
let height = canvas.height; | ||
const context = canvas.getContext("2d"); | ||
const context = canvas.getContext("2d", { | ||
willReadFrequently: true | ||
}); | ||
const imageData = context.getImageData(0, 0, width, height); | ||
@@ -1050,0 +1052,0 @@ const pixels = imageData.data; |
"use strict";/*! | ||
* @pixi/utils - v7.0.0-beta.3 | ||
* Compiled Thu, 13 Oct 2022 15:35:43 UTC | ||
* @pixi/utils - v7.0.0-beta.4 | ||
* Compiled Thu, 20 Oct 2022 19:45:44 UTC | ||
* | ||
@@ -12,3 +12,3 @@ * @pixi/utils is licensed under the MIT License. | ||
Deprecated since v${e}`),console.warn(a),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} | ||
Deprecated since v${e}`),console.warn(a))),D[t]=!0}const Yr={},v=Object.create(null),b=Object.create(null);function Qr(){let e;for(e in v)v[e].destroy();for(e in b)b[e].destroy()}function Vr(){let e;for(e in v)delete v[e];for(e in b)delete b[e]}class Xr{constructor(t,r,a){this.canvas=g.settings.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=a||g.settings.RESOLUTION,this.resize(t,r)}clear(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}resize(t,r){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(r*this.resolution)}destroy(){this.context=null,this.canvas=null}get width(){return this.canvas.width}set width(t){this.canvas.width=Math.round(t)}get height(){return this.canvas.height}set height(t){this.canvas.height=Math.round(t)}}function Kr(e){let t=e.width,r=e.height;const a=e.getContext("2d"),n=a.getImageData(0,0,t,r).data,i=n.length,o={top:null,left:null,right:null,bottom:null};let l=null,s,f,c;for(s=0;s<i;s+=4)n[s+3]!==0&&(f=s/4%t,c=~~(s/4/t),o.top===null&&(o.top=c),(o.left===null||f<o.left)&&(o.left=f),(o.right===null||o.right<f)&&(o.right=f+1),(o.bottom===null||o.bottom<c)&&(o.bottom=c));return o.top!==null&&(t=o.right-o.left,r=o.bottom-o.top+1,l=a.getImageData(o.left,o.top,t,r)),{height:r,width:t,data:l}}const _=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function Zr(e){const t=_.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]}}let p;function ea(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,p||(p=document.createElement("a")),p.href=e;const r=E.parse(p.href),a=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!a||r.protocol!==t.protocol?"anonymous":""}function ta(e,t=1){const r=g.settings.RETINA_PREFIX.exec(e);return r?parseFloat(r[1]):t}Object.defineProperty(exports,"isMobile",{enumerable:!0,get:function(){return g.isMobile}}),Object.defineProperty(exports,"EventEmitter",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(exports,"earcut",{enumerable:!0,get:function(){return L.default}}),exports.BaseTextureCache=b,exports.CanvasRenderTarget=Xr,exports.DATA_URI=_,exports.ProgramCache=Yr,exports.TextureCache=v,exports.clearTextureCache=Vr,exports.correctBlendMode=Nr,exports.createIndicesForQuads=qr,exports.decomposeDataUri=Zr,exports.deprecation=Hr,exports.destroyTextureCache=Qr,exports.determineCrossOrigin=ea,exports.getBufferType=C,exports.getResolutionOfUrl=ta,exports.hex2rgb=_r,exports.hex2string=Tr,exports.interleaveTypedArrays=$r,exports.isPow2=Fr,exports.isWebGLSupported=U,exports.log2=jr,exports.nextPow2=Ur,exports.path=x,exports.premultiplyBlendMode=P,exports.premultiplyRgba=Lr,exports.premultiplyTint=Sr,exports.premultiplyTintToRgba=Br,exports.removeItems=Wr,exports.rgb2hex=Rr,exports.sayHello=$,exports.sign=zr,exports.skipHello=I,exports.string2hex=Mr,exports.trimCanvas=Kr,exports.uid=Gr,exports.url=E; | ||
Deprecated since v${e}`),console.warn(a))),D[t]=!0}const Yr={},v=Object.create(null),b=Object.create(null);function Qr(){let e;for(e in v)v[e].destroy();for(e in b)b[e].destroy()}function Vr(){let e;for(e in v)delete v[e];for(e in b)delete b[e]}class Xr{constructor(t,r,a){this.canvas=g.settings.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=a||g.settings.RESOLUTION,this.resize(t,r)}clear(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}resize(t,r){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(r*this.resolution)}destroy(){this.context=null,this.canvas=null}get width(){return this.canvas.width}set width(t){this.canvas.width=Math.round(t)}get height(){return this.canvas.height}set height(t){this.canvas.height=Math.round(t)}}function Kr(e){let t=e.width,r=e.height;const a=e.getContext("2d",{willReadFrequently:!0}),n=a.getImageData(0,0,t,r).data,i=n.length,o={top:null,left:null,right:null,bottom:null};let l=null,s,f,c;for(s=0;s<i;s+=4)n[s+3]!==0&&(f=s/4%t,c=~~(s/4/t),o.top===null&&(o.top=c),(o.left===null||f<o.left)&&(o.left=f),(o.right===null||o.right<f)&&(o.right=f+1),(o.bottom===null||o.bottom<c)&&(o.bottom=c));return o.top!==null&&(t=o.right-o.left,r=o.bottom-o.top+1,l=a.getImageData(o.left,o.top,t,r)),{height:r,width:t,data:l}}const _=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function Zr(e){const t=_.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]}}let p;function ea(e,t=globalThis.location){if(e.startsWith("data:"))return"";t=t||globalThis.location,p||(p=document.createElement("a")),p.href=e;const r=E.parse(p.href),a=!r.port&&t.port===""||r.port===t.port;return r.hostname!==t.hostname||!a||r.protocol!==t.protocol?"anonymous":""}function ta(e,t=1){const r=g.settings.RETINA_PREFIX.exec(e);return r?parseFloat(r[1]):t}Object.defineProperty(exports,"isMobile",{enumerable:!0,get:function(){return g.isMobile}}),Object.defineProperty(exports,"EventEmitter",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(exports,"earcut",{enumerable:!0,get:function(){return L.default}}),exports.BaseTextureCache=b,exports.CanvasRenderTarget=Xr,exports.DATA_URI=_,exports.ProgramCache=Yr,exports.TextureCache=v,exports.clearTextureCache=Vr,exports.correctBlendMode=Nr,exports.createIndicesForQuads=qr,exports.decomposeDataUri=Zr,exports.deprecation=Hr,exports.destroyTextureCache=Qr,exports.determineCrossOrigin=ea,exports.getBufferType=C,exports.getResolutionOfUrl=ta,exports.hex2rgb=_r,exports.hex2string=Tr,exports.interleaveTypedArrays=$r,exports.isPow2=Fr,exports.isWebGLSupported=U,exports.log2=jr,exports.nextPow2=Ur,exports.path=x,exports.premultiplyBlendMode=P,exports.premultiplyRgba=Lr,exports.premultiplyTint=Sr,exports.premultiplyTintToRgba=Br,exports.removeItems=Wr,exports.rgb2hex=Rr,exports.sayHello=$,exports.sign=zr,exports.skipHello=I,exports.string2hex=Mr,exports.trimCanvas=Kr,exports.uid=Gr,exports.url=E; | ||
//# sourceMappingURL=utils.min.js.map |
@@ -218,3 +218,4 @@ import type { BaseTexture } from '@pixi/core'; | ||
* @example | ||
* PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1] | ||
* import { utils } from 'pixi.js'; | ||
* utils.hex2rgb(0xffffff); // returns [1, 1, 1] | ||
* @memberof PIXI.utils | ||
@@ -231,3 +232,4 @@ * @function hex2rgb | ||
* @example | ||
* PIXI.utils.hex2string(0xffffff); // returns "#ffffff" | ||
* import { utils } from 'pixi.js'; | ||
* utils.hex2string(0xffffff); // returns "#ffffff" | ||
* @memberof PIXI.utils | ||
@@ -281,8 +283,2 @@ * @function hex2string | ||
/** | ||
* This file contains redeclared types for Node `url` and `querystring` modules. These modules | ||
* don't provide their own typings but instead are a part of the full Node typings. The purpose of | ||
* this file is to redeclare the required types to avoid having the whole Node types as a | ||
* dependency. | ||
*/ | ||
declare interface ParsedUrlQuery { | ||
@@ -400,3 +396,4 @@ [key: string]: string | string[]; | ||
* @example | ||
* PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff | ||
* import { utils } from 'pixi.js'; | ||
* utils.rgb2hex([1, 1, 1]); // returns 0xffffff, which is 16777215 as an integer | ||
* @memberof PIXI.utils | ||
@@ -443,3 +440,4 @@ * @function rgb2hex | ||
* @example | ||
* PIXI.utils.string2hex("#ffffff"); // returns 0xffffff | ||
* import { utils } from 'pixi.js'; | ||
* utils.string2hex("#ffffff"); // returns 0xffffff, which is 16777215 as an integer | ||
* @memberof PIXI.utils | ||
@@ -446,0 +444,0 @@ * @function string2hex |
{ | ||
"name": "@pixi/utils", | ||
"version": "7.0.0-beta.3", | ||
"version": "7.0.0-beta.4", | ||
"main": "dist/cjs/utils.js", | ||
@@ -39,7 +39,7 @@ "module": "dist/esm/utils.mjs", | ||
"dependencies": { | ||
"@pixi/constants": "7.0.0-beta.3", | ||
"@pixi/settings": "7.0.0-beta.3", | ||
"@pixi/constants": "7.0.0-beta.4", | ||
"@pixi/settings": "7.0.0-beta.4", | ||
"@types/earcut": "^2.1.0", | ||
"earcut": "^2.2.4", | ||
"eventemitter3": "^3.1.0", | ||
"eventemitter3": "^4.0.0", | ||
"url": "^0.11.0" | ||
@@ -50,3 +50,3 @@ }, | ||
}, | ||
"gitHead": "8055ae1c16d4c0f8dabda86cafd8e68c356450e8" | ||
"gitHead": "a4581e4a49d23afc98fcf726765c9d54e51c3c39" | ||
} |
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
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
432021
2874
+ Added@pixi/constants@7.0.0-beta.4(transitive)
+ Added@pixi/settings@7.0.0-beta.4(transitive)
+ Addedeventemitter3@4.0.7(transitive)
- Removed@pixi/constants@7.0.0-beta.3(transitive)
- Removed@pixi/settings@7.0.0-beta.3(transitive)
- Removedeventemitter3@3.1.2(transitive)
Updated@pixi/constants@7.0.0-beta.4
Updated@pixi/settings@7.0.0-beta.4
Updatedeventemitter3@^4.0.0