import type { InjectedMeshConstructor, InjectedMeshGeometryConstructor, InjectedShaderFactory } from "#renderers/injected-pixi"; import type { AnnotationStyleContext, BufferedDetectionTimeline, Detection, RegionAnnotationRenderer } from "supervision-js-core"; import type { AlphaMask as PixiAlphaMask, BlurFilter as PixiBlurFilter, Container as PixiContainer, Filter as PixiFilter, Graphics as PixiGraphics, ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Rectangle as PixiRectangle, Shader as PixiShader, Sprite as PixiSprite, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js"; import type { GifSource as PixiGifSource, GifSprite as PixiGifSprite } from "pixi.js/gif"; import type { PixiActiveRegionMaskCoverage } from "./pixi-mask-layer"; import { type PixiViewportBounds } from "./pixi-mask-viewport"; type RegionAsset = PixiTexture | PixiGifSource; interface RegionAssetLoader { load(src: string): Promise; unload(src: string): Promise; } export interface PixiRegionLayerState { readonly activeDetectionIndexes: readonly number[]; } export interface PixiRegionLayer { createContainer(): PixiContainer; drawFrame(mediaTime: number, viewportScale?: number): PixiRegionLayerState; /** Whether the last drawn frame shows an asset that animates on its own. */ hasAnimatedDisplay(): boolean; releaseMaskTexture(texture: PixiTexture): void; setAntialiasResolution(resolution: number): void; setRenderers(renderers: readonly RegionAnnotationRenderer[]): void; syncViewportBounds(): void; translateDetection(id: string | number, x: number, y: number): boolean; destroy(): void; } type RegionMesh = PixiMesh; /** Browser implementation for asset- and media-backed region descriptors. */ export declare function createPixiRegionLayer(options: { readonly AlphaMask: new (options: { mask: PixiContainer; }) => PixiAlphaMask; readonly BlurFilter?: new (options: { kernelSize?: number; quality?: number; repeatEdgePixels?: boolean; strength?: number; }) => PixiBlurFilter; readonly defaultFilterVert?: string; readonly Assets: RegionAssetLoader; readonly Container: new () => PixiContainer; readonly GifSprite: new (options: { readonly autoPlay?: boolean; readonly loop?: boolean; readonly source: PixiGifSource; }) => PixiGifSprite; readonly Filter?: typeof PixiFilter; readonly Graphics: new () => PixiGraphics; readonly ImageSource: new (options: { autoGenerateMipmaps?: boolean; dynamic: boolean; height: number; resource: HTMLCanvasElement; scaleMode?: "linear" | "nearest"; width: number; }) => PixiImageSource; readonly Mesh: InjectedMeshConstructor; readonly MeshGeometry: InjectedMeshGeometryConstructor; readonly Rectangle: new (x?: number, y?: number, width?: number, height?: number) => PixiRectangle; readonly Sprite: new (options: { texture: PixiTexture; }) => PixiSprite; readonly Shader: InjectedShaderFactory; readonly Texture: new (options: { readonly dynamic?: boolean; readonly frame?: PixiRectangle; readonly source: PixiTexture["source"]; }) => PixiTexture; readonly UniformGroup: new (uniforms: Record"; value: Float32Array; }>) => PixiUniformGroup; readonly detectionTimeline: BufferedDetectionTimeline; readonly getAnnotationAntialiasing?: () => boolean; readonly getAntialiasResolution?: () => number; readonly getViewportBounds?: () => PixiViewportBounds | undefined; readonly getActiveRegionMaskCoverage: (detectionFrameTime: number | null) => PixiActiveRegionMaskCoverage | null; readonly getMediaTexture: () => PixiTexture | undefined; readonly onInvalidate?: () => void; readonly onAssetError?: (options: { readonly error: unknown; readonly rendererId: string; readonly src: string; }) => void; readonly regionRenderers: readonly RegionAnnotationRenderer[]; readonly resolveContextState?: (detection: Detection) => Partial; }): PixiRegionLayer; export {}; //# sourceMappingURL=pixi-region-layer.d.ts.map