UNPKG

warpvas

Version:

This JavaScript library enables fast and efficient image distortion transformations using Canvas 2D.

23 lines (22 loc) 907 B
import type { Warpvas } from '../warpvas.class'; /** * Create warped canvas using WebGL in Web Worker * * Executes canvas rendering in background thread via Web Worker and WebGL to prevent main thread blocking and improve performance. * * @param warpvas - Warpvas instance containing deformation grid and rendering options * @param imageData - Source image data * @param destination - Target render canvas (creates new canvas if null) * @param options - Rendering configuration options * * @returns {Promise<HTMLCanvasElement>} Rendered canvas object */ declare const createWorkerWarpedCanvasWebGL: (warpvas: Warpvas, imageData: ImageData, destination: HTMLCanvasElement | null, options: { x: number; y: number; width: number; height: number; sourceScale?: number; destinationScale?: number; }) => Promise<HTMLCanvasElement>; export default createWorkerWarpedCanvasWebGL;