import { ColorMeasure, DistanceMeasure, FontMeasure, MeasureColorShape, MeasureDistanceShape, MeasureFontShape, MeasureShape, NormPoint, Shape, ShapeStyle } from '../types/annotation.types'; import { PixelSize } from './scaling'; /** Narrow a shape to a measurement shape. */ export declare function isMeasureShape(shape: Shape): shape is MeasureShape; /** Compute distance values (intrinsic px) between two normalized points. */ export declare function computeDistance(from: NormPoint, to: NormPoint, size: PixelSize): DistanceMeasure; /** Compute font/text-height value (intrinsic px) for a vertical span. */ export declare function computeFont(from: NormPoint, to: NormPoint, size: PixelSize): FontMeasure; /** Approximate point size from a pixel height (DPI-dependent; label as approx). */ export declare function pxToPt(px: number): number; /** Format an RGB triple (0–255) as an uppercase hex string. */ export declare function rgbToHex([r, g, b]: [number, number, number]): string; /** * Sample the pixel colour under a normalized point by drawing the media to an * offscreen canvas at its intrinsic size. Returns null if the canvas is tainted * (the media is not CORS-enabled) or sampling otherwise fails. */ export declare function sampleColor(media: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement, at: NormPoint, size: PixelSize): ColorMeasure | null; /** Build a distance-measurement shape with computed values. */ export declare function buildMeasureDistance(id: string, from: NormPoint, to: NormPoint, style: ShapeStyle, size: PixelSize, time?: { startTime?: number; }): MeasureDistanceShape; /** Build a font/text-height measurement shape with computed values. */ export declare function buildMeasureFont(id: string, from: NormPoint, to: NormPoint, style: ShapeStyle, size: PixelSize, time?: { startTime?: number; }): MeasureFontShape; /** Build a colour-sample measurement shape. */ export declare function buildMeasureColor(id: string, at: NormPoint, measure: ColorMeasure, style: ShapeStyle, time?: { startTime?: number; }): MeasureColorShape; //# sourceMappingURL=measure.d.ts.map