import type { HelixSceneV2 } from '@hypersoniclabs/helix-manifest'; import type { SkylineAtlasPolicy } from './tierProfiles'; /** Directory (beside a part's document) that holds the lowered carriers. */ export declare const LOWERED_ATLAS_DIR = "hlod-complete-m"; /** * The same KTX2 file without its `drop` largest mip levels. Levels are stored smallest first, so the new level 0 is the file's * last kept block: the tail after it is cut, the level index loses its first `drop` entries (the gap they leave stays zero, every * other offset in the file is unchanged) and the header gets the smaller size and level count. */ export declare function dropKtx2Levels(file: Buffer, drop: number): Buffer; /** The larger side of a carrier's first KTX2 image (its base colour map), 0 when it has none. */ export declare function baseImageSide(glb: Buffer): number; /** How many levels to drop so the larger side is at most `maxDim` (never below one level of the chain; none for BasisLZ). */ export declare function levelsToDrop(file: Buffer, maxDim: number): number; /** * A GLB with every embedded KTX2 image lowered to at most `maxDim` (one cap for every image, or one cap per image in the order the * carrier lists them: base colour, normal, ORM). The BIN chunk is repacked (4-byte aligned, original order) and every buffer view * (plus the `EXT_meshopt_compression` source range it may carry) is pointed at its new offset. `null` when no image was above its cap. */ export declare function lowerGlbAtlas(glb: Buffer, maxDim: number | readonly number[]): Buffer | null; export interface LowerAtlasOptions { /** The folder the part's resource URIs resolve against (the bake's data root). */ dataDir: string; /** Where the lowered carriers are written, named by SHA-256 (parts that share a carrier share the file). */ outDir: string; /** The cap for a carrier that is not the skyline atlas, px. 0: leave such a carrier as baked. */ regionMaxDim?: number; /** A carrier whose base image is at least `minSide` wide keeps the per-image caps instead. */ skyline?: SkylineAtlasPolicy | null; } export interface LowerAtlasResult { part: HelixSceneV2; lowered: number; bytesBefore: number; bytesAfter: number; } /** * The part with its shared-appearance carriers lowered: the new files are written to `outDir` and the part's resource entries point * at them as `hlod-complete-m/.glb` with the new byte length and integrity. The part itself is not mutated. `cache` lets the * parts of one bake (which share one carrier) lower it once. */ export declare function lowerPartAtlases(part: HelixSceneV2, options: LowerAtlasOptions, cache?: Map): LowerAtlasResult; /** * What a meshopt/quantised distant-mass GLB occupies in the engine's own accounting (`hlodResidentBytes`, which refuses a cluster * whose decoded bytes pass its declaration): the file's bytes plus each accessor's count times its element size (rows padded to 4 * bytes), the arrays counted twice for the CPU and the GPU copy. Read from the JSON chunk alone. */ export declare function glbDecodedGeometryBytes(file: string): number; /** * What a shared-appearance GLB occupies in the engine's own accounting: the file's bytes plus its embedded KTX2 images transcoded * and counted twice. A transcoded block-compressed texture is 8 bits per texel on every format a handset takes (ASTC 4x4, ETC2 * RGBA, BC7) and carries a full mip chain (x 4/3); width and height come from each image's KTX2 header, nothing is decoded. The bake * declares the uncompressed RGBA8 worst case, about 3x that. */ export declare function glbKtx2GpuBytes(file: string): number;