@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.
Files changed (68) hide show
  1. package/.eslintrc.js +54 -0
  2. package/.husky/pre-commit +1 -0
  3. package/.prettierrc +4 -0
  4. package/.vscode/settings.json +2 -0
  5. package/README.md +44 -0
  6. package/debug/app.js +26 -0
  7. package/debug/index.html +55 -0
  8. package/debug/libs/vue.global.js +16159 -0
  9. package/debug/my_icon.png +0 -0
  10. package/docs/Catolog.md +24 -0
  11. package/docs/Constant.md +92 -0
  12. package/docs/Event.md +90 -0
  13. package/docs/Util.md +345 -0
  14. package/package.json +21 -1
  15. package/src/constants/crs.js +42098 -42098
  16. package/src/constants/default_layers.js +42 -94
  17. package/src/gl-operations/constants.js +9 -9
  18. package/src/gl-operations/default_options.js +97 -97
  19. package/src/gl-operations/index.js +532 -532
  20. package/src/gl-operations/reglCommands/contours.js +27 -27
  21. package/src/gl-operations/reglCommands/default.js +45 -45
  22. package/src/gl-operations/reglCommands/hillshading.js +340 -340
  23. package/src/gl-operations/reglCommands/index.js +6 -6
  24. package/src/gl-operations/reglCommands/multiLayers.js +303 -303
  25. package/src/gl-operations/reglCommands/transitions.js +111 -111
  26. package/src/gl-operations/reglCommands/util.js +71 -71
  27. package/src/gl-operations/renderer.js +209 -209
  28. package/src/gl-operations/shaders/fragment/convertDem.js +25 -25
  29. package/src/gl-operations/shaders/fragment/convolutionSmooth.js +54 -54
  30. package/src/gl-operations/shaders/fragment/diffCalc.js +33 -33
  31. package/src/gl-operations/shaders/fragment/drawResult.js +46 -46
  32. package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +78 -78
  33. package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +59 -59
  34. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +30 -30
  35. package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +60 -60
  36. package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +26 -26
  37. package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +25 -25
  38. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +53 -53
  39. package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +80 -80
  40. package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +54 -54
  41. package/src/gl-operations/shaders/fragment/interpolateColor.js +65 -65
  42. package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +49 -49
  43. package/src/gl-operations/shaders/fragment/interpolateValue.js +136 -136
  44. package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +35 -35
  45. package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +45 -45
  46. package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +53 -53
  47. package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +61 -61
  48. package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +69 -69
  49. package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +77 -77
  50. package/src/gl-operations/shaders/fragment/single.js +93 -93
  51. package/src/gl-operations/shaders/transform.js +21 -21
  52. package/src/gl-operations/shaders/util/computeColor.glsl +85 -85
  53. package/src/gl-operations/shaders/util/getTexelValue.glsl +10 -10
  54. package/src/gl-operations/shaders/util/isCloseEnough.glsl +9 -9
  55. package/src/gl-operations/shaders/util/rgbaToFloat.glsl +17 -17
  56. package/src/gl-operations/shaders/vertex/double.js +16 -16
  57. package/src/gl-operations/shaders/vertex/multi3.js +19 -19
  58. package/src/gl-operations/shaders/vertex/multi4.js +22 -22
  59. package/src/gl-operations/shaders/vertex/multi5.js +25 -25
  60. package/src/gl-operations/shaders/vertex/multi6.js +28 -28
  61. package/src/gl-operations/shaders/vertex/single.js +13 -13
  62. package/src/gl-operations/shaders/vertex/singleNotTransformed.js +11 -11
  63. package/src/gl-operations/texture_manager.js +141 -141
  64. package/src/gl-operations/util.js +336 -336
  65. package/src/util.js +14 -6
  66. package/vite.config.js +58 -0
  67. package/dist/catchUtil.min.esm.js +0 -113044
  68. package/dist/catchUtil.min.js +0 -2928
