1 | import { Extent } from './extent';
|
2 | import ImageBase from './ImageBase';
|
3 | import ImageState from './ImageState';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export type LoadFunction = (p0: ImageWrapper, p1: string) => void;
|
17 | export default class ImageWrapper extends ImageBase {
|
18 | constructor(
|
19 | extent: Extent,
|
20 | resolution: number | undefined,
|
21 | pixelRatio: number,
|
22 | src: string,
|
23 | crossOrigin: string,
|
24 | imageLoadFunction: LoadFunction,
|
25 | );
|
26 | protected state: ImageState;
|
27 | getImage(): HTMLCanvasElement | HTMLImageElement | HTMLVideoElement;
|
28 | /**
|
29 | * Load the image or retry if loading previously failed.
|
30 | * Loading is taken care of by the tile queue, and calling this method is
|
31 | * only needed for preloading or for reloading in case of an error.
|
32 | */
|
33 | load(): void;
|
34 | setImage(image: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement): void;
|
35 | }
|
36 | export function listenImage(
|
37 | image: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement,
|
38 | loadHandler: () => any,
|
39 | errorHandler: () => any,
|
40 | ): () => void;
|