/** * A small TIFF / BigTIFF reader for ONE thing: the first IFD of a tiled, single-band, georeferenced elevation COG * (Copernicus GLO-30), so a window can be read by HTTP range requests instead of downloading a ~40 MB tile. It is not a * general TIFF library: anything outside that shape throws a message naming what it found. */ /** The parse ran off the end of the bytes handed in: fetch at least `end` bytes of the file prefix and parse again. */ export declare class NeedMoreBytes extends Error { readonly end: number; constructor(end: number); } export interface CogHeader { littleEndian: boolean; bigTiff: boolean; width: number; height: number; tileWidth: number; tileHeight: number; bitsPerSample: 8 | 16 | 32 | 64; /** TIFF SampleFormat: 1 unsigned int, 2 signed int, 3 IEEE float. */ sampleFormat: 1 | 2 | 3; /** 1 none; 8 / 32946 both mean zlib deflate. */ compression: 1 | 8 | 32946; /** 1 none, 2 horizontal differencing (integers), 3 floating-point (byte planes then byte differencing). */ predictor: 1 | 2 | 3; tileOffsets: number[]; tileByteCounts: number[]; /** ModelPixelScale x / y in degrees (y is positive; rows run south). */ pixelScale: [number, number]; /** ModelTiepoint: raster (i, j) maps to geographic (x = lon, y = lat). */ tiePoint: { i: number; j: number; lon: number; lat: number; }; /** GTRasterTypeGeoKey: PixelIsArea (default when the key is absent) or PixelIsPoint. */ rasterType: 'area' | 'point'; /** GeographicTypeGeoKey (4326 for Copernicus), when present. */ geographicType: number | null; noData: number | null; } /** Parses the first IFD out of the file's leading bytes; throws `NeedMoreBytes` when the tags it needs lie beyond them. */ export declare function parseCogHeader(bytes: Uint8Array): CogHeader; export declare function tilesAcross(header: Pick): number; export declare function tilesDown(header: Pick): number; /** * Inflates one tile and returns its `tileWidth x tileHeight` samples as float32 (edge tiles are stored full size, padded * past the raster, so the caller crops by the raster's width and height). */ export declare function decodeTile(compressed: Uint8Array, header: CogHeader): Float32Array;