UNPKG

tav-media

Version:

Cross platform media editing framework

66 lines (65 loc) 1.71 kB
import { tav } from '../tav'; import { AlphaType, ColorType } from '../types/types'; /** * A surface is used to render the video frames. * @category Engine */ export declare class TAVSurface { private ref; /** * Make a surface from a HTML canvas. * @param canvasOrSelector A canvas element or a selector of a canvas element. * @returns A surface. */ static FromHtmlCanvas(canvasOrSelector: HTMLCanvasElement | string): TAVSurface; private static FromWebGLContext; private offscreenCanvas; /** * @ignore */ webGLContextId: number; /** * @ignore */ prepare?: () => void; /** * @ignore */ present?: () => void; private constructor(); /** * Returns the width in pixels of the surface. */ width(): number; /** * Returns the height in pixels of the surface. */ height(): number; /** * Update the size of surface, and reset the internal surface. */ updateSize(): void; /** * Erases all pixels of this surface with transparent color. Returns true if the content has * changed. */ clearAll(): void; /** * Free the cache created by the surface immediately. Can be called to reduce memory pressure. */ freeCache(): void; /** * Copies pixels from current TAVSurface to dstPixels with specified color type, alpha type and * row bytes. */ readPixels(colorType?: ColorType, alphaType?: AlphaType): Uint8Array; /** * Build native object * @returns The native TAVSurface object. */ build(): Promise<tav.TAVSurface>; /** * release native object */ release(): void; }