import type { PreparedPackedMaskCoverage } from "./packed-mask-coverage"; import type { StrokeAlignment } from "supervision-js-core"; export declare enum PreparedMaskFrameKind { IdMask = "idMask", RgbaImage = "rgbaImage" } /** * How an id raster is laid out for the texture it is uploaded into. WebGPU * takes any bytesPerRow, so ids go up one byte per pixel. WebGL aligns every * uploaded row to four bytes and rejects a single-channel upload whose width * is not a multiple of four, which is what the four-channel layout is for. */ export declare enum IdMaskTextureFormat { R8 = "r8unorm", Rgba8 = "rgba8unorm" } export interface PreparedRegionMaskCoverageEntry { readonly data: Uint8Array; readonly detectionIndex: number; readonly height: number; readonly width: number; readonly x: number; readonly y: number; } /** * Overlap-preserving membership planes for exact region crops. Every target * owns an alpha crop, so masks remain independent where their pixels overlap. */ export interface PreparedRegionMaskCoverageFrame { readonly entries: readonly PreparedRegionMaskCoverageEntry[]; } /** * The uncomposited detection-id plane carried alongside the RGBA composite, so * id-keyed effects such as the mask halo still have a plane to read when the id * raster could not be cooked. It carries its own size because it honors the * same raster cap as the id raster while the composite is cooked at the * instructions' own resolution. */ export interface PreparedIdMaskPlane { readonly data: Uint8Array; readonly height: number; readonly width: number; } export interface PreparedRgbaMaskFrame { readonly packedMaskCoverage?: readonly PreparedPackedMaskCoverage[]; readonly screenStrokes?: readonly PreparedMaskScreenStroke[]; readonly height: number; readonly idMaskPlane?: PreparedIdMaskPlane; readonly key: string; readonly kind: PreparedMaskFrameKind.RgbaImage; readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame; readonly source: HTMLCanvasElement | ImageBitmap; readonly width: number; close(): void; } export interface PreparedIdMaskFrame { readonly packedMaskCoverage?: readonly PreparedPackedMaskCoverage[]; readonly screenStrokes?: readonly PreparedMaskScreenStroke[]; readonly fillPalette: Float32Array; readonly hasStroke: boolean; readonly height: number; readonly key: string; readonly kind: PreparedMaskFrameKind.IdMask; /** Largest outside stroke extent in CSS pixels. */ readonly maxStrokeWidth: number; readonly raster: Uint8Array; readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame; /** Original mask-plane width before optional raster reduction. */ readonly sourceWidth: number; readonly strokePalette: Float32Array; readonly strokeAlignments?: Float32Array; /** Total stroke width in CSS pixels per palette ID. */ readonly strokeWidths: Float32Array; readonly width: number; close(): void; } export interface PreparedMaskScreenStroke { readonly detectionIndex: number; readonly color: number; readonly alpha: number; readonly width: number; readonly widthUnit?: "mask" | "screen"; readonly alignment?: StrokeAlignment; /** Closed contours in this artifact's raster coordinates, including holes. */ readonly paths: readonly Float32Array[]; } export type PreparedMaskFrame = PreparedIdMaskFrame | PreparedRgbaMaskFrame; export declare function readIdMaskRasterValue(frame: PreparedIdMaskFrame, x: number, y: number): number; //# sourceMappingURL=mask-frame-artifact.d.ts.map