@pixi/canvas-extract
Advanced tools
Comparing version 6.4.2 to 6.5.0-rc
/*! | ||
* @pixi/canvas-extract - v6.4.2 | ||
* Compiled Thu, 02 Jun 2022 15:39:26 UTC | ||
* @pixi/canvas-extract - v6.5.0-rc | ||
* Compiled Thu, 14 Jul 2022 18:30:46 UTC | ||
* | ||
@@ -56,9 +56,9 @@ * @pixi/canvas-extract is licensed under the MIT License. | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns A Canvas element with the texture rendered on. | ||
*/ | ||
CanvasExtract.prototype.canvas = function (target) { | ||
CanvasExtract.prototype.canvas = function (target, frame) { | ||
var renderer = this.renderer; | ||
var context; | ||
var resolution; | ||
var frame; | ||
var renderTexture; | ||
@@ -76,3 +76,3 @@ if (target) { | ||
resolution = renderTexture.baseTexture._canvasRenderTarget.resolution; | ||
frame = renderTexture.frame; | ||
frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame; | ||
} | ||
@@ -82,10 +82,14 @@ else { | ||
resolution = renderer.resolution; | ||
frame = TEMP_RECT; | ||
frame.width = this.renderer.width; | ||
frame.height = this.renderer.height; | ||
if (!frame) { | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
} | ||
} | ||
var width = Math.floor((frame.width * resolution) + 1e-4); | ||
var height = Math.floor((frame.height * resolution) + 1e-4); | ||
var x = Math.round(frame.x * resolution); | ||
var y = Math.round(frame.y * resolution); | ||
var width = Math.round(frame.width * resolution); | ||
var height = Math.round(frame.height * resolution); | ||
var canvasBuffer = new utils.CanvasRenderTarget(width, height, 1); | ||
var canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height); | ||
var canvasData = context.getImageData(x, y, width, height); | ||
canvasBuffer.context.putImageData(canvasData, 0, 0); | ||
@@ -100,9 +104,9 @@ // send the canvas back.. | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns One-dimensional array containing the pixel data of the entire texture | ||
*/ | ||
CanvasExtract.prototype.pixels = function (target) { | ||
CanvasExtract.prototype.pixels = function (target, frame) { | ||
var renderer = this.renderer; | ||
var context; | ||
var resolution; | ||
var frame; | ||
var renderTexture; | ||
@@ -120,3 +124,3 @@ if (target) { | ||
resolution = renderTexture.baseTexture._canvasRenderTarget.resolution; | ||
frame = renderTexture.frame; | ||
frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame; | ||
} | ||
@@ -126,10 +130,12 @@ else { | ||
resolution = renderer.resolution; | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
if (!frame) { | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
} | ||
} | ||
var x = frame.x * resolution; | ||
var y = frame.y * resolution; | ||
var width = frame.width * resolution; | ||
var height = frame.height * resolution; | ||
var x = Math.round(frame.x * resolution); | ||
var y = Math.round(frame.y * resolution); | ||
var width = Math.round(frame.width * resolution); | ||
var height = Math.round(frame.height * resolution); | ||
return context.getImageData(x, y, width, height).data; | ||
@@ -141,2 +147,7 @@ }; | ||
}; | ||
/** @ignore */ | ||
CanvasExtract.extension = { | ||
name: 'extract', | ||
type: core.ExtensionType.CanvasRendererPlugin, | ||
}; | ||
return CanvasExtract; | ||
@@ -143,0 +154,0 @@ }()); |
/*! | ||
* @pixi/canvas-extract - v6.4.2 | ||
* Compiled Thu, 02 Jun 2022 15:39:26 UTC | ||
* @pixi/canvas-extract - v6.5.0-rc | ||
* Compiled Thu, 14 Jul 2022 18:30:46 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/canvas-extract is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_canvas_extract=function(e,t,r,a){"use strict";var n=new PIXI.Rectangle,i=function(){function e(e){this.renderer=e}return e.prototype.image=function(e,t,r){var a=new Image;return a.src=this.base64(e,t,r),a},e.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},e.prototype.canvas=function(e){var a,i,o,s,u=this.renderer;e&&(s=e instanceof t.RenderTexture?e:u.generateTexture(e)),s?(a=s.baseTexture._canvasRenderTarget.context,i=s.baseTexture._canvasRenderTarget.resolution,o=s.frame):(a=u.rootContext,i=u.resolution,(o=n).width=this.renderer.width,o.height=this.renderer.height);var h=Math.floor(o.width*i+1e-4),c=Math.floor(o.height*i+1e-4),d=new r.CanvasRenderTarget(h,c,1),g=a.getImageData(o.x*i,o.y*i,h,c);return d.context.putImageData(g,0,0),d.canvas},e.prototype.pixels=function(e){var r,a,i,o,s=this.renderer;e&&(o=e instanceof t.RenderTexture?e:s.generateTexture(e)),o?(r=o.baseTexture._canvasRenderTarget.context,a=o.baseTexture._canvasRenderTarget.resolution,i=o.frame):(r=s.rootContext,a=s.resolution,(i=n).width=s.width,i.height=s.height);var u=i.x*a,h=i.y*a,c=i.width*a,d=i.height*a;return r.getImageData(u,h,c,d).data},e.prototype.destroy=function(){this.renderer=null},e}();return e.CanvasExtract=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_canvas_extract); | ||
this.PIXI=this.PIXI||{};var _pixi_canvas_extract=function(e,t,r,n){"use strict";var a=new PIXI.Rectangle,o=function(){function e(e){this.renderer=e}return e.prototype.image=function(e,t,r){var n=new Image;return n.src=this.base64(e,t,r),n},e.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},e.prototype.canvas=function(e,n){var o,i,s,u=this.renderer;e&&(s=e instanceof t.RenderTexture?e:u.generateTexture(e)),s?(o=s.baseTexture._canvasRenderTarget.context,i=s.baseTexture._canvasRenderTarget.resolution,n=null!=n?n:s.frame):(o=u.rootContext,i=u.resolution,n||((n=a).width=u.width,n.height=u.height));var h=Math.round(n.x*i),c=Math.round(n.y*i),d=Math.round(n.width*i),x=Math.round(n.height*i),g=new r.CanvasRenderTarget(d,x,1),v=o.getImageData(h,c,d,x);return g.context.putImageData(v,0,0),g.canvas},e.prototype.pixels=function(e,r){var n,o,i,s=this.renderer;e&&(i=e instanceof t.RenderTexture?e:s.generateTexture(e)),i?(n=i.baseTexture._canvasRenderTarget.context,o=i.baseTexture._canvasRenderTarget.resolution,r=null!=r?r:i.frame):(n=s.rootContext,o=s.resolution,r||((r=a).width=s.width,r.height=s.height));var u=Math.round(r.x*o),h=Math.round(r.y*o),c=Math.round(r.width*o),d=Math.round(r.height*o);return n.getImageData(u,h,c,d).data},e.prototype.destroy=function(){this.renderer=null},e.extension={name:"extract",type:t.ExtensionType.CanvasRendererPlugin},e}();return e.CanvasExtract=o,Object.defineProperty(e,"__esModule",{value:!0}),e}({},PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_canvas_extract); | ||
//# sourceMappingURL=canvas-extract.min.js.map |
/*! | ||
* @pixi/canvas-extract - v6.4.2 | ||
* Compiled Thu, 02 Jun 2022 15:39:26 UTC | ||
* @pixi/canvas-extract - v6.5.0-rc | ||
* Compiled Thu, 14 Jul 2022 18:30:46 UTC | ||
* | ||
@@ -60,9 +60,9 @@ * @pixi/canvas-extract is licensed under the MIT License. | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns A Canvas element with the texture rendered on. | ||
*/ | ||
CanvasExtract.prototype.canvas = function (target) { | ||
CanvasExtract.prototype.canvas = function (target, frame) { | ||
var renderer = this.renderer; | ||
var context; | ||
var resolution; | ||
var frame; | ||
var renderTexture; | ||
@@ -80,3 +80,3 @@ if (target) { | ||
resolution = renderTexture.baseTexture._canvasRenderTarget.resolution; | ||
frame = renderTexture.frame; | ||
frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame; | ||
} | ||
@@ -86,10 +86,14 @@ else { | ||
resolution = renderer.resolution; | ||
frame = TEMP_RECT; | ||
frame.width = this.renderer.width; | ||
frame.height = this.renderer.height; | ||
if (!frame) { | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
} | ||
} | ||
var width = Math.floor((frame.width * resolution) + 1e-4); | ||
var height = Math.floor((frame.height * resolution) + 1e-4); | ||
var x = Math.round(frame.x * resolution); | ||
var y = Math.round(frame.y * resolution); | ||
var width = Math.round(frame.width * resolution); | ||
var height = Math.round(frame.height * resolution); | ||
var canvasBuffer = new utils.CanvasRenderTarget(width, height, 1); | ||
var canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height); | ||
var canvasData = context.getImageData(x, y, width, height); | ||
canvasBuffer.context.putImageData(canvasData, 0, 0); | ||
@@ -104,9 +108,9 @@ // send the canvas back.. | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns One-dimensional array containing the pixel data of the entire texture | ||
*/ | ||
CanvasExtract.prototype.pixels = function (target) { | ||
CanvasExtract.prototype.pixels = function (target, frame) { | ||
var renderer = this.renderer; | ||
var context; | ||
var resolution; | ||
var frame; | ||
var renderTexture; | ||
@@ -124,3 +128,3 @@ if (target) { | ||
resolution = renderTexture.baseTexture._canvasRenderTarget.resolution; | ||
frame = renderTexture.frame; | ||
frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame; | ||
} | ||
@@ -130,10 +134,12 @@ else { | ||
resolution = renderer.resolution; | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
if (!frame) { | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
} | ||
} | ||
var x = frame.x * resolution; | ||
var y = frame.y * resolution; | ||
var width = frame.width * resolution; | ||
var height = frame.height * resolution; | ||
var x = Math.round(frame.x * resolution); | ||
var y = Math.round(frame.y * resolution); | ||
var width = Math.round(frame.width * resolution); | ||
var height = Math.round(frame.height * resolution); | ||
return context.getImageData(x, y, width, height).data; | ||
@@ -145,2 +151,7 @@ }; | ||
}; | ||
/** @ignore */ | ||
CanvasExtract.extension = { | ||
name: 'extract', | ||
type: core.ExtensionType.CanvasRendererPlugin, | ||
}; | ||
return CanvasExtract; | ||
@@ -147,0 +158,0 @@ }()); |
/*! | ||
* @pixi/canvas-extract - v6.4.2 | ||
* Compiled Thu, 02 Jun 2022 15:39:26 UTC | ||
* @pixi/canvas-extract - v6.5.0-rc | ||
* Compiled Thu, 14 Jul 2022 18:30:46 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/canvas-extract is licensed under the MIT License. | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pixi/core"),t=require("@pixi/utils"),r=new(require("@pixi/math").Rectangle),a=function(){function a(e){this.renderer=e}return a.prototype.image=function(e,t,r){var a=new Image;return a.src=this.base64(e,t,r),a},a.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},a.prototype.canvas=function(a){var n,i,o,s,u=this.renderer;a&&(s=a instanceof e.RenderTexture?a:u.generateTexture(a)),s?(n=s.baseTexture._canvasRenderTarget.context,i=s.baseTexture._canvasRenderTarget.resolution,o=s.frame):(n=u.rootContext,i=u.resolution,(o=r).width=this.renderer.width,o.height=this.renderer.height);var h=Math.floor(o.width*i+1e-4),c=Math.floor(o.height*i+1e-4),d=new t.CanvasRenderTarget(h,c,1),x=n.getImageData(o.x*i,o.y*i,h,c);return d.context.putImageData(x,0,0),d.canvas},a.prototype.pixels=function(t){var a,n,i,o,s=this.renderer;t&&(o=t instanceof e.RenderTexture?t:s.generateTexture(t)),o?(a=o.baseTexture._canvasRenderTarget.context,n=o.baseTexture._canvasRenderTarget.resolution,i=o.frame):(a=s.rootContext,n=s.resolution,(i=r).width=s.width,i.height=s.height);var u=i.x*n,h=i.y*n,c=i.width*n,d=i.height*n;return a.getImageData(u,h,c,d).data},a.prototype.destroy=function(){this.renderer=null},a}();exports.CanvasExtract=a; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pixi/core"),t=require("@pixi/utils"),r=new(require("@pixi/math").Rectangle),n=function(){function n(e){this.renderer=e}return n.prototype.image=function(e,t,r){var n=new Image;return n.src=this.base64(e,t,r),n},n.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},n.prototype.canvas=function(n,a){var o,i,u,s=this.renderer;n&&(u=n instanceof e.RenderTexture?n:s.generateTexture(n)),u?(o=u.baseTexture._canvasRenderTarget.context,i=u.baseTexture._canvasRenderTarget.resolution,a=null!=a?a:u.frame):(o=s.rootContext,i=s.resolution,a||((a=r).width=s.width,a.height=s.height));var h=Math.round(a.x*i),d=Math.round(a.y*i),c=Math.round(a.width*i),x=Math.round(a.height*i),g=new t.CanvasRenderTarget(c,x,1),p=o.getImageData(h,d,c,x);return g.context.putImageData(p,0,0),g.canvas},n.prototype.pixels=function(t,n){var a,o,i,u=this.renderer;t&&(i=t instanceof e.RenderTexture?t:u.generateTexture(t)),i?(a=i.baseTexture._canvasRenderTarget.context,o=i.baseTexture._canvasRenderTarget.resolution,n=null!=n?n:i.frame):(a=u.rootContext,o=u.resolution,n||((n=r).width=u.width,n.height=u.height));var s=Math.round(n.x*o),h=Math.round(n.y*o),d=Math.round(n.width*o),c=Math.round(n.height*o);return a.getImageData(s,h,d,c).data},n.prototype.destroy=function(){this.renderer=null},n.extension={name:"extract",type:e.ExtensionType.CanvasRendererPlugin},n}();exports.CanvasExtract=n; | ||
//# sourceMappingURL=canvas-extract.min.js.map |
/*! | ||
* @pixi/canvas-extract - v6.4.2 | ||
* Compiled Thu, 02 Jun 2022 15:39:26 UTC | ||
* @pixi/canvas-extract - v6.5.0-rc | ||
* Compiled Thu, 14 Jul 2022 18:30:46 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/canvas-extract is licensed under the MIT License. | ||
*/ | ||
import { RenderTexture } from '@pixi/core'; | ||
import { ExtensionType, RenderTexture } from '@pixi/core'; | ||
import { CanvasRenderTarget } from '@pixi/utils'; | ||
@@ -57,9 +57,9 @@ import { Rectangle } from '@pixi/math'; | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns A Canvas element with the texture rendered on. | ||
*/ | ||
CanvasExtract.prototype.canvas = function (target) { | ||
CanvasExtract.prototype.canvas = function (target, frame) { | ||
var renderer = this.renderer; | ||
var context; | ||
var resolution; | ||
var frame; | ||
var renderTexture; | ||
@@ -77,3 +77,3 @@ if (target) { | ||
resolution = renderTexture.baseTexture._canvasRenderTarget.resolution; | ||
frame = renderTexture.frame; | ||
frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame; | ||
} | ||
@@ -83,10 +83,14 @@ else { | ||
resolution = renderer.resolution; | ||
frame = TEMP_RECT; | ||
frame.width = this.renderer.width; | ||
frame.height = this.renderer.height; | ||
if (!frame) { | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
} | ||
} | ||
var width = Math.floor((frame.width * resolution) + 1e-4); | ||
var height = Math.floor((frame.height * resolution) + 1e-4); | ||
var x = Math.round(frame.x * resolution); | ||
var y = Math.round(frame.y * resolution); | ||
var width = Math.round(frame.width * resolution); | ||
var height = Math.round(frame.height * resolution); | ||
var canvasBuffer = new CanvasRenderTarget(width, height, 1); | ||
var canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height); | ||
var canvasData = context.getImageData(x, y, width, height); | ||
canvasBuffer.context.putImageData(canvasData, 0, 0); | ||
@@ -101,9 +105,9 @@ // send the canvas back.. | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns One-dimensional array containing the pixel data of the entire texture | ||
*/ | ||
CanvasExtract.prototype.pixels = function (target) { | ||
CanvasExtract.prototype.pixels = function (target, frame) { | ||
var renderer = this.renderer; | ||
var context; | ||
var resolution; | ||
var frame; | ||
var renderTexture; | ||
@@ -121,3 +125,3 @@ if (target) { | ||
resolution = renderTexture.baseTexture._canvasRenderTarget.resolution; | ||
frame = renderTexture.frame; | ||
frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame; | ||
} | ||
@@ -127,10 +131,12 @@ else { | ||
resolution = renderer.resolution; | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
if (!frame) { | ||
frame = TEMP_RECT; | ||
frame.width = renderer.width; | ||
frame.height = renderer.height; | ||
} | ||
} | ||
var x = frame.x * resolution; | ||
var y = frame.y * resolution; | ||
var width = frame.width * resolution; | ||
var height = frame.height * resolution; | ||
var x = Math.round(frame.x * resolution); | ||
var y = Math.round(frame.y * resolution); | ||
var width = Math.round(frame.width * resolution); | ||
var height = Math.round(frame.height * resolution); | ||
return context.getImageData(x, y, width, height).data; | ||
@@ -142,2 +148,7 @@ }; | ||
}; | ||
/** @ignore */ | ||
CanvasExtract.extension = { | ||
name: 'extract', | ||
type: ExtensionType.CanvasRendererPlugin, | ||
}; | ||
return CanvasExtract; | ||
@@ -144,0 +155,0 @@ }()); |
/*! | ||
* @pixi/canvas-extract - v6.4.2 | ||
* Compiled Thu, 02 Jun 2022 15:39:26 UTC | ||
* @pixi/canvas-extract - v6.5.0-rc | ||
* Compiled Thu, 14 Jul 2022 18:30:46 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/canvas-extract is licensed under the MIT License. | ||
*/ | ||
import{RenderTexture as e}from"@pixi/core";import{CanvasRenderTarget as t}from"@pixi/utils";import{Rectangle as r}from"@pixi/math";var n=new r,a=function(){function r(e){this.renderer=e}return r.prototype.image=function(e,t,r){var n=new Image;return n.src=this.base64(e,t,r),n},r.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},r.prototype.canvas=function(r){var a,o,i,s,h=this.renderer;r&&(s=r instanceof e?r:h.generateTexture(r)),s?(a=s.baseTexture._canvasRenderTarget.context,o=s.baseTexture._canvasRenderTarget.resolution,i=s.frame):(a=h.rootContext,o=h.resolution,(i=n).width=this.renderer.width,i.height=this.renderer.height);var u=Math.floor(i.width*o+1e-4),c=Math.floor(i.height*o+1e-4),g=new t(u,c,1),p=a.getImageData(i.x*o,i.y*o,u,c);return g.context.putImageData(p,0,0),g.canvas},r.prototype.pixels=function(t){var r,a,o,i,s=this.renderer;t&&(i=t instanceof e?t:s.generateTexture(t)),i?(r=i.baseTexture._canvasRenderTarget.context,a=i.baseTexture._canvasRenderTarget.resolution,o=i.frame):(r=s.rootContext,a=s.resolution,(o=n).width=s.width,o.height=s.height);var h=o.x*a,u=o.y*a,c=o.width*a,g=o.height*a;return r.getImageData(h,u,c,g).data},r.prototype.destroy=function(){this.renderer=null},r}();export{a as CanvasExtract}; | ||
import{ExtensionType as e,RenderTexture as t}from"@pixi/core";import{CanvasRenderTarget as r}from"@pixi/utils";import{Rectangle as n}from"@pixi/math";var a=new n,o=function(){function n(e){this.renderer=e}return n.prototype.image=function(e,t,r){var n=new Image;return n.src=this.base64(e,t,r),n},n.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},n.prototype.canvas=function(e,n){var o,i,u,h=this.renderer;e&&(u=e instanceof t?e:h.generateTexture(e)),u?(o=u.baseTexture._canvasRenderTarget.context,i=u.baseTexture._canvasRenderTarget.resolution,n=null!=n?n:u.frame):(o=h.rootContext,i=h.resolution,n||((n=a).width=h.width,n.height=h.height));var s=Math.round(n.x*i),d=Math.round(n.y*i),c=Math.round(n.width*i),g=Math.round(n.height*i),p=new r(c,g,1),x=o.getImageData(s,d,c,g);return p.context.putImageData(x,0,0),p.canvas},n.prototype.pixels=function(e,r){var n,o,i,u=this.renderer;e&&(i=e instanceof t?e:u.generateTexture(e)),i?(n=i.baseTexture._canvasRenderTarget.context,o=i.baseTexture._canvasRenderTarget.resolution,r=null!=r?r:i.frame):(n=u.rootContext,o=u.resolution,r||((r=a).width=u.width,r.height=u.height));var h=Math.round(r.x*o),s=Math.round(r.y*o),d=Math.round(r.width*o),c=Math.round(r.height*o);return n.getImageData(h,s,d,c).data},n.prototype.destroy=function(){this.renderer=null},n.extension={name:"extract",type:e.CanvasRendererPlugin},n}();export{o as CanvasExtract}; | ||
//# sourceMappingURL=canvas-extract.min.js.map |
@@ -1,3 +0,5 @@ | ||
import { CanvasRenderer } from '@pixi/canvas-renderer'; | ||
import type { CanvasRenderer } from '@pixi/canvas-renderer'; | ||
import type { DisplayObject } from '@pixi/display'; | ||
import type { ExtensionMetadata } from '@pixi/core'; | ||
import { Rectangle } from '@pixi/math'; | ||
import { RenderTexture } from '@pixi/core'; | ||
@@ -13,2 +15,4 @@ | ||
export declare class CanvasExtract { | ||
/** @ignore */ | ||
static extension: ExtensionMetadata; | ||
/** A reference to the current renderer */ | ||
@@ -43,5 +47,6 @@ renderer: CanvasRenderer; | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns A Canvas element with the texture rendered on. | ||
*/ | ||
canvas(target?: DisplayObject | RenderTexture): HTMLCanvasElement; | ||
canvas(target?: DisplayObject | RenderTexture, frame?: Rectangle): HTMLCanvasElement; | ||
/** | ||
@@ -52,5 +57,6 @@ * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA | ||
* to convert. If left empty will use the main renderer | ||
* @param frame - The frame the extraction is restricted to. | ||
* @returns One-dimensional array containing the pixel data of the entire texture | ||
*/ | ||
pixels(target?: DisplayObject | RenderTexture): Uint8ClampedArray; | ||
pixels(target?: DisplayObject | RenderTexture, frame?: Rectangle): Uint8ClampedArray; | ||
/** Destroys the extract */ | ||
@@ -57,0 +63,0 @@ destroy(): void; |
{ | ||
"name": "@pixi/canvas-extract", | ||
"version": "6.4.2", | ||
"version": "6.5.0-rc", | ||
"main": "dist/cjs/canvas-extract.js", | ||
@@ -41,9 +41,9 @@ "module": "dist/esm/canvas-extract.js", | ||
"peerDependencies": { | ||
"@pixi/canvas-renderer": "6.4.2", | ||
"@pixi/core": "6.4.2", | ||
"@pixi/display": "6.4.2", | ||
"@pixi/math": "6.4.2", | ||
"@pixi/utils": "6.4.2" | ||
"@pixi/canvas-renderer": "6.5.0-rc", | ||
"@pixi/core": "6.5.0-rc", | ||
"@pixi/display": "6.5.0-rc", | ||
"@pixi/math": "6.5.0-rc", | ||
"@pixi/utils": "6.5.0-rc" | ||
}, | ||
"gitHead": "a87bb87036d5fb9119ee92fd9c3da23b5bb9424b" | ||
"gitHead": "16005f83e7a6d87831ce84f8a6d460606a331ef6" | ||
} |
@@ -12,6 +12,6 @@ # @pixi/canvas-extract | ||
```js | ||
import { extensions } from '@pixi/core'; | ||
import { CanvasExtract } from '@pixi/canvas-extract'; | ||
import { CanvasRenderer } from '@pixi/canvas-renderer'; | ||
CanvasRenderer.registerPlugin('extract', CanvasExtract); | ||
extensions.add(CanvasExtract); | ||
``` |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
85728
553
2