import type { GeoProjection } from '@mui/x-charts-vendor/d3-geo'; export interface ReprojectEquirectangularImageParams { /** * A fully-loaded image whose pixels are in the equirectangular (plate carrée) * projection — longitude maps linearly to x, latitude linearly to y. */ image: HTMLImageElement; /** * The chart projection. Must expose `invert`; otherwise reprojection is impossible. */ projection: GeoProjection; /** * The chart drawing area, in SVG coordinates. `left`/`top` are the offset of the * drawing area inside the SVG, which the projection already accounts for. */ area: { left: number; top: number; width: number; height: number; }; /** * Geographic extent the source image covers, as `[[west, south], [east, north]]` * in degrees. `west > east` is allowed and means the range wraps across the antimeridian. */ imageBounds: [[number, number], [number, number]]; } /** * Warps an equirectangular raster so it matches an arbitrary d3-geo `projection`, * returning the result as a PNG data URL (or `null` when it cannot be produced). * * ### Why inverse mapping * * Forward-projecting each *source* pixel to the screen leaves holes and overlaps, * because the mapping is non-linear and area-distorting. Instead we walk every * *destination* pixel and pull the color it should show from the source — inverse * (destination-to-source) resampling, which fills the output exactly once. * * ### Algorithm * * For each destination pixel `(px, py)` of the drawing area: * * 1. Convert it to SVG coordinates `(left + px, top + py)` and resolve it to a * `[lon, lat]` coordinate with {@link createVisibleCoordinate}, which returns * `null` for pixels outside the visible map (post-clip and the spherical * round-trip), leaving them transparent. * 2. Discard coordinates outside `imageBounds` (no source data there). * 3. Map `[lon, lat]` to a source pixel with nearest-neighbor sampling (the image * being equirectangular, both axes are linear) and copy its RGBA. * * ### Failure modes * * Returns `null` when a 2D canvas context is unavailable, or when reading the * source pixels throws because a cross-origin image without CORS headers has * tainted the canvas. * * Complexity is `O(width × height)`; callers should treat it as a per-resize * computation rather than a per-frame one. */ export declare function reprojectEquirectangularImage(params: ReprojectEquirectangularImageParams): string | null;