import type { GeoProjection } from "d3-geo"; import type { IGraphics } from "../../core/render/backend/Renderer"; import type { IDisposer } from "../../core/util/Disposer"; import type { ISharedGL } from "../../core/render/webgl/WebGL"; import { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate, IMapSeriesEvents } from "./MapSeries"; import { ISunSettings, SunClock } from "./MapSun"; import { Graphics } from "../../core/render/Graphics"; export interface IMapRasterSeriesDataItem extends IMapSeriesDataItem { } export interface IMapRasterSeriesSettings extends IMapSeriesSettings, ISunSettings { /** * URL of an image of the whole world in equirectangular projection * ("plate carrée"): longitude -180 to 180 from left to right, latitude 90 * to -90 from top to bottom. Satellite imagery such as NASA's Blue Marble * comes in this form. * * The geodata package has day and night images of the Earth ready for * this, e.g. `geodata/images/earthDay2048.jpg` (credit: NASA Earth * Observatory). See `images/README.md` in the geodata package. */ src?: string; /** * URL of an image of the world at night, in the same form as `src`. With * `sunPosition` set, the series shows `src` where the sun is up and this * image where it is down, blended across twilight. * * The geodata package has one: `geodata/images/earthNight2048.jpg`. */ nightSrc?: string; /** * The images' `crossOrigin` setting. A cross-origin image can only be * reprojected if its server allows it (CORS). * * @default "anonymous" */ cors?: string | null; } export interface IMapRasterSeriesPrivate extends IMapSeriesPrivate { } export interface IMapRasterSeriesEvents extends IMapSeriesEvents { /** * The images finished loading: `src`, and `nightSrc` if set. */ loaded: {}; /** * An image failed to load, or can't be read, such as a cross-origin image * without CORS headers. */ loaderror: {}; } interface IRasterLevel { width: number; height: number; pixels: Uint32Array; } /** * One image: the element, its texture on the shared WebGL context, and the * pixel levels the CPU path samples. */ interface IRasterImage { image?: HTMLImageElement; ready: boolean; levels: Array; texture?: { generation: number; texture: WebGLTexture; }; } /** * @ignore */ export interface IRasterProgram { generation: number; program: WebGLProgram; vertexArray: WebGLVertexArrayObject; uniforms: { [name: string]: WebGLUniformLocation | null; }; } /** * A [[MapChart]] series that shows an image of the whole world, such as a * satellite photo, reprojected to the chart's projection. * * The image must be in equirectangular projection. It is redrawn as the map * moves: on the GPU (WebGL2) for orthographic, equirectangular, Mercator, * Equal Earth and Natural Earth projections, on the CPU otherwise. * * The projection needs `invert`. The blend `animateProjection()` runs through * has none, so the image is not drawn while that animation plays. * * With `nightSrc` and `sunPosition`, it shows day and night: one image where * the sun is up, the other where it is down. * * The series counts as the whole world in the map's bounds. On a regional * map, set `affectsBounds: false` to keep the map fitted to the region. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-raster-series/} for more information * @since 5.21.0 * @important */ export declare class MapRasterSeries extends MapSeries { static className: string; static classNames: Array; _settings: IMapRasterSeriesSettings; _privateSettings: IMapRasterSeriesPrivate; _dataItemSettings: IMapRasterSeriesDataItem; _events: IMapRasterSeriesEvents; protected _autoAppearReady(): boolean; protected _raster: Graphics; /** * @ignore */ _day: IRasterImage; /** * @ignore */ _night: IRasterImage; protected _canvas?: HTMLCanvasElement; protected _context?: CanvasRenderingContext2D; protected _output?: ImageData; protected _world?: GeoJSON.MultiPolygon; protected _settle?: IDisposer; protected _sharp: boolean; protected _sunClock: SunClock; protected _stale: boolean; /** * `false` reprojects on the CPU even where WebGL2 is available. * * @ignore */ _webgl: boolean; protected _afterNew(): void; _prepareChildren(): void; /** * @ignore */ markDirtyProjection(): void; protected _load(raster: IRasterImage, src: string | undefined): void; protected _loaded(): boolean; protected _nightImage(): IRasterImage | undefined; /** * Puts an image into a texture of the shared WebGL context, scaled down * if it is larger than the GPU allows. `false` without WebGL2 or for an * image that can not be read. */ protected _upload(raster: IRasterImage): boolean; protected _textureOf(raster: IRasterImage, shared: ISharedGL): boolean; protected _deleteTexture(raster: IRasterImage): void; /** * An image's pixels, halved `index` times so that sampling one pixel per * screen pixel does not alias. Only the CPU path reads them. */ protected _level(raster: IRasterImage, index: number): IRasterLevel | undefined; protected _drawRaster(display: IGraphics): void; protected _target(pixelWidth: number, pixelHeight: number): HTMLCanvasElement; /** * Reprojects the image into a canvas of the chart's size in device pixels: * with WebGL2 where it can, on the CPU otherwise. */ protected _render(projection: GeoProjection, width: number, height: number): HTMLCanvasElement | undefined; /** * One pixel per CSS pixel now, and a sharp redraw once the map has not * moved for a moment. */ protected _draftResolution(resolution: number): number; protected _renderGL(shared: ISharedGL, program: IRasterProgram, kind: number, matrix: Array, scale: number, tx: number, ty: number, pixelWidth: number, pixelHeight: number, resolution: number, night: IRasterImage | undefined, sun: Array | undefined, twilight: number): HTMLCanvasElement | undefined; /** * The level to sample for a given number of texels of the full image per * screen pixel, about one texel per pixel. Below one the full image is * magnified, and blended (`true`). */ protected _pick(raster: IRasterImage, texelsPerPixel: number): [IRasterLevel, boolean]; protected _renderRaw(kind: number, m: Array, scale: number, tx: number, ty: number, out: Uint32Array, pixelWidth: number, pixelHeight: number, resolution: number, night: IRasterImage | undefined, sun: Array | undefined, twilight: number): void; protected _renderInverse(projection: GeoProjection, out: Uint32Array, pixelWidth: number, pixelHeight: number, resolution: number, night: IRasterImage | undefined, sun: Array | undefined, twilight: number): void; protected _dispose(): void; } export {}; //# sourceMappingURL=MapRasterSeries.d.ts.map