UNPKG

lazy-widgets

Version:

Typescript retained mode GUI for the HTML canvas API

34 lines (33 loc) 1.28 kB
import { AsyncMedia, type FastCanvasImageSource } from './AsyncMedia.js'; import { BackingMediaEventType } from './BackingMediaEventType.js'; import { type BackingMediaSource } from './BackingMediaSource.js'; import { type Listener } from './Notifier.js'; export interface EffectMediaOptions { tint?: number; resolution?: number; } export declare class EffectMedia extends AsyncMedia { readonly backingMedia: BackingMediaSource; private _currentFrame; private ctx; private waiting; private dirty; readonly tint: number; readonly resolution: number; private readonly wrapper; private lastPHashBeforeRemove; private _presentationHash; constructor(backingMedia: BackingMediaSource, options?: EffectMediaOptions); private readonly onWrapperEvent; addEventListener(listener: Listener<BackingMediaEventType>): void; removeEventListener(listener: Listener<BackingMediaEventType>): boolean; static fromURL(url: string, options?: EffectMediaOptions): EffectMedia; get width(): number; get height(): number; private getScratchCtx; private setCurrentFrame; private handleBitmapPromise; private evaluateEffect; get currentFrame(): FastCanvasImageSource | null; get presentationHash(): number; }