import { type PlacementBounds, type PlacementRecord, type PlacementPrototype, type DistantTreeAtlas } from '@hypersoniclabs/helix-manifest'; export interface BakeTreeImpostorsOptions { /** 512 is the conservative portable starting point; 1024 uses four times the atlas memory. */ size?: 512 | 1024; /** Optional diagnostic atlas PNGs, outside the immutable resource closure. */ previewDirectory?: string; onProgress?: (message: string) => void; /** Each view is rendered this many times larger per side and box-filtered, so sub-texel needle cards keep a fractional alpha instead of vanishing. 1 = the old single-sample bake. */ ssaa?: 1 | 2 | 4; /** Crown density (the filtered alpha) mapped to alpha: 0 below `lo`, 1 above `hi`, smooth between. The runtime discards below 0.4 and its mips average alpha, so a sparse crown needs this to read at range. Absent = IMPOSTOR_CROWN_RAMP; `null` = leave the alpha as filtered. */ crownRamp?: { lo: number; hi: number; } | null; } /** The default density-to-alpha ramp (fitted on the Granit ponderosa and douglas fir; see docs/placements-impostors.md). */ export declare const IMPOSTOR_CROWN_RAMP: { readonly lo: 0.04; readonly hi: 0.3; }; /** Map each atlas texel's filtered alpha (crown density) to a runtime alpha: smoothstep(lo, hi, density). Colour is untouched. */ export declare function applyCrownRamp(data: Uint8Array, ramp: { lo: number; hi: number; }): Uint8Array; /** Share of each of the 64 views (8 x 8 tiles of an atlas) that the runtime would draw (alpha at least 0.4). */ export declare function impostorViewCoverage(data: Uint8Array, size: number): number[]; export declare function partitionDistantTrees(records: PlacementRecord[], treePrototypes: Set): { x: number; z: number; prototype: number; records: PlacementRecord[]; }[]; /** * The transforms (x y z, quaternion, scale; records sorted by stable id IN PLACE) and conservative bounds of one distant page. * Shared by the impostor bake and by `snapPlacementsBake`, which has to rebuild the pages when the records it moves are trees. */ export declare function distantPageGeometry(group: { records: PlacementRecord[]; }, prototypes: PlacementPrototype[], atlases: DistantTreeAtlas[]): { transforms: Float32Array; bounds: PlacementBounds; }; /** Dilate RGB within each capture tile while retaining alpha; empty atlas gutters do not become black fringes. */ export declare function dilateImpostorColors(data: Uint8Array, size: number, steps?: number): Uint8Array; /** Reusable offline bake over any validated structural-tree placement inventory; no world-specific assets or paths. */ export declare function bakeTreeImpostors(directory: string, output: string, options?: BakeTreeImpostorsOptions): Promise;