@mapcatch/util 2.0.6 → 2.0.8

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.
Files changed (123) hide show
  1. package/dist/catchUtil.min.cjs.js +2928 -0
  2. package/dist/catchUtil.min.esm.js +44502 -42814
  3. package/dist/catchUtil.min.js +248 -248
  4. package/package.json +11 -2
  5. package/src/constants/annotation_color.js +0 -7
  6. package/src/constants/annotation_draw_style.js +0 -228
  7. package/src/constants/annotation_label_style.js +0 -76
  8. package/src/constants/annotation_style.js +0 -118
  9. package/src/constants/bmap_types.js +0 -44
  10. package/src/constants/cameras.js +0 -5
  11. package/src/constants/crs.js +0 -42099
  12. package/src/constants/crs_types.js +0 -22
  13. package/src/constants/default_layers.js +0 -149
  14. package/src/constants/dsm_colors.js +0 -10
  15. package/src/constants/error_codes.js +0 -44
  16. package/src/constants/height_colors.js +0 -1
  17. package/src/constants/index.js +0 -20
  18. package/src/constants/layer_folders.js +0 -6
  19. package/src/constants/layer_groups.js +0 -34
  20. package/src/constants/layer_groups_multispectral.js +0 -34
  21. package/src/constants/layer_icons.js +0 -19
  22. package/src/constants/map_style.js +0 -11
  23. package/src/constants/measurement_fields.js +0 -208
  24. package/src/constants/task_params.js +0 -33
  25. package/src/constants/tools.js +0 -20
  26. package/src/event/event.js +0 -191
  27. package/src/event/event_bus.js +0 -5
  28. package/src/event/index.js +0 -2
  29. package/src/gl-operations/constants.js +0 -9
  30. package/src/gl-operations/default_options.js +0 -98
  31. package/src/gl-operations/index.js +0 -533
  32. package/src/gl-operations/reglCommands/contours.js +0 -27
  33. package/src/gl-operations/reglCommands/default.js +0 -46
  34. package/src/gl-operations/reglCommands/hillshading.js +0 -340
  35. package/src/gl-operations/reglCommands/index.js +0 -6
  36. package/src/gl-operations/reglCommands/multiLayers.js +0 -303
  37. package/src/gl-operations/reglCommands/transitions.js +0 -111
  38. package/src/gl-operations/reglCommands/util.js +0 -71
  39. package/src/gl-operations/renderer.js +0 -210
  40. package/src/gl-operations/shaders/fragment/convertDem.js +0 -26
  41. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +0 -55
  42. package/src/gl-operations/shaders/fragment/diffCalc.js +0 -34
  43. package/src/gl-operations/shaders/fragment/drawResult.js +0 -47
  44. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +0 -79
  45. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +0 -60
  46. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +0 -31
  47. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +0 -61
  48. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +0 -27
  49. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +0 -26
  50. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +0 -54
  51. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +0 -81
  52. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +0 -55
  53. package/src/gl-operations/shaders/fragment/interpolateColor.js +0 -66
  54. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +0 -50
  55. package/src/gl-operations/shaders/fragment/interpolateValue.js +0 -137
  56. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +0 -36
  57. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +0 -46
  58. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +0 -54
  59. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +0 -62
  60. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +0 -70
  61. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +0 -78
  62. package/src/gl-operations/shaders/fragment/single.js +0 -93
  63. package/src/gl-operations/shaders/transform.js +0 -22
  64. package/src/gl-operations/shaders/util/computeColor.glsl +0 -85
  65. package/src/gl-operations/shaders/util/getTexelValue.glsl +0 -10
  66. package/src/gl-operations/shaders/util/isCloseEnough.glsl +0 -9
  67. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +0 -18
  68. package/src/gl-operations/shaders/vertex/double.js +0 -17
  69. package/src/gl-operations/shaders/vertex/multi3.js +0 -20
  70. package/src/gl-operations/shaders/vertex/multi4.js +0 -23
  71. package/src/gl-operations/shaders/vertex/multi5.js +0 -26
  72. package/src/gl-operations/shaders/vertex/multi6.js +0 -29
  73. package/src/gl-operations/shaders/vertex/single.js +0 -13
  74. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +0 -12
  75. package/src/gl-operations/texture_manager.js +0 -141
  76. package/src/gl-operations/util.js +0 -336
  77. package/src/index.js +0 -20
  78. package/src/measure/index.js +0 -209
  79. package/src/measure/tile_cache.js +0 -88
  80. package/src/mvs/index.js +0 -26
  81. package/src/mvs/protos/index.js +0 -12
  82. package/src/mvs/protos/proto_10.js +0 -155
  83. package/src/observation_pretict.js +0 -168
  84. package/src/photo-parser/exif/gps_tags.js +0 -33
  85. package/src/photo-parser/exif/ifd1_tags.js +0 -22
  86. package/src/photo-parser/exif/index.js +0 -143
  87. package/src/photo-parser/exif/parse_image.js +0 -290
  88. package/src/photo-parser/exif/string_values.js +0 -137
  89. package/src/photo-parser/exif/tags.js +0 -75
  90. package/src/photo-parser/exif/tiff_tags.js +0 -35
  91. package/src/photo-parser/exif/util.js +0 -103
  92. package/src/photo-parser/image-size/detector.js +0 -24
  93. package/src/photo-parser/image-size/fromFile.js +0 -55
  94. package/src/photo-parser/image-size/index.js +0 -2
  95. package/src/photo-parser/image-size/lookup.js +0 -37
  96. package/src/photo-parser/image-size/types/bmp.js +0 -10
  97. package/src/photo-parser/image-size/types/cur.js +0 -16
  98. package/src/photo-parser/image-size/types/dds.js +0 -10
  99. package/src/photo-parser/image-size/types/gif.js +0 -11
  100. package/src/photo-parser/image-size/types/heif.js +0 -35
  101. package/src/photo-parser/image-size/types/icns.js +0 -112
  102. package/src/photo-parser/image-size/types/ico.js +0 -74
  103. package/src/photo-parser/image-size/types/index.js +0 -43
  104. package/src/photo-parser/image-size/types/j2c.js +0 -11
  105. package/src/photo-parser/image-size/types/jp2.js +0 -22
  106. package/src/photo-parser/image-size/types/jpg.js +0 -157
  107. package/src/photo-parser/image-size/types/ktx.js +0 -18
  108. package/src/photo-parser/image-size/types/png.js +0 -36
  109. package/src/photo-parser/image-size/types/pnm.js +0 -74
  110. package/src/photo-parser/image-size/types/psd.js +0 -10
  111. package/src/photo-parser/image-size/types/svg.js +0 -100
  112. package/src/photo-parser/image-size/types/tga.js +0 -14
  113. package/src/photo-parser/image-size/types/tiff.js +0 -92
  114. package/src/photo-parser/image-size/types/utils.js +0 -83
  115. package/src/photo-parser/image-size/types/webp.js +0 -67
  116. package/src/photo-parser/index.js +0 -185
  117. package/src/report/annotations_report.js +0 -446
  118. package/src/report/index.js +0 -2
  119. package/src/report/map_util.js +0 -81
  120. package/src/report/pdf_creator.js +0 -247
  121. package/src/report/report.js +0 -581
  122. package/src/transform.js +0 -207
  123. package/src/util.js +0 -671
