export declare const WHEEL_FINISHES: readonly ["silver", "chrome", "gunmetal", "black", "bronze", "gold", "coloured"]; export type WheelFinish = typeof WHEEL_FINISHES[number]; /** Optional reference wheel for the appearance gate (a package/preview input, like the reference paint). */ export interface ReferenceWheel { /** Path of a close-up photo of the real wheel, face-on or nearly so. */ image: string; /** Declared spoke count of the real wheel; overrides the image-derived count. A twin-spoke wheel counts as the number of pairs a viewer sees as one spoke shape, i.e. the count the image reads as. */ spokeCount?: number; /** Declared finish of the real wheel; overrides the image-derived class. */ finish?: WheelFinish; /** Declared: does the real wheel carry a centre cap? Overrides the image-derived answer. */ centreCap?: boolean; /** Where the wheel sits in the photo, as fractions: centre x of the width, centre y of the height, tyre outer radius of the shorter side. Default: the image centre, 0.45. Set this for any photo where the wheel is not centred. */ crop?: { cx: number; cy: number; radius: number; }; } /** Where the candidate's wheel sits in its own render: a square-on frame centred on the wheel with the tyre this share of the half-height. */ export declare const WHEEL_FACE_FILL = 0.8; export declare const WHEEL_FACE_FOV = 24; export declare const WHEEL_LIMITS: { /** Annulus read for spokes, as fractions of the tyre's outer radius: outside the cap, inside the rim barrel. */ spokeInner: number; spokeOuter: number; /** Harmonics searched for the spoke count. */ minSpokes: number; maxSpokes: number; /** A peak must stand this many times above the median harmonic, and carry this share of the angular contrast, to be a spoke pattern. */ prominence: number; /** Centre cap: the disc and its surround, as fractions of the tyre radius. */ capDisc: number; capSurroundInner: number; capSurroundOuter: number; /** A centre cap is a disc that carries its own detail: the luminance stdev over the disc (a badge, a logo) is at least `capDetail`. A plain boss with lug holes reads about 0.05, a badged cap 0.13 to 0.27 (an unbadged cap and a plain boss look alike from across a car park, and are measured as the same thing on both sides). The edge round the disc (a same-sign luminance step at >= `capEdgeShare` of the angles, radius `capEdgeMin`..`capEdgeMax`) is reported, not judged. */ capEdgeMin: number; capEdgeMax: number; capEdgeStep: number; capEdgeShare: number; capDetail: number; }; export interface WheelMeasure { /** null = no spoke pattern (solid dish / mesh / too little contrast). */ spokeCount: number | null; spokePeakRatio: number; /** Magnitudes of harmonics 3..24, normalised to the strongest. */ spectrum: number[]; finish: WheelFinish; finishHsv: { h: number; s: number; v: number; }; centreCap: boolean; /** Disc-to-surround luminance step (reported, not judged) */ capStep: number; /** Share of angles carrying a same-sign edge at the best radius (a cap has its edge all the way round). */ capEdge: number; capDetail: number; /** Where the measure was taken from (px). */ centre: { x: number; y: number; }; tyreRadiusPx: number; } /** Classify a rim-face colour. Thresholds are on the median of the lit spoke pixels (0..1). */ export declare function classifyFinish(hsv: { h: number; s: number; v: number; }): WheelFinish; export declare const finishesAdjacent: (a: WheelFinish, b: WheelFinish) => boolean; interface Raw { data: Uint8Array; w: number; h: number; ch: number; } /** Measure one wheel face. `centre` and `tyreRadiusPx` are in pixels of the decoded image. */ export declare function measureWheelFace(im: Raw, centre: { x: number; y: number; }, tyreRadiusPx: number): WheelMeasure; /** The candidate's own render: the route centres the wheel and fills the half-height with the tyre by construction. */ export declare function measureCandidateWheel(frame: string | Buffer): Promise; export declare function measureReferenceWheel(ref: ReferenceWheel): Promise; export interface WheelAssert { id: string; pass: boolean; severity: 'block' | 'warn'; detail: string; measured: Record; } /** Judge a candidate wheel measure against the reference (declared values override the reference's measured ones). */ export declare function judgeWheelDesign(candidate: WheelMeasure, reference: WheelMeasure, declared?: Pick): WheelAssert[]; export {};