import type { HlodBakeResult } from './types'; export interface HlodAtlasSlot { id: string; size: number; x: number; y: number; /** Normalized rectangle for the source UVs, excluding the outer gutter. */ uv: [number, number, number, number]; } export interface HlodSharedAtlasPlan { width: number; height: number; gutter: number; slots: HlodAtlasSlot[]; } export interface HlodAtlasImage { data: Uint8Array; width: number; height: number; } export interface HlodSharedAtlas { plan: HlodSharedAtlasPlan; baseColor: HlodAtlasImage; normal: HlodAtlasImage; orm: HlodAtlasImage; emissive?: HlodAtlasImage; } export type HlodResizeKind = 'color' | 'normal' | 'data'; /** * Fit a square RGBA tile into an atlas slot without changing what it averages to. Colour is filtered in linear light (a Lanczos * pass over sRGB bytes darkens bright thin features and rings around them), a normal map is filtered as vectors and renormalised * (averaging encoded bytes shortens the vector and tilts it toward the blue pole), data maps are filtered as stored. * Shrinking is an area average; the rare enlargement is bilinear. */ export declare function resizeHlodTile(input: Uint8Array, size: number, target: number, kind: HlodResizeKind): Uint8Array; /** Power-of-two tiles share one material without duplicating appearance in every spatial cell. */ export declare function planSharedHlodAtlas(items: readonly { id: string; size: number; }[]): HlodSharedAtlasPlan; /** Load one bounded prototype at a time; scalar and normal maps use less atlas memory than base color. */ export declare function bakeSharedHlodAtlas(plan: HlodSharedAtlasPlan, load: (id: string) => Promise>, options?: { emissive?: boolean; signal?: AbortSignal; }): Promise;