import type { Detection, Point, PolygonGeometry, Rect } from "#types/detections"; export interface MediaDimensions { readonly width: number; readonly height: number; } export declare function rectToPolygon(rect: Rect): PolygonGeometry; export declare function polygonToRect(polygon: PolygonGeometry): Rect | undefined; export declare function rasterizeRectToMask(rect: Rect, dimensions: MediaDimensions): Uint8Array; export declare function rasterizePolygonToMask(points: readonly Point[], dimensions: MediaDimensions): Uint8Array; export declare function forEachRasterPolygonSpan(points: readonly Point[], dimensions: MediaDimensions, writeSpan: (y: number, left: number, right: number) => void): void; export declare function convertDetectionBoxToPolygon(detection: Detection): Detection; export declare function convertDetectionPolygonToBox(detection: Detection): Detection; export declare function convertDetectionMaskToBox(detection: Detection): Detection; export declare function convertDetectionMaskToPolygon(detection: Detection): Detection; export declare function convertDetectionBoxToMask(detection: Detection, dimensions: MediaDimensions): Detection; export declare function convertDetectionPolygonToMask(detection: Detection, dimensions: MediaDimensions): Detection; export declare function mergeDetectionMasks(detections: readonly Detection[]): Detection | null; /** * Groups polygon detections by class and returns one union bounding-box * detection per class. This intentionally converts the output to rectangles. */ export declare function mergeDetectionPolygonsByClass(detections: readonly Detection[], options?: { readonly createId?: (className: string | undefined, groupIndex: number) => string | number; }): Detection[]; //# sourceMappingURL=detection-conversions.d.ts.map