forked from JeremyHeleine/Photo-Sphere-Viewer
-
-
Notifications
You must be signed in to change notification settings - Fork 634
/
model.ts
96 lines (92 loc) · 2.37 KB
/
model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import type { EquirectangularAdapterConfig, PanoData, PanoDataProvider } from '@photo-sphere-viewer/core';
/**
* Configuration of a tiled panorama
*/
export type EquirectangularTilesPanorama = {
/**
* low resolution panorama loaded before tiles
*/
baseUrl?: string;
/**
* panoData configuration associated to low resolution panorama loaded before tiles
*/
basePanoData?: PanoData | PanoDataProvider;
/**
* complete panorama width (height is always width/2)
*/
width: number;
/**
* number of vertical tiles (must be a power of 2)
*/
cols: number;
/**
* number of horizontal tiles (must be a power of 2)
*/
rows: number;
/**
* function to build a tile url
*/
tileUrl: (col: number, row: number) => string | null;
};
export type EquirectangularTileLevel = {
/**
* Lower and upper zoom levels (0-100)
*/
zoomRange: [number, number];
/**
* complete panorama width (height is always width/2)
*/
width: number;
/**
* number of vertical tiles (must be a power of 2)
*/
cols: number;
/**
* number of horizontal tiles (must be a power of 2)
*/
rows: number;
};
/**
* Configuration of a tiled panorama with multiple tiles configurations
*/
export type EquirectangularMultiTilesPanorama = {
/**
* low resolution panorama loaded before tiles
*/
baseUrl?: string;
/**
* panoData configuration associated to low resolution panorama loaded before tiles
*/
basePanoData?: PanoData | PanoDataProvider;
/**
* Configuration of tiles by zoom level
*/
levels: EquirectangularTileLevel[];
/**
* function to build a tile url
*/
tileUrl: (col: number, row: number, level: number) => string | null;
};
export type EquirectangularTilesAdapterConfig = Omit<EquirectangularAdapterConfig, 'interpolateBackground' | 'blur'> & {
/**
* shows a warning sign on tiles that cannot be loaded
* @default true
*/
showErrorTile?: boolean;
/**
* applies a blur effect to the low resolution panorama
* @default true
*/
baseBlur?: boolean;
/**
* applies antialiasing to high resolutions tiles
* @default true
*/
antialias?: boolean;
/**
* shows debug helpers
* @default false
* @internal
*/
debug?: boolean;
};