/** * @import { Color } from '../../core/math/color.js' */ /** * The base class for the exporters, implementing shared functionality. * * @category Exporter * @ignore */ export class CoreExporter { /** * Converts a texture to a canvas. * * @param {Texture} texture - The source texture to be converted. * @param {object} options - Object for passing optional arguments. * @param {Color} [options.color] - The tint color to modify the texture with. * @param {number} [options.maxTextureSize] - Maximum texture size. Texture is resized if over the size. * @returns {Promise|Promise} - The canvas element containing the image. * * @ignore */ textureToCanvas(texture: Texture, options?: { color?: Color; maxTextureSize?: number; }): Promise | Promise; /** * Reads the pixels of a texture by rendering it to a render target. The texture is sampled * into the target, so a target of a linear format reads the values a shader samples, decoded * from sRGB, and not premultiplied by alpha as the pixels of a canvas are. * * @param {Texture} texture - The texture to read. * @param {number} width - The width of the render target. * @param {number} height - The height of the render target. * @param {number} format - The pixel format of the render target. * @returns {Promise} The pixels. * @ignore */ readTexturePixels(texture: Texture, width: number, height: number, format: number): Promise; /** * Copies RGBA8 pixels to a canvas. * * @param {Uint8ClampedArray} pixels - The pixels. * @param {number} width - The width of the pixels. * @param {number} height - The height of the pixels. * @returns {HTMLCanvasElement|undefined} The canvas, or undefined when no 2D context is * available. * @ignore */ pixelsToCanvas(pixels: Uint8ClampedArray, width: number, height: number): HTMLCanvasElement | undefined; calcTextureSize(width: any, height: any, maxTextureSize: any): { width: any; height: any; }; } import { Texture } from '../../platform/graphics/texture.js'; import type { Color } from '../../core/math/color.js';