@mapcatch/util 2.0.4 → 2.0.5-a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +54 -0
- package/.husky/pre-commit +1 -0
- package/.prettierrc +4 -0
- package/.vscode/settings.json +2 -0
- package/README.md +44 -0
- package/debug/app.js +26 -0
- package/debug/index.html +55 -0
- package/debug/libs/vue.global.js +16159 -0
- package/debug/my_icon.png +0 -0
- package/docs/Catolog.md +24 -0
- package/docs/Constant.md +92 -0
- package/docs/Event.md +90 -0
- package/docs/Util.md +345 -0
- package/package.json +21 -1
- package/src/constants/crs.js +42098 -42098
- package/src/constants/default_layers.js +42 -94
- package/src/gl-operations/constants.js +9 -9
- package/src/gl-operations/default_options.js +97 -97
- package/src/gl-operations/index.js +532 -532
- package/src/gl-operations/reglCommands/contours.js +27 -27
- package/src/gl-operations/reglCommands/default.js +45 -45
- package/src/gl-operations/reglCommands/hillshading.js +340 -340
- package/src/gl-operations/reglCommands/index.js +6 -6
- package/src/gl-operations/reglCommands/multiLayers.js +303 -303
- package/src/gl-operations/reglCommands/transitions.js +111 -111
- package/src/gl-operations/reglCommands/util.js +71 -71
- package/src/gl-operations/renderer.js +209 -209
- package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
- package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
- package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
- package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
- package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
- package/src/gl-operations/shaders/fragment/single.js +93 -93
- package/src/gl-operations/shaders/transform.js +21 -21
- package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
- package/src/gl-operations/shaders/vertex/double.js +16 -16
- package/src/gl-operations/shaders/vertex/multi3.js +19 -19
- package/src/gl-operations/shaders/vertex/multi4.js +22 -22
- package/src/gl-operations/shaders/vertex/multi5.js +25 -25
- package/src/gl-operations/shaders/vertex/multi6.js +28 -28
- package/src/gl-operations/shaders/vertex/single.js +13 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
- package/src/gl-operations/texture_manager.js +141 -141
- package/src/gl-operations/util.js +336 -336
- package/src/util.js +14 -6
- package/vite.config.js +58 -0
- package/dist/catchUtil.min.esm.js +0 -113044
- package/dist/catchUtil.min.js +0 -2928
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './default'
|
|
2
|
-
export * from './hillshading'
|
|
3
|
-
export * from './transitions'
|
|
4
|
-
export * from './contours'
|
|
5
|
-
export * from './multiLayers'
|
|
6
|
-
export * from './util'
|
|
1
|
+
export * from './default'
|
|
2
|
+
export * from './hillshading'
|
|
3
|
+
export * from './transitions'
|
|
4
|
+
export * from './contours'
|
|
5
|
+
export * from './multiLayers'
|
|
6
|
+
export * from './util'
|
|
@@ -1,303 +1,303 @@
|
|
|
1
|
-
import vertSingle from '../shaders/vertex/single.js'
|
|
2
|
-
import vertDouble from '../shaders/vertex/double.js'
|
|
3
|
-
import vertMulti3 from '../shaders/vertex/multi3.js'
|
|
4
|
-
import vertMulti4 from '../shaders/vertex/multi4.js'
|
|
5
|
-
import vertMulti5 from '../shaders/vertex/multi5.js'
|
|
6
|
-
import vertMulti6 from '../shaders/vertex/multi6.js'
|
|
7
|
-
|
|
8
|
-
import fragMulti1Calc from '../shaders/fragment/multiAnalyze1Calc.js'
|
|
9
|
-
import fragMulti2Calc from '../shaders/fragment/multiAnalyze2Calc.js'
|
|
10
|
-
import fragMulti3Calc from '../shaders/fragment/multiAnalyze3Calc.js'
|
|
11
|
-
import fragMulti4Calc from '../shaders/fragment/multiAnalyze4Calc.js'
|
|
12
|
-
import fragMulti5Calc from '../shaders/fragment/multiAnalyze5Calc.js'
|
|
13
|
-
import fragMulti6Calc from '../shaders/fragment/multiAnalyze6Calc.js'
|
|
14
|
-
import fragDiffCalc from '../shaders/fragment/diffCalc.js'
|
|
15
|
-
import fragDrawResult from '../shaders/fragment/drawResult.js'
|
|
16
|
-
|
|
17
|
-
import * as util from '../util'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export function createCalcTileMultiAnalyze1Command (
|
|
21
|
-
regl,
|
|
22
|
-
commonConfig
|
|
23
|
-
) {
|
|
24
|
-
return regl({
|
|
25
|
-
...commonConfig,
|
|
26
|
-
vert: vertSingle,
|
|
27
|
-
frag: fragMulti1Calc,
|
|
28
|
-
depth: {
|
|
29
|
-
enable: false
|
|
30
|
-
},
|
|
31
|
-
uniforms: {
|
|
32
|
-
...commonConfig.uniforms,
|
|
33
|
-
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
34
|
-
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
35
|
-
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
36
|
-
textureA: (_, { textureA }) => textureA
|
|
37
|
-
},
|
|
38
|
-
attributes: {
|
|
39
|
-
...commonConfig.attributes,
|
|
40
|
-
texCoord: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA)
|
|
41
|
-
},
|
|
42
|
-
framebuffer: regl.prop('fbo')
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function createCalcTileMultiAnalyze2Command (
|
|
47
|
-
regl,
|
|
48
|
-
commonConfig
|
|
49
|
-
) {
|
|
50
|
-
return regl({
|
|
51
|
-
...commonConfig,
|
|
52
|
-
vert: vertDouble,
|
|
53
|
-
frag: fragMulti2Calc,
|
|
54
|
-
depth: {
|
|
55
|
-
enable: false
|
|
56
|
-
},
|
|
57
|
-
uniforms: {
|
|
58
|
-
...commonConfig.uniforms,
|
|
59
|
-
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
60
|
-
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
61
|
-
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
62
|
-
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
63
|
-
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
64
|
-
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
65
|
-
textureA: (_, { textureA }) => textureA,
|
|
66
|
-
textureB: (_, { textureB }) => textureB
|
|
67
|
-
},
|
|
68
|
-
attributes: {
|
|
69
|
-
...commonConfig.attributes,
|
|
70
|
-
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
71
|
-
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB)
|
|
72
|
-
},
|
|
73
|
-
framebuffer: regl.prop('fbo')
|
|
74
|
-
})
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function createCalcTileMultiAnalyze3Command (
|
|
78
|
-
regl,
|
|
79
|
-
commonConfig
|
|
80
|
-
) {
|
|
81
|
-
return regl({
|
|
82
|
-
...commonConfig,
|
|
83
|
-
vert: vertMulti3,
|
|
84
|
-
frag: fragMulti3Calc,
|
|
85
|
-
depth: {
|
|
86
|
-
enable: false
|
|
87
|
-
},
|
|
88
|
-
uniforms: {
|
|
89
|
-
...commonConfig.uniforms,
|
|
90
|
-
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
91
|
-
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
92
|
-
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
93
|
-
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
94
|
-
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
95
|
-
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
96
|
-
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
97
|
-
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
98
|
-
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
99
|
-
textureA: (_, { textureA }) => textureA,
|
|
100
|
-
textureB: (_, { textureB }) => textureB,
|
|
101
|
-
textureC: (_, { textureC }) => textureC
|
|
102
|
-
},
|
|
103
|
-
attributes: {
|
|
104
|
-
...commonConfig.attributes,
|
|
105
|
-
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
106
|
-
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
107
|
-
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC)
|
|
108
|
-
},
|
|
109
|
-
framebuffer: regl.prop('fbo')
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function createCalcTileMultiAnalyze4Command (
|
|
114
|
-
regl,
|
|
115
|
-
commonConfig
|
|
116
|
-
) {
|
|
117
|
-
return regl({
|
|
118
|
-
...commonConfig,
|
|
119
|
-
vert: vertMulti4,
|
|
120
|
-
frag: fragMulti4Calc,
|
|
121
|
-
depth: {
|
|
122
|
-
enable: false
|
|
123
|
-
},
|
|
124
|
-
uniforms: {
|
|
125
|
-
...commonConfig.uniforms,
|
|
126
|
-
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
127
|
-
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
128
|
-
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
129
|
-
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
130
|
-
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
131
|
-
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
132
|
-
filterLowD: (_, { filterLowD }) => filterLowD,
|
|
133
|
-
filterHighD: (_, { filterHighD }) => filterHighD,
|
|
134
|
-
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
135
|
-
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
136
|
-
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
137
|
-
multiplierD: (_, { multiplierD }) => multiplierD,
|
|
138
|
-
textureA: (_, { textureA }) => textureA,
|
|
139
|
-
textureB: (_, { textureB }) => textureB,
|
|
140
|
-
textureC: (_, { textureC }) => textureC,
|
|
141
|
-
textureD: (_, { textureD }) => textureD
|
|
142
|
-
},
|
|
143
|
-
attributes: {
|
|
144
|
-
...commonConfig.attributes,
|
|
145
|
-
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
146
|
-
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
147
|
-
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC),
|
|
148
|
-
texCoordD: (_, { textureBoundsD }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsD)
|
|
149
|
-
},
|
|
150
|
-
framebuffer: regl.prop('fbo')
|
|
151
|
-
})
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function createCalcTileMultiAnalyze5Command (
|
|
155
|
-
regl,
|
|
156
|
-
commonConfig
|
|
157
|
-
) {
|
|
158
|
-
return regl({
|
|
159
|
-
...commonConfig,
|
|
160
|
-
vert: vertMulti5,
|
|
161
|
-
frag: fragMulti5Calc,
|
|
162
|
-
depth: {
|
|
163
|
-
enable: false
|
|
164
|
-
},
|
|
165
|
-
uniforms: {
|
|
166
|
-
...commonConfig.uniforms,
|
|
167
|
-
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
168
|
-
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
169
|
-
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
170
|
-
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
171
|
-
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
172
|
-
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
173
|
-
filterLowD: (_, { filterLowD }) => filterLowD,
|
|
174
|
-
filterHighD: (_, { filterHighD }) => filterHighD,
|
|
175
|
-
filterLowE: (_, { filterLowE }) => filterLowE,
|
|
176
|
-
filterHighE: (_, { filterHighE }) => filterHighE,
|
|
177
|
-
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
178
|
-
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
179
|
-
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
180
|
-
multiplierD: (_, { multiplierD }) => multiplierD,
|
|
181
|
-
multiplierE: (_, { multiplierE }) => multiplierE,
|
|
182
|
-
textureA: (_, { textureA }) => textureA,
|
|
183
|
-
textureB: (_, { textureB }) => textureB,
|
|
184
|
-
textureC: (_, { textureC }) => textureC,
|
|
185
|
-
textureD: (_, { textureD }) => textureD,
|
|
186
|
-
textureE: (_, { textureE }) => textureE
|
|
187
|
-
},
|
|
188
|
-
attributes: {
|
|
189
|
-
...commonConfig.attributes,
|
|
190
|
-
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
191
|
-
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
192
|
-
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC),
|
|
193
|
-
texCoordD: (_, { textureBoundsD }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsD),
|
|
194
|
-
texCoordE: (_, { textureBoundsE }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsE)
|
|
195
|
-
},
|
|
196
|
-
framebuffer: regl.prop('fbo')
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export function createCalcTileMultiAnalyze6Command (
|
|
201
|
-
regl,
|
|
202
|
-
commonConfig
|
|
203
|
-
) {
|
|
204
|
-
return regl({
|
|
205
|
-
...commonConfig,
|
|
206
|
-
vert: vertMulti6,
|
|
207
|
-
frag: fragMulti6Calc,
|
|
208
|
-
depth: {
|
|
209
|
-
enable: false
|
|
210
|
-
},
|
|
211
|
-
uniforms: {
|
|
212
|
-
...commonConfig.uniforms,
|
|
213
|
-
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
214
|
-
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
215
|
-
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
216
|
-
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
217
|
-
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
218
|
-
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
219
|
-
filterLowD: (_, { filterLowD }) => filterLowD,
|
|
220
|
-
filterHighD: (_, { filterHighD }) => filterHighD,
|
|
221
|
-
filterLowE: (_, { filterLowE }) => filterLowE,
|
|
222
|
-
filterHighE: (_, { filterHighE }) => filterHighE,
|
|
223
|
-
filterLowF: (_, { filterLowF }) => filterLowF,
|
|
224
|
-
filterHighF: (_, { filterHighF }) => filterHighF,
|
|
225
|
-
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
226
|
-
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
227
|
-
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
228
|
-
multiplierD: (_, { multiplierD }) => multiplierD,
|
|
229
|
-
multiplierE: (_, { multiplierE }) => multiplierE,
|
|
230
|
-
multiplierF: (_, { multiplierF }) => multiplierF,
|
|
231
|
-
textureA: (_, { textureA }) => textureA,
|
|
232
|
-
textureB: (_, { textureB }) => textureB,
|
|
233
|
-
textureC: (_, { textureC }) => textureC,
|
|
234
|
-
textureD: (_, { textureD }) => textureD,
|
|
235
|
-
textureE: (_, { textureE }) => textureE,
|
|
236
|
-
textureF: (_, { textureF }) => textureF
|
|
237
|
-
},
|
|
238
|
-
attributes: {
|
|
239
|
-
...commonConfig.attributes,
|
|
240
|
-
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
241
|
-
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
242
|
-
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC),
|
|
243
|
-
texCoordD: (_, { textureBoundsD }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsD),
|
|
244
|
-
texCoordE: (_, { textureBoundsE }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsE),
|
|
245
|
-
texCoordF: (_, { textureBoundsF }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsF)
|
|
246
|
-
},
|
|
247
|
-
framebuffer: regl.prop('fbo')
|
|
248
|
-
})
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export function createCalcTileDiffCommand (
|
|
252
|
-
regl,
|
|
253
|
-
commonConfig
|
|
254
|
-
) {
|
|
255
|
-
return regl({
|
|
256
|
-
...commonConfig,
|
|
257
|
-
vert: vertDouble,
|
|
258
|
-
frag: fragDiffCalc,
|
|
259
|
-
depth: {
|
|
260
|
-
enable: false
|
|
261
|
-
},
|
|
262
|
-
uniforms: {
|
|
263
|
-
...commonConfig.uniforms,
|
|
264
|
-
textureA: (_, { textureA }) => textureA,
|
|
265
|
-
textureB: (_, { textureB }) => textureB
|
|
266
|
-
},
|
|
267
|
-
attributes: {
|
|
268
|
-
...commonConfig.attributes,
|
|
269
|
-
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
270
|
-
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB)
|
|
271
|
-
},
|
|
272
|
-
framebuffer: regl.prop('fbo')
|
|
273
|
-
})
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export function createDrawResultCommand (
|
|
277
|
-
regl,
|
|
278
|
-
commonConfig,
|
|
279
|
-
fragMacros
|
|
280
|
-
) {
|
|
281
|
-
return regl({
|
|
282
|
-
...commonConfig,
|
|
283
|
-
vert: vertSingle,
|
|
284
|
-
frag: util.defineMacros(fragDrawResult, fragMacros),
|
|
285
|
-
depth: {
|
|
286
|
-
enable: false
|
|
287
|
-
},
|
|
288
|
-
uniforms: {
|
|
289
|
-
...commonConfig.uniforms,
|
|
290
|
-
scaleLength: regl.prop('scaleLength'),
|
|
291
|
-
sentinelLength: regl.prop('sentinelLength'),
|
|
292
|
-
scaleColormap: regl.prop('scaleColormap'),
|
|
293
|
-
sentinelColormap: regl.prop('sentinelColormap'),
|
|
294
|
-
texture: regl.prop('texture'),
|
|
295
|
-
aboveColor: regl.prop('aboveColor'),
|
|
296
|
-
belowColor: regl.prop('belowColor')
|
|
297
|
-
},
|
|
298
|
-
attributes: {
|
|
299
|
-
...commonConfig.attributes,
|
|
300
|
-
texCoord: [[0, 1], [1, 1], [0, 0], [1, 0]]
|
|
301
|
-
}
|
|
302
|
-
})
|
|
303
|
-
}
|
|
1
|
+
import vertSingle from '../shaders/vertex/single.js'
|
|
2
|
+
import vertDouble from '../shaders/vertex/double.js'
|
|
3
|
+
import vertMulti3 from '../shaders/vertex/multi3.js'
|
|
4
|
+
import vertMulti4 from '../shaders/vertex/multi4.js'
|
|
5
|
+
import vertMulti5 from '../shaders/vertex/multi5.js'
|
|
6
|
+
import vertMulti6 from '../shaders/vertex/multi6.js'
|
|
7
|
+
|
|
8
|
+
import fragMulti1Calc from '../shaders/fragment/multiAnalyze1Calc.js'
|
|
9
|
+
import fragMulti2Calc from '../shaders/fragment/multiAnalyze2Calc.js'
|
|
10
|
+
import fragMulti3Calc from '../shaders/fragment/multiAnalyze3Calc.js'
|
|
11
|
+
import fragMulti4Calc from '../shaders/fragment/multiAnalyze4Calc.js'
|
|
12
|
+
import fragMulti5Calc from '../shaders/fragment/multiAnalyze5Calc.js'
|
|
13
|
+
import fragMulti6Calc from '../shaders/fragment/multiAnalyze6Calc.js'
|
|
14
|
+
import fragDiffCalc from '../shaders/fragment/diffCalc.js'
|
|
15
|
+
import fragDrawResult from '../shaders/fragment/drawResult.js'
|
|
16
|
+
|
|
17
|
+
import * as util from '../util'
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export function createCalcTileMultiAnalyze1Command (
|
|
21
|
+
regl,
|
|
22
|
+
commonConfig
|
|
23
|
+
) {
|
|
24
|
+
return regl({
|
|
25
|
+
...commonConfig,
|
|
26
|
+
vert: vertSingle,
|
|
27
|
+
frag: fragMulti1Calc,
|
|
28
|
+
depth: {
|
|
29
|
+
enable: false
|
|
30
|
+
},
|
|
31
|
+
uniforms: {
|
|
32
|
+
...commonConfig.uniforms,
|
|
33
|
+
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
34
|
+
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
35
|
+
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
36
|
+
textureA: (_, { textureA }) => textureA
|
|
37
|
+
},
|
|
38
|
+
attributes: {
|
|
39
|
+
...commonConfig.attributes,
|
|
40
|
+
texCoord: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA)
|
|
41
|
+
},
|
|
42
|
+
framebuffer: regl.prop('fbo')
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function createCalcTileMultiAnalyze2Command (
|
|
47
|
+
regl,
|
|
48
|
+
commonConfig
|
|
49
|
+
) {
|
|
50
|
+
return regl({
|
|
51
|
+
...commonConfig,
|
|
52
|
+
vert: vertDouble,
|
|
53
|
+
frag: fragMulti2Calc,
|
|
54
|
+
depth: {
|
|
55
|
+
enable: false
|
|
56
|
+
},
|
|
57
|
+
uniforms: {
|
|
58
|
+
...commonConfig.uniforms,
|
|
59
|
+
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
60
|
+
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
61
|
+
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
62
|
+
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
63
|
+
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
64
|
+
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
65
|
+
textureA: (_, { textureA }) => textureA,
|
|
66
|
+
textureB: (_, { textureB }) => textureB
|
|
67
|
+
},
|
|
68
|
+
attributes: {
|
|
69
|
+
...commonConfig.attributes,
|
|
70
|
+
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
71
|
+
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB)
|
|
72
|
+
},
|
|
73
|
+
framebuffer: regl.prop('fbo')
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function createCalcTileMultiAnalyze3Command (
|
|
78
|
+
regl,
|
|
79
|
+
commonConfig
|
|
80
|
+
) {
|
|
81
|
+
return regl({
|
|
82
|
+
...commonConfig,
|
|
83
|
+
vert: vertMulti3,
|
|
84
|
+
frag: fragMulti3Calc,
|
|
85
|
+
depth: {
|
|
86
|
+
enable: false
|
|
87
|
+
},
|
|
88
|
+
uniforms: {
|
|
89
|
+
...commonConfig.uniforms,
|
|
90
|
+
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
91
|
+
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
92
|
+
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
93
|
+
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
94
|
+
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
95
|
+
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
96
|
+
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
97
|
+
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
98
|
+
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
99
|
+
textureA: (_, { textureA }) => textureA,
|
|
100
|
+
textureB: (_, { textureB }) => textureB,
|
|
101
|
+
textureC: (_, { textureC }) => textureC
|
|
102
|
+
},
|
|
103
|
+
attributes: {
|
|
104
|
+
...commonConfig.attributes,
|
|
105
|
+
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
106
|
+
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
107
|
+
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC)
|
|
108
|
+
},
|
|
109
|
+
framebuffer: regl.prop('fbo')
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function createCalcTileMultiAnalyze4Command (
|
|
114
|
+
regl,
|
|
115
|
+
commonConfig
|
|
116
|
+
) {
|
|
117
|
+
return regl({
|
|
118
|
+
...commonConfig,
|
|
119
|
+
vert: vertMulti4,
|
|
120
|
+
frag: fragMulti4Calc,
|
|
121
|
+
depth: {
|
|
122
|
+
enable: false
|
|
123
|
+
},
|
|
124
|
+
uniforms: {
|
|
125
|
+
...commonConfig.uniforms,
|
|
126
|
+
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
127
|
+
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
128
|
+
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
129
|
+
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
130
|
+
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
131
|
+
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
132
|
+
filterLowD: (_, { filterLowD }) => filterLowD,
|
|
133
|
+
filterHighD: (_, { filterHighD }) => filterHighD,
|
|
134
|
+
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
135
|
+
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
136
|
+
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
137
|
+
multiplierD: (_, { multiplierD }) => multiplierD,
|
|
138
|
+
textureA: (_, { textureA }) => textureA,
|
|
139
|
+
textureB: (_, { textureB }) => textureB,
|
|
140
|
+
textureC: (_, { textureC }) => textureC,
|
|
141
|
+
textureD: (_, { textureD }) => textureD
|
|
142
|
+
},
|
|
143
|
+
attributes: {
|
|
144
|
+
...commonConfig.attributes,
|
|
145
|
+
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
146
|
+
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
147
|
+
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC),
|
|
148
|
+
texCoordD: (_, { textureBoundsD }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsD)
|
|
149
|
+
},
|
|
150
|
+
framebuffer: regl.prop('fbo')
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function createCalcTileMultiAnalyze5Command (
|
|
155
|
+
regl,
|
|
156
|
+
commonConfig
|
|
157
|
+
) {
|
|
158
|
+
return regl({
|
|
159
|
+
...commonConfig,
|
|
160
|
+
vert: vertMulti5,
|
|
161
|
+
frag: fragMulti5Calc,
|
|
162
|
+
depth: {
|
|
163
|
+
enable: false
|
|
164
|
+
},
|
|
165
|
+
uniforms: {
|
|
166
|
+
...commonConfig.uniforms,
|
|
167
|
+
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
168
|
+
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
169
|
+
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
170
|
+
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
171
|
+
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
172
|
+
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
173
|
+
filterLowD: (_, { filterLowD }) => filterLowD,
|
|
174
|
+
filterHighD: (_, { filterHighD }) => filterHighD,
|
|
175
|
+
filterLowE: (_, { filterLowE }) => filterLowE,
|
|
176
|
+
filterHighE: (_, { filterHighE }) => filterHighE,
|
|
177
|
+
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
178
|
+
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
179
|
+
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
180
|
+
multiplierD: (_, { multiplierD }) => multiplierD,
|
|
181
|
+
multiplierE: (_, { multiplierE }) => multiplierE,
|
|
182
|
+
textureA: (_, { textureA }) => textureA,
|
|
183
|
+
textureB: (_, { textureB }) => textureB,
|
|
184
|
+
textureC: (_, { textureC }) => textureC,
|
|
185
|
+
textureD: (_, { textureD }) => textureD,
|
|
186
|
+
textureE: (_, { textureE }) => textureE
|
|
187
|
+
},
|
|
188
|
+
attributes: {
|
|
189
|
+
...commonConfig.attributes,
|
|
190
|
+
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
191
|
+
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
192
|
+
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC),
|
|
193
|
+
texCoordD: (_, { textureBoundsD }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsD),
|
|
194
|
+
texCoordE: (_, { textureBoundsE }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsE)
|
|
195
|
+
},
|
|
196
|
+
framebuffer: regl.prop('fbo')
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function createCalcTileMultiAnalyze6Command (
|
|
201
|
+
regl,
|
|
202
|
+
commonConfig
|
|
203
|
+
) {
|
|
204
|
+
return regl({
|
|
205
|
+
...commonConfig,
|
|
206
|
+
vert: vertMulti6,
|
|
207
|
+
frag: fragMulti6Calc,
|
|
208
|
+
depth: {
|
|
209
|
+
enable: false
|
|
210
|
+
},
|
|
211
|
+
uniforms: {
|
|
212
|
+
...commonConfig.uniforms,
|
|
213
|
+
filterLowA: (_, { filterLowA }) => filterLowA,
|
|
214
|
+
filterHighA: (_, { filterHighA }) => filterHighA,
|
|
215
|
+
filterLowB: (_, { filterLowB }) => filterLowB,
|
|
216
|
+
filterHighB: (_, { filterHighB }) => filterHighB,
|
|
217
|
+
filterLowC: (_, { filterLowC }) => filterLowC,
|
|
218
|
+
filterHighC: (_, { filterHighC }) => filterHighC,
|
|
219
|
+
filterLowD: (_, { filterLowD }) => filterLowD,
|
|
220
|
+
filterHighD: (_, { filterHighD }) => filterHighD,
|
|
221
|
+
filterLowE: (_, { filterLowE }) => filterLowE,
|
|
222
|
+
filterHighE: (_, { filterHighE }) => filterHighE,
|
|
223
|
+
filterLowF: (_, { filterLowF }) => filterLowF,
|
|
224
|
+
filterHighF: (_, { filterHighF }) => filterHighF,
|
|
225
|
+
multiplierA: (_, { multiplierA }) => multiplierA,
|
|
226
|
+
multiplierB: (_, { multiplierB }) => multiplierB,
|
|
227
|
+
multiplierC: (_, { multiplierC }) => multiplierC,
|
|
228
|
+
multiplierD: (_, { multiplierD }) => multiplierD,
|
|
229
|
+
multiplierE: (_, { multiplierE }) => multiplierE,
|
|
230
|
+
multiplierF: (_, { multiplierF }) => multiplierF,
|
|
231
|
+
textureA: (_, { textureA }) => textureA,
|
|
232
|
+
textureB: (_, { textureB }) => textureB,
|
|
233
|
+
textureC: (_, { textureC }) => textureC,
|
|
234
|
+
textureD: (_, { textureD }) => textureD,
|
|
235
|
+
textureE: (_, { textureE }) => textureE,
|
|
236
|
+
textureF: (_, { textureF }) => textureF
|
|
237
|
+
},
|
|
238
|
+
attributes: {
|
|
239
|
+
...commonConfig.attributes,
|
|
240
|
+
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
241
|
+
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB),
|
|
242
|
+
texCoordC: (_, { textureBoundsC }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsC),
|
|
243
|
+
texCoordD: (_, { textureBoundsD }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsD),
|
|
244
|
+
texCoordE: (_, { textureBoundsE }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsE),
|
|
245
|
+
texCoordF: (_, { textureBoundsF }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsF)
|
|
246
|
+
},
|
|
247
|
+
framebuffer: regl.prop('fbo')
|
|
248
|
+
})
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export function createCalcTileDiffCommand (
|
|
252
|
+
regl,
|
|
253
|
+
commonConfig
|
|
254
|
+
) {
|
|
255
|
+
return regl({
|
|
256
|
+
...commonConfig,
|
|
257
|
+
vert: vertDouble,
|
|
258
|
+
frag: fragDiffCalc,
|
|
259
|
+
depth: {
|
|
260
|
+
enable: false
|
|
261
|
+
},
|
|
262
|
+
uniforms: {
|
|
263
|
+
...commonConfig.uniforms,
|
|
264
|
+
textureA: (_, { textureA }) => textureA,
|
|
265
|
+
textureB: (_, { textureB }) => textureB
|
|
266
|
+
},
|
|
267
|
+
attributes: {
|
|
268
|
+
...commonConfig.attributes,
|
|
269
|
+
texCoordA: (_, { textureBoundsA }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsA),
|
|
270
|
+
texCoordB: (_, { textureBoundsB }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsB)
|
|
271
|
+
},
|
|
272
|
+
framebuffer: regl.prop('fbo')
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function createDrawResultCommand (
|
|
277
|
+
regl,
|
|
278
|
+
commonConfig,
|
|
279
|
+
fragMacros
|
|
280
|
+
) {
|
|
281
|
+
return regl({
|
|
282
|
+
...commonConfig,
|
|
283
|
+
vert: vertSingle,
|
|
284
|
+
frag: util.defineMacros(fragDrawResult, fragMacros),
|
|
285
|
+
depth: {
|
|
286
|
+
enable: false
|
|
287
|
+
},
|
|
288
|
+
uniforms: {
|
|
289
|
+
...commonConfig.uniforms,
|
|
290
|
+
scaleLength: regl.prop('scaleLength'),
|
|
291
|
+
sentinelLength: regl.prop('sentinelLength'),
|
|
292
|
+
scaleColormap: regl.prop('scaleColormap'),
|
|
293
|
+
sentinelColormap: regl.prop('sentinelColormap'),
|
|
294
|
+
texture: regl.prop('texture'),
|
|
295
|
+
aboveColor: regl.prop('aboveColor'),
|
|
296
|
+
belowColor: regl.prop('belowColor')
|
|
297
|
+
},
|
|
298
|
+
attributes: {
|
|
299
|
+
...commonConfig.attributes,
|
|
300
|
+
texCoord: [[0, 1], [1, 1], [0, 0], [1, 0]]
|
|
301
|
+
}
|
|
302
|
+
})
|
|
303
|
+
}
|