pixi.js
Version:
<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">
15 lines (14 loc) • 773 B
TypeScript
import type { CanvasAndContext } from '../../../rendering/renderers/shared/texture/CanvasPool';
/**
* This function converts an image to a canvas, and returns the canvas.
* It is used to convert images to canvases to work around a CORS issue where WebGPU cannot
* upload an SVGImage to a texture.
*
* It uses the CanvasPool to get an optimal canvas and context, and then draws the image onto it.
* Remember to return this canvas is immediately to the CanvasPool for reuse when you are done with it.
* (eg upload it to the GPU!)
* @param image - The image to convert to a canvas.
* @param resolution - The resolution of the canvas.
* @internal
*/
export declare function getTemporaryCanvasFromImage(image: HTMLImageElement, resolution: number): CanvasAndContext;