@@ -1,27 +1,27 @@
1
- import vertSingleNotTransformed from '../shaders/vertex/singleNotTransformed.js'
2
-
3
- import fragConvolutionSmooth from '../shaders/fragment/convolutionSmooth.js'
4
-
5
- /**
6
- * The resulting Regl DrawCommand is for using a convolution kernel to smooth the input data.
7
- * Currently hard-coded the kernel and positions in the shader to reduce number of uniforms.
8
- */
9
- export function createConvolutionSmoothCommand (regl, commonConfig) {
10
- return regl({
11
- vert: vertSingleNotTransformed,
12
- frag: fragConvolutionSmooth,
13
- uniforms: {
14
- ...commonConfig.uniforms,
15
- texture: regl.prop('texture'),
16
- textureSize: regl.prop('textureSize'),
17
- kernelSize: regl.prop('kernelSize')
18
- },
19
- attributes: {
20
- texCoord: [0, 1, 1, 1, 0, 0, 1, 0],
21
- position: [-1, 1, 1, 1, -1, -1, 1, -1]
22
- },
23
- depth: { enable: false },
24
- primitive: 'triangle strip',
25
- count: 4
26
- })
27
- }
1
+ import vertSingleNotTransformed from '../shaders/vertex/singleNotTransformed.js'
2
+
3
+ import fragConvolutionSmooth from '../shaders/fragment/convolutionSmooth.js'
4
+
5
+ /**
6
+ * The resulting Regl DrawCommand is for using a convolution kernel to smooth the input data.
7
+ * Currently hard-coded the kernel and positions in the shader to reduce number of uniforms.
8
+ */
9
+ export function createConvolutionSmoothCommand (regl, commonConfig) {
10
+ return regl({
11
+ vert: vertSingleNotTransformed,
12
+ frag: fragConvolutionSmooth,
13
+ uniforms: {
14
+ ...commonConfig.uniforms,
15
+ texture: regl.prop('texture'),
16
+ textureSize: regl.prop('textureSize'),
17
+ kernelSize: regl.prop('kernelSize')
18
+ },
19
+ attributes: {
20
+ texCoord: [0, 1, 1, 1, 0, 0, 1, 0],
21
+ position: [-1, 1, 1, 1, -1, -1, 1, -1]
22
+ },
23
+ depth: { enable: false },
24
+ primitive: 'triangle strip',
25
+ count: 4
26
+ })
27
+ }
@@ -1,46 +1,46 @@
1
- import vertSingle from '../shaders/vertex/single.js'
2
-
3
- import fragSingle from '../shaders/fragment/single.js'
4
-
5
- import {
6
- DEG2RAD,
7
- SLOPEFACTOR
8
- } from '../constants'
9
-
10
- import * as util from '../util'
11
-
12
- /**
13
- * The resulting Regl DrawCommand is used to draw a single tile. The fragment shader decodes the
14
- * Float32 value of a pixel and colorizes it with the given color scale (and/or sentinel values).
15
- */
16
- export function createDrawTileCommand (regl, commonConfig, fragMacros) {
17
- return regl({
18
- ...commonConfig,
19
- vert: vertSingle,
20
- frag: util.defineMacros(fragSingle, fragMacros),
21
- uniforms: {
22
- ...commonConfig.uniforms,
23
- scaleLength: regl.prop('scaleLength'),
24
- sentinelLength: regl.prop('sentinelLength'),
25
- scaleColormap: regl.prop('scaleColormap'),
26
- sentinelColormap: regl.prop('sentinelColormap'),
27
- aboveColor: regl.prop('aboveColor'),
28
- belowColor: regl.prop('belowColor'),
29
- texture: (_, { texture }) => texture,
30
- enableSimpleHillshade: (_, { enableSimpleHillshade }) => enableSimpleHillshade,
31
- offset: 0,
32
- azimuth: 0,
33
- altitude: 0,
34
- slopescale: 0,
35
- deg2rad: DEG2RAD,
36
- slopeFactor: SLOPEFACTOR,
37
- tileSize: 0,
38
- textureSize: 0,
39
- textureBounds: [0, 0, 0, 0]
40
- },
41
- attributes: {
42
- ...commonConfig.attributes,
43
- texCoord: (_, { textureBounds }) => util.getTexCoordVerticesTriangleStripQuad(textureBounds)
44
- }
45
- })
1
+ import vertSingle from '../shaders/vertex/single.js'
2
+
3
+ import fragSingle from '../shaders/fragment/single.js'
4
+
5
+ import {
6
+ DEG2RAD,
7
+ SLOPEFACTOR
8
+ } from '../constants'
9
+
10
+ import * as util from '../util'
11
+
12
+ /**
13
+ * The resulting Regl DrawCommand is used to draw a single tile. The fragment shader decodes the
14
+ * Float32 value of a pixel and colorizes it with the given color scale (and/or sentinel values).
15
+ */
16
+ export function createDrawTileCommand (regl, commonConfig, fragMacros) {
17
+ return regl({
18
+ ...commonConfig,
19
+ vert: vertSingle,
20
+ frag: util.defineMacros(fragSingle, fragMacros),
21
+ uniforms: {
22
+ ...commonConfig.uniforms,
23
+ scaleLength: regl.prop('scaleLength'),
24
+ sentinelLength: regl.prop('sentinelLength'),
25
+ scaleColormap: regl.prop('scaleColormap'),
26
+ sentinelColormap: regl.prop('sentinelColormap'),
27
+ aboveColor: regl.prop('aboveColor'),
28
+ belowColor: regl.prop('belowColor'),
29
+ texture: (_, { texture }) => texture,
30
+ enableSimpleHillshade: (_, { enableSimpleHillshade }) => enableSimpleHillshade,
31
+ offset: 0,
32
+ azimuth: 0,
33
+ altitude: 0,
34
+ slopescale: 0,
35
+ deg2rad: DEG2RAD,
36
+ slopeFactor: SLOPEFACTOR,
37
+ tileSize: 0,
38
+ textureSize: 0,
39
+ textureBounds: [0, 0, 0, 0]
40
+ },
41
+ attributes: {
42
+ ...commonConfig.attributes,
43
+ texCoord: (_, { textureBounds }) => util.getTexCoordVerticesTriangleStripQuad(textureBounds)
44
+ }
45
+ })
46
46
  }