export default CanvasRenderTarget; /** * A 2D canvas render target for offscreen texture generation. * Used by Text, Gradient, Light2d and Particle systems to render into * a canvas that is then uploaded as a WebGL texture. * @augments RenderTarget * @category Rendering */ declare class CanvasRenderTarget extends RenderTarget { /** * @param {number} width - the desired width of the canvas * @param {number} height - the desired height of the canvas * @param {object} attributes - The attributes to create both the canvas and context * @param {string} [attributes.context="2d"] - the context type to be created ("2d", "webgl") * @param {boolean} [attributes.preferWebGL1=false] - set to true for force using WebGL1 instead of WebGL2 (if supported) * @param {boolean} [attributes.transparent=false] - specify if the canvas contains an alpha channel * @param {boolean} [attributes.offscreenCanvas=false] - will create an offscreenCanvas if true instead of a standard canvas * @param {boolean} [attributes.willReadFrequently=false] - Indicates whether or not a lot of read-back operations are planned * @param {boolean} [attributes.antiAlias=false] - Whether to enable anti-aliasing, use false (default) for a pixelated effect. */ constructor(width: number, height: number, attributes?: { context?: string | undefined; preferWebGL1?: boolean | undefined; transparent?: boolean | undefined; offscreenCanvas?: boolean | undefined; willReadFrequently?: boolean | undefined; antiAlias?: boolean | undefined; }); attributes: { offscreenCanvas: boolean; willReadFrequently: boolean; antiAlias: boolean; context: string; transparent: boolean; premultipliedAlpha: boolean; stencil: boolean; blendMode: string; failIfMajorPerformanceCaveat: boolean; preferWebGL1: boolean; powerPreference: string; } & { context?: string | undefined; preferWebGL1?: boolean | undefined; transparent?: boolean | undefined; offscreenCanvas?: boolean | undefined; willReadFrequently?: boolean | undefined; antiAlias?: boolean | undefined; }; canvas: any; context: any; WebGLVersion: any; /** * @ignore */ onResetEvent(width: any, height: any): void; /** * enable/disable image smoothing (scaling interpolation) * @param {boolean} [enable=false] - whether to enable or not image smoothing (scaling interpolation) */ setAntiAlias(enable?: boolean): void; /** * Returns an ImageData object representing the underlying pixel data for a specified portion of this canvas texture. * (Note: when using getImageData(), it is highly recommended to use the `willReadFrequently` attribute when creatimg the corresponding canvas texture) * @param {number} x - The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted * @param {number} y - The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted * @param {number} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left * @param {number} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up * @returns {ImageData} The ImageData extracted from this CanvasRenderTarget. */ getImageData(x: number, y: number, width: number, height: number): ImageData; /** * invalidate the current CanvasRenderTarget, and force a reupload of the corresponding texture * (call this if you modify the canvas content between two draw calls) * @param {CanvasRenderer|WebGLRenderer} renderer - the renderer to which this canvas texture is attached */ invalidate(renderer: CanvasRenderer | WebGLRenderer): void; glTextureUnit: any; /** * Destroy this canvas render target and release associated GPU resources. * @param {CanvasRenderer|WebGLRenderer} [renderer] - the renderer to clean up WebGL resources from * @ignore */ destroy(renderer?: CanvasRenderer | WebGLRenderer): void; } import RenderTarget from "./rendertarget.ts"; import type CanvasRenderer from "./../canvas/canvas_renderer.js"; import type WebGLRenderer from "./../webgl/webgl_renderer.js"; //# sourceMappingURL=canvasrendertarget.d.ts.map