@@ -1,340 +0,0 @@
1
- import vertSingle from '../shaders/vertex/single.js'
2
- import vertDouble from '../shaders/vertex/double.js'
3
- import vertSingleNotTransformed from '../shaders/vertex/singleNotTransformed.js'
4
-
5
- import fragSingle from '../shaders/fragment/single.js'
6
- import fragHsPregen from '../shaders/fragment/hillshading/hsPregen.js'
7
- import fragHsAdvMergeAndScaleTiles from '../shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js'
8
- import fragHsAdvNormals from '../shaders/fragment/hillshading/hsAdvNormals.js'
9
- import fragHsAdvDirectLight from '../shaders/fragment/hillshading/hsAdvDirect.js'
10
- import fragHsAdvSoftShadows from '../shaders/fragment/hillshading/hsAdvSoftShadows.js'
11
- import fragHsAdvAmbientShadows from '../shaders/fragment/hillshading/hsAdvAmbientShadows.js'
12
- import fragHsAdvFinalColorscale from '../shaders/fragment/hillshading/hsAdvFinalColorscale.js'
13
- import fragHsAdvFinalBaselayer from '../shaders/fragment/hillshading/hsAdvFinalBaselayer.js'
14
- import fragHsAdvSmooth from '../shaders/fragment/hillshading/hsAdvSmooth.js'
15
-
16
- import {
17
- DEG2RAD,
18
- SLOPEFACTOR
19
- } from '../constants'
20
-
21
- import * as util from '../util'
22
-
23
- const littleEndian = util.machineIsLittleEndian()
24
-
25
- /**
26
- * The resulting Regl DrawCommand is used to draw a single tile. The fragment shader decodes the
27
- * Float32 value of a pixel and colorizes it with the given color scale (and/or sentinel values).
28
- * Hillshading is applied with a simple and fast algorithm
29
- */
30
- export function createDrawTileHsSimpleCommand (regl, commonConfig, fragMacros) {
31
- return regl({
32
- ...commonConfig,
33
- vert: vertSingle,
34
- frag: util.defineMacros(fragSingle, fragMacros),
35
- uniforms: {
36
- ...commonConfig.uniforms,
37
- scaleLength: regl.prop('scaleLength'),
38
- sentinelLength: regl.prop('sentinelLength'),
39
- scaleColormap: regl.prop('scaleColormap'),
40
- sentinelColormap: regl.prop('sentinelColormap'),
41
- aboveColor: regl.prop('aboveColor'),
42
- belowColor: regl.prop('belowColor'),
43
- texture: (_, { texture }) => texture,
44
- enableSimpleHillshade: (_, { enableSimpleHillshade }) => enableSimpleHillshade,
45
- azimuth: (_, { azimuth }) => azimuth,
46
- altitude: (_, { altitude }) => altitude,
47
- slopescale: (_, { slopescale }) => slopescale,
48
- deg2rad: DEG2RAD,
49
- slopeFactor: SLOPEFACTOR,
50
- offset: (_, { offset }) => offset,
51
- textureBounds: (_, { textureBounds }) => {
52
- return [
53
- [textureBounds[0].x],
54
- [textureBounds[0].y],
55
- [textureBounds[1].x],
56
- [textureBounds[1].y]
57
- ]
58
- },
59
- textureSize: (_, { textureSize }) => textureSize,
60
- tileSize: (_, { tileSize }) => tileSize
61
- },
62
- attributes: {
63
- ...commonConfig.attributes,
64
- texCoord: (_, { textureBounds }) => util.getTexCoordVerticesTriangleStripQuad(textureBounds)
65
- }
66
- })
67
- }
68
-
69
- /**
70
- * The resulting Regl DrawCommand is used to draw a single tile. The fragment shader decodes the
71
- * Float32 value of a pixel and colorizes it with the given color scale (and/or sentinel values).
72
- * Hillshading is applied from a pre-generated texture
73
- */
74
- export function createDrawTileHsPregenCommand (regl, commonConfig, fragMacros) {
75
- return regl({
76
- ...commonConfig,
77
- vert: vertDouble,
78
- frag: util.defineMacros(fragHsPregen, fragMacros),
79
- uniforms: {
80
- ...commonConfig.uniforms,
81
- scaleLength: regl.prop('scaleLength'),
82
- sentinelLength: regl.prop('sentinelLength'),
83
- scaleColormap: regl.prop('scaleColormap'),
84
- sentinelColormap: regl.prop('sentinelColormap'),
85
- aboveColor: regl.prop('aboveColor'),
86
- belowColor: regl.prop('belowColor'),
87
- texture: (_, { texture }) => texture,
88
- hillshadePregenTexture: (_, { hillshadePregenTexture }) => hillshadePregenTexture
89
- },
90
- attributes: {
91
- ...commonConfig.attributes,
92
- texCoordA: (_, { textureBounds }) => util.getTexCoordVerticesTriangleStripQuad(textureBounds),
93
- texCoordB: (_, { textureBoundsHs }) => util.getTexCoordVerticesTriangleStripQuad(textureBoundsHs)
94
- }
95
- })
96
- }
97
-
98
-
99
- /**
100
- * The resulting Regl DrawCommand is used to get the float values from the 3x3
101
- * adjacent tiles. The float values can be scaled to adjust the hillshading.
102
- * It will be saved to a framebuffer and is used as an input to advanced hillshading
103
- */
104
- export function createHsAdvMergeAndScaleTiles (regl) {
105
- return regl({
106
- vert: vertSingleNotTransformed,
107
- frag: fragHsAdvMergeAndScaleTiles,
108
- uniforms: {
109
- littleEndian: littleEndian,
110
- nodataValue: regl.prop('nodataValue'),
111
- texture: regl.prop('texture'),
112
- floatScale: regl.prop('floatScale')
113
- },
114
- attributes: {
115
- // 18 triangles = 9 tiles
116
- position: [
117
- [-1, 1], [-1 / 3, 1], [-1, 1 / 3], [-1 / 3, 1 / 3], [-1 / 3, 1], [-1, 1 / 3],
118
- [-1, 1 / 3], [-1 / 3, 1 / 3], [-1, -1 / 3], [-1 / 3, -1 / 3], [-1 / 3, 1 / 3], [-1, -1 / 3],
119
- [-1, -1 / 3], [-1 / 3, -1 / 3], [-1, -1], [-1 / 3, -1], [-1 / 3, -1 / 3], [-1, -1],
120
- [-1 / 3, 1], [1 / 3, 1], [-1 / 3, 1 / 3], [1 / 3, 1 / 3], [1 / 3, 1], [-1 / 3, 1 / 3],
121
- [-1 / 3, 1 / 3], [1 / 3, 1 / 3], [-1 / 3, -1 / 3], [1 / 3, -1 / 3], [1 / 3, 1 / 3], [-1 / 3, -1 / 3],
122
- [-1 / 3, -1 / 3], [1 / 3, -1 / 3], [-1 / 3, -1], [1 / 3, -1], [1 / 3, -1 / 3], [-1 / 3, -1],
123
- [1 / 3, 1], [1, 1], [1 / 3, 1 / 3], [1, 1 / 3], [1, 1], [1 / 3, 1 / 3],
124
- [1 / 3, 1 / 3], [1, 1 / 3], [1 / 3, -1 / 3], [1, -1 / 3], [1, 1 / 3], [1 / 3, -1 / 3],
125
- [1 / 3, -1 / 3], [1, -1 / 3], [1 / 3, -1], [1, -1], [1, -1 / 3], [1 / 3, -1]
126
- ],
127
- texCoord: regl.prop('texCoord')
128
- },
129
- depth: { enable: false },
130
- primitive: 'triangles',
131
- count: 54,
132
- viewport: (_, { canvasSize: [width, height] }) => ({ width, height }),
133
- framebuffer: regl.prop('fbo')
134
- })
135
- }
136
-
137
-
138
- /**
139
- * The resulting Regl DrawCommand is for using a convolution kernel to smooth the input data.
140
- * Currently hard-coded the kernel and positions in the shader to reduce number of uniforms.
141
- * TODO: Merge with contours function
142
- */
143
- export function createHsAdvSmoothCommand (regl, commonConfig) {
144
- return regl({
145
- ...commonConfig,
146
- vert: vertSingleNotTransformed,
147
- frag: fragHsAdvSmooth,
148
- uniforms: {
149
- ...commonConfig.uniforms,
150
- tInput: regl.prop('tInput'),
151
- textureSize: regl.prop('textureSize'),
152
- kernelSize: regl.prop('kernelSize')
153
- },
154
- attributes: {
155
- position: [[-1, 1], [1, 1], [-1, -1], [1, -1]],
156
- texCoord: [[0, 1], [1, 1], [0, 0], [1, 0]]
157
- },
158
- framebuffer: regl.prop('fbo')
159
- })
160
- }
161
-
162
-
163
- /**
164
- * The resulting Regl DrawCommand is used to calculate the normals.
165
- * It is used as an input to advanced hillshading
166
- */
167
- export function createHsAdvCalcNormals (
168
- regl,
169
- commonConfig
170
- ) {
171
- return regl({
172
- ...commonConfig,
173
- vert: vertSingleNotTransformed,
174
- frag: fragHsAdvNormals,
175
- uniforms: {
176
- ...commonConfig.uniforms,
177
- tInput: regl.prop('tInput'),
178
- pixelScale: regl.prop('pixelScale'),
179
- onePixel: regl.prop('onePixel')
180
- },
181
- attributes: {
182
- position: [[-1, 1], [1, 1], [-1, -1], [1, -1]],
183
- texCoord: [[0, 1], [1, 1], [0, 0], [1, 0]]
184
- },
185
- framebuffer: regl.prop('fbo')
186
- })
187
- }
188
-
189
- /**
190
- * The resulting Regl DrawCommand is used to show hillshading without shadows.
191
- * Not currently used
192
- */
193
- export function createHsAdvDirectLightning (
194
- regl,
195
- commonConfig
196
- ) {
197
- return regl({
198
- ...commonConfig,
199
- vert: vertSingleNotTransformed,
200
- frag: fragHsAdvDirectLight,
201
- uniforms: {
202
- ...commonConfig.uniforms,
203
- scaleLength: regl.prop('scaleLength'),
204
- sentinelLength: regl.prop('sentinelLength'),
205
- scaleColormap: regl.prop('scaleColormap'),
206
- sentinelColormap: regl.prop('sentinelColormap'),
207
- tInput: regl.prop('tInput'),
208
- tNormal: regl.prop('tNormal'),
209
- floatScale: regl.prop('floatScale'),
210
- sunDirection: regl.prop('sunDirection'),
211
- aboveColor: regl.prop('aboveColor'),
212
- belowColor: regl.prop('belowColor')
213
- },
214
- attributes: {
215
- position: [[-1, 1], [1, 1], [-1, -1], [1, -1]],
216
- texCoord: [[0, 1], [1, 1], [0, 0], [1, 0]]
217
- }
218
- })
219
- }
220
-
221
- /**
222
- * The resulting Regl DrawCommand is used to calculate soft shadows.
223
- */
224
- export function createHsAdvSoftShadows (
225
- regl,
226
- commonConfig
227
- ) {
228
- return regl({
229
- ...commonConfig,
230
- vert: vertSingleNotTransformed,
231
- frag: fragHsAdvSoftShadows,
232
- uniforms: {
233
- ...commonConfig.uniforms,
234
- tInput: regl.prop('tInput'),
235
- tNormal: regl.prop('tNormal'),
236
- tSrc: regl.prop('tSrc'),
237
- softIterations: regl.prop('softIterations'),
238
- pixelScale: regl.prop('pixelScale'),
239
- resolution: regl.prop('resolution'),
240
- sunDirection: regl.prop('sunDirection')
241
- },
242
- attributes: {
243
- position: [[-1, 1], [1, 1], [-1, -1], [1, -1]],
244
- texCoord: [[1 / 3, 2 / 3], [2 / 3, 2 / 3], [1 / 3, 1 / 3], [2 / 3, 1 / 3]]
245
- },
246
- framebuffer: regl.prop('fbo')
247
- })
248
- }
249
-
250
- /**
251
- * The resulting Regl DrawCommand is used to calculate ambient lighting.
252
- */
253
- export function createHsAdvAmbientShadows (
254
- regl,
255
- commonConfig
256
- ) {
257
- return regl({
258
- ...commonConfig,
259
- vert: vertSingleNotTransformed,
260
- frag: fragHsAdvAmbientShadows,
261
- uniforms: {
262
- ...commonConfig.uniforms,
263
- tInput: regl.prop('tInput'),
264
- tNormal: regl.prop('tNormal'),
265
- tSrc: regl.prop('tSrc'),
266
- ambientIterations: regl.prop('ambientIterations'),
267
- pixelScale: regl.prop('pixelScale'),
268
- resolution: regl.prop('resolution'),
269
- direction: regl.prop('direction')
270
- },
271
- attributes: {
272
- position: [[-1, 1], [1, 1], [-1, -1], [1, -1]],
273
- texCoord: [[1 / 3, 2 / 3], [2 / 3, 2 / 3], [1 / 3, 1 / 3], [2 / 3, 1 / 3]]
274
- },
275
- framebuffer: regl.prop('fbo')
276
- })
277
- }
278
-
279
- /**
280
- * The resulting Regl DrawCommand is used to combine soft and ambient shading,
281
- * use the colormap on the input floats and apply the hillshading.
282
- */
283
- export function createHsAdvFinalColorscale (
284
- regl,
285
- commonConfig
286
- ) {
287
- return regl({
288
- ...commonConfig,
289
- vert: vertDouble,
290
- frag: fragHsAdvFinalColorscale,
291
- uniforms: {
292
- ...commonConfig.uniforms,
293
- scaleLength: regl.prop('scaleLength'),
294
- sentinelLength: regl.prop('sentinelLength'),
295
- scaleColormap: regl.prop('scaleColormap'),
296
- sentinelColormap: regl.prop('sentinelColormap'),
297
- tInput: regl.prop('tInput'),
298
- tSoftShadow: regl.prop('tSoftShadow'),
299
- tAmbient: regl.prop('tAmbient'),
300
- floatScale: regl.prop('floatScale'),
301
- finalSoftMultiplier: regl.prop('finalSoftMultiplier'),
302
- finalAmbientMultiplier: regl.prop('finalAmbientMultiplier'),
303
- aboveColor: regl.prop('aboveColor'),
304
- belowColor: regl.prop('belowColor')
305
- },
306
- attributes: {
307
- ...commonConfig.attributes,
308
- texCoordA: [[1 / 3, 2 / 3], [2 / 3, 2 / 3], [1 / 3, 1 / 3], [2 / 3, 1 / 3]],
309
- texCoordB: [[0, 1], [1, 1], [0, 0], [1, 0]]
310
- }
311
- })
312
- }
313
-
314
- /**
315
- * The resulting Regl DrawCommand is used to combine soft and ambient shading,
316
- * use the baselayer tile and apply the hillshading.
317
- */
318
- export function createHsAdvFinalBaselayer (
319
- regl,
320
- commonConfig
321
- ) {
322
- return regl({
323
- ...commonConfig,
324
- vert: vertDouble,
325
- frag: fragHsAdvFinalBaselayer,
326
- uniforms: {
327
- ...commonConfig.uniforms,
328
- tBase: regl.prop('tBase'),
329
- tSoftShadow: regl.prop('tSoftShadow'),
330
- tAmbient: regl.prop('tAmbient'),
331
- finalSoftMultiplier: regl.prop('finalSoftMultiplier'),
332
- finalAmbientMultiplier: regl.prop('finalAmbientMultiplier')
333
- },
334
- attributes: {
335
- ...commonConfig.attributes,
336
- texCoordA: regl.prop('baseTexCoords'),
337
- texCoordB: [[0, 1], [1, 1], [0, 0], [1, 0]]
338
- }
339
- })
340
- }
@@ -1,6 +0,0 @@
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 +0,0 @@
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
- }