import { type PixiRectangleConstructor, type PixiViewportBounds } from "./pixi-mask-viewport"; import type { PreparedIdMaskFrame } from "#render-preparation/mask-frame-artifact"; import type { FocusStyle } from "supervision-js-core"; import type { HeatmapAnnotationRenderer, Rect } from "supervision-js-core"; import type { DetectionPickResult } from "supervision-js-core"; import type { AlphaMask as PixiAlphaMask, Container as PixiContainer, ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Texture as PixiTexture, Rectangle as PixiRectangle, UniformGroup as PixiUniformGroup } from "pixi.js"; type PixiFocusMesh = PixiMesh; type GraphicsConstructor = new () => PixiFocusGraphics; type ContainerConstructor = new () => PixiContainer; type ImageSourceConstructor = new (options: { autoGenerateMipmaps?: boolean; dynamic: boolean; height: number; resource: HTMLCanvasElement; scaleMode?: "linear" | "nearest"; width: number; }) => PixiImageSource; type MeshConstructor = new (options: { geometry: PixiMeshGeometry; shader: PixiShader; }) => PixiFocusMesh; type MeshGeometryConstructor = new (options: { indices: Uint32Array; positions: Float32Array; shrinkBuffersToFit: boolean; topology: "triangle-list"; uvs: Float32Array; }) => PixiMeshGeometry; type ShaderFactory = { from(options: { gl: { fragment: string; vertex: string; }; gpu: { fragment: { entryPoint: string; source: string; }; vertex: { entryPoint: string; source: string; }; }; resources: Record; }): PixiShader; }; type UniformGroupConstructor = new (uniforms: Record"; value: Float32Array; }>) => PixiUniformGroup; type PixiFocusGraphics = { boundsArea?: PixiRectangle; visible: boolean; clear(): PixiFocusGraphics; cut(): unknown; fill(options: { readonly alpha: number; readonly color: number; }): unknown; setMask?: PixiContainer["setMask"]; rect(x: number, y: number, width: number, height: number): PixiFocusGraphics; roundRect(x: number, y: number, width: number, height: number, radius: number): PixiFocusGraphics; poly?(points: number[], close?: boolean): PixiFocusGraphics; }; export interface PixiFocusMaskArtifact { readonly frame: PreparedIdMaskFrame; readonly texture: PixiTexture; } export interface PixiFocusHeatmapArtifact { readonly detectionIndex: number; readonly bounds: Rect; readonly texture: PixiTexture; } export interface PixiFocusLayerFrameContext { readonly frame: FocusDrawFrame | undefined; /** * The detection frame the mask raster on screen belongs to, when the mask * layer is holding that raster over the frame being drawn. A cutout cut from * that raster is as current as the mask drawn from it. */ readonly heldMaskFrameTime?: number | null; readonly hoveredPick: DetectionPickResult | null; readonly idMaskArtifact?: PixiFocusMaskArtifact | null; readonly heatmapArtifacts?: readonly PixiFocusHeatmapArtifact[]; readonly isMaskArtifactOwed?: boolean; readonly mediaTime: number; readonly selectedPick: DetectionPickResult | null; readonly viewportScale?: number; } type FocusDrawFrame = Parameters[0]["frame"]; export interface PixiFocusLayer { createDisplay(dimensions: { readonly width: number; readonly height: number; }): PixiContainer | PixiFocusGraphics; drawFrame(context: PixiFocusLayerFrameContext): void; syncViewportBounds(): void; releaseMaskTexture(texture: PixiTexture): void; tick(timestamp: number): void; settle(): void; isAnimating(): boolean; getTransitionDuration(): number | undefined; setFocusStyle(focusStyle: FocusStyle | null | undefined): void; destroy(): void; } export declare function createPixiFocusLayer(options: { readonly AlphaMask?: new (options: { mask: PixiContainer; }) => PixiAlphaMask; readonly Container?: ContainerConstructor; readonly Graphics: GraphicsConstructor; readonly Rectangle?: PixiRectangleConstructor; readonly ImageSource?: ImageSourceConstructor; readonly Mesh?: MeshConstructor; readonly MeshGeometry?: MeshGeometryConstructor; readonly Shader?: ShaderFactory; readonly UniformGroup?: UniformGroupConstructor; readonly getHeatmapRenderers?: () => readonly HeatmapAnnotationRenderer[]; readonly getAnnotationAntialiasing?: () => boolean; readonly getViewportBounds?: () => PixiViewportBounds | undefined; readonly focusStyle?: FocusStyle | null; readonly isDetectionVisible?: (detection: DetectionPickResult["detection"]) => boolean; }): PixiFocusLayer; export {}; //# sourceMappingURL=pixi-focus-layer.d.ts.map