export type SurfaceSample = { /** Surface name, e.g. `water`, `grass`, `sand`, `ground`. */ surface: string; /** Water depth from `0` (shore) to `1` (deep), `0` on land. */ depth: number; /** Map color under the point, `0xRRGGBB`. */ color: number; }; export type SurfaceClassifier = (r: number, g: number, b: number) => { surface: string; depth?: number; }; export interface SurfaceSampler { /** Surface under a world position (with `scale` applied). */ sample: (x: number, y: number) => SurfaceSample; width: number; height: number; } /** * Default color rules for top-down RPG maps: blue/teal = water (lighter = shallower), * dominant green = grass, bright beige = sand, anything else = ground. */ export declare const defaultSurfaceClassifier: SurfaceClassifier; /** * Reads a map image once and answers "what is under this point?" — the terrain type, * the water depth and the ground color — so sprites can react to the map without zones. * * @example * ```ts * const terrain = await createSurfaceSampler('./beach.webp') * terrain.sample(hero.x, hero.y) // { surface: 'water', depth: 0.4, color: 0x06b9c6 } * ``` */ export declare function createSurfaceSampler(image: string | HTMLImageElement | HTMLCanvasElement, options?: { classify?: SurfaceClassifier; /** World units per image pixel. Default: `1` */ scale?: number; /** Averaging radius in image pixels, smooths noisy pixel art. Default: `2` */ radius?: number; }): Promise; /** Same as `createSurfaceSampler`, from raw RGBA pixels. */ export declare function createSurfaceSamplerFromPixels(pixels: Uint8ClampedArray | Uint8Array, width: number, height: number, options?: { classify?: SurfaceClassifier; scale?: number; radius?: number; }): SurfaceSampler; //# sourceMappingURL=surfaceSampler.d.ts.map