@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.
- package/dist/catchUtil.min.cjs.js +2928 -0
- package/dist/catchUtil.min.esm.js +44502 -42814
- package/dist/catchUtil.min.js +248 -248
- package/package.json +11 -2
- package/src/constants/annotation_color.js +0 -7
- package/src/constants/annotation_draw_style.js +0 -228
- package/src/constants/annotation_label_style.js +0 -76
- package/src/constants/annotation_style.js +0 -118
- package/src/constants/bmap_types.js +0 -44
- package/src/constants/cameras.js +0 -5
- package/src/constants/crs.js +0 -42099
- package/src/constants/crs_types.js +0 -22
- package/src/constants/default_layers.js +0 -149
- package/src/constants/dsm_colors.js +0 -10
- package/src/constants/error_codes.js +0 -44
- package/src/constants/height_colors.js +0 -1
- package/src/constants/index.js +0 -20
- package/src/constants/layer_folders.js +0 -6
- package/src/constants/layer_groups.js +0 -34
- package/src/constants/layer_groups_multispectral.js +0 -34
- package/src/constants/layer_icons.js +0 -19
- package/src/constants/map_style.js +0 -11
- package/src/constants/measurement_fields.js +0 -208
- package/src/constants/task_params.js +0 -33
- package/src/constants/tools.js +0 -20
- package/src/event/event.js +0 -191
- package/src/event/event_bus.js +0 -5
- package/src/event/index.js +0 -2
- package/src/gl-operations/constants.js +0 -9
- package/src/gl-operations/default_options.js +0 -98
- package/src/gl-operations/index.js +0 -533
- package/src/gl-operations/reglCommands/contours.js +0 -27
- package/src/gl-operations/reglCommands/default.js +0 -46
- package/src/gl-operations/reglCommands/hillshading.js +0 -340
- package/src/gl-operations/reglCommands/index.js +0 -6
- package/src/gl-operations/reglCommands/multiLayers.js +0 -303
- package/src/gl-operations/reglCommands/transitions.js +0 -111
- package/src/gl-operations/reglCommands/util.js +0 -71
- package/src/gl-operations/renderer.js +0 -210
- package/src/gl-operations/shaders/fragment/convertDem.js +0 -26
- package/src/gl-operations/shaders/fragment/convolutionSmooth.js +0 -55
- package/src/gl-operations/shaders/fragment/diffCalc.js +0 -34
- package/src/gl-operations/shaders/fragment/drawResult.js +0 -47
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvAmbientShadows.js +0 -79
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvDirect.js +0 -60
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalBaselayer.js +0 -31
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvFinalColorscale.js +0 -61
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvMergeAndScaleTiles.js +0 -27
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvNormals.js +0 -26
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSmooth.js +0 -54
- package/src/gl-operations/shaders/fragment/hillshading/hsAdvSoftShadows.js +0 -81
- package/src/gl-operations/shaders/fragment/hillshading/hsPregen.js +0 -55
- package/src/gl-operations/shaders/fragment/interpolateColor.js +0 -66
- package/src/gl-operations/shaders/fragment/interpolateColorOnly.js +0 -50
- package/src/gl-operations/shaders/fragment/interpolateValue.js +0 -137
- package/src/gl-operations/shaders/fragment/multiAnalyze1Calc.js +0 -36
- package/src/gl-operations/shaders/fragment/multiAnalyze2Calc.js +0 -46
- package/src/gl-operations/shaders/fragment/multiAnalyze3Calc.js +0 -54
- package/src/gl-operations/shaders/fragment/multiAnalyze4Calc.js +0 -62
- package/src/gl-operations/shaders/fragment/multiAnalyze5Calc.js +0 -70
- package/src/gl-operations/shaders/fragment/multiAnalyze6Calc.js +0 -78
- package/src/gl-operations/shaders/fragment/single.js +0 -93
- package/src/gl-operations/shaders/transform.js +0 -22
- package/src/gl-operations/shaders/util/computeColor.glsl +0 -85
- package/src/gl-operations/shaders/util/getTexelValue.glsl +0 -10
- package/src/gl-operations/shaders/util/isCloseEnough.glsl +0 -9
- package/src/gl-operations/shaders/util/rgbaToFloat.glsl +0 -18
- package/src/gl-operations/shaders/vertex/double.js +0 -17
- package/src/gl-operations/shaders/vertex/multi3.js +0 -20
- package/src/gl-operations/shaders/vertex/multi4.js +0 -23
- package/src/gl-operations/shaders/vertex/multi5.js +0 -26
- package/src/gl-operations/shaders/vertex/multi6.js +0 -29
- package/src/gl-operations/shaders/vertex/single.js +0 -13
- package/src/gl-operations/shaders/vertex/singleNotTransformed.js +0 -12
- package/src/gl-operations/texture_manager.js +0 -141
- package/src/gl-operations/util.js +0 -336
- package/src/index.js +0 -20
- package/src/measure/index.js +0 -209
- package/src/measure/tile_cache.js +0 -88
- package/src/mvs/index.js +0 -26
- package/src/mvs/protos/index.js +0 -12
- package/src/mvs/protos/proto_10.js +0 -155
- package/src/observation_pretict.js +0 -168
- package/src/photo-parser/exif/gps_tags.js +0 -33
- package/src/photo-parser/exif/ifd1_tags.js +0 -22
- package/src/photo-parser/exif/index.js +0 -143
- package/src/photo-parser/exif/parse_image.js +0 -290
- package/src/photo-parser/exif/string_values.js +0 -137
- package/src/photo-parser/exif/tags.js +0 -75
- package/src/photo-parser/exif/tiff_tags.js +0 -35
- package/src/photo-parser/exif/util.js +0 -103
- package/src/photo-parser/image-size/detector.js +0 -24
- package/src/photo-parser/image-size/fromFile.js +0 -55
- package/src/photo-parser/image-size/index.js +0 -2
- package/src/photo-parser/image-size/lookup.js +0 -37
- package/src/photo-parser/image-size/types/bmp.js +0 -10
- package/src/photo-parser/image-size/types/cur.js +0 -16
- package/src/photo-parser/image-size/types/dds.js +0 -10
- package/src/photo-parser/image-size/types/gif.js +0 -11
- package/src/photo-parser/image-size/types/heif.js +0 -35
- package/src/photo-parser/image-size/types/icns.js +0 -112
- package/src/photo-parser/image-size/types/ico.js +0 -74
- package/src/photo-parser/image-size/types/index.js +0 -43
- package/src/photo-parser/image-size/types/j2c.js +0 -11
- package/src/photo-parser/image-size/types/jp2.js +0 -22
- package/src/photo-parser/image-size/types/jpg.js +0 -157
- package/src/photo-parser/image-size/types/ktx.js +0 -18
- package/src/photo-parser/image-size/types/png.js +0 -36
- package/src/photo-parser/image-size/types/pnm.js +0 -74
- package/src/photo-parser/image-size/types/psd.js +0 -10
- package/src/photo-parser/image-size/types/svg.js +0 -100
- package/src/photo-parser/image-size/types/tga.js +0 -14
- package/src/photo-parser/image-size/types/tiff.js +0 -92
- package/src/photo-parser/image-size/types/utils.js +0 -83
- package/src/photo-parser/image-size/types/webp.js +0 -67
- package/src/photo-parser/index.js +0 -185
- package/src/report/annotations_report.js +0 -446
- package/src/report/index.js +0 -2
- package/src/report/map_util.js +0 -81
- package/src/report/pdf_creator.js +0 -247
- package/src/report/report.js +0 -581
- package/src/transform.js +0 -207
- package/src/util.js +0 -671
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
uniform sampler2D tBase;
|
|
10
|
-
uniform sampler2D tSoftShadow;
|
|
11
|
-
uniform sampler2D tAmbient;
|
|
12
|
-
uniform float finalSoftMultiplier;
|
|
13
|
-
uniform float finalAmbientMultiplier;
|
|
14
|
-
uniform float nodataValue;
|
|
15
|
-
uniform bool littleEndian;
|
|
16
|
-
varying vec2 vTexCoordA;
|
|
17
|
-
varying vec2 vTexCoordB;
|
|
18
|
-
|
|
19
|
-
void main() {
|
|
20
|
-
vec3 baselayer = texture2D(tBase, vTexCoordA).rgb;
|
|
21
|
-
|
|
22
|
-
float softShadow = texture2D(tSoftShadow, vTexCoordB).r;
|
|
23
|
-
float ambient = texture2D(tAmbient, vTexCoordB).r;
|
|
24
|
-
// Add up the lighting
|
|
25
|
-
float light = finalSoftMultiplier * softShadow + finalAmbientMultiplier * ambient;
|
|
26
|
-
//Deepen the original color a bit by applying a curve, and multiply it by the light
|
|
27
|
-
vec3 color = light * pow(baselayer.rgb, vec3(2.0));
|
|
28
|
-
// apply gamma correction
|
|
29
|
-
color = pow(color, vec3(1.0/2.2));
|
|
30
|
-
gl_FragColor = vec4(color, 1.0);
|
|
31
|
-
}`
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: computeColor = require(../../util/computeColor.glsl)
|
|
10
|
-
#pragma glslify: isCloseEnough = require(../../util/isCloseEnough.glsl)
|
|
11
|
-
|
|
12
|
-
uniform sampler2D tInput;
|
|
13
|
-
uniform sampler2D tSoftShadow;
|
|
14
|
-
uniform sampler2D tAmbient;
|
|
15
|
-
uniform float floatScale;
|
|
16
|
-
uniform float finalSoftMultiplier;
|
|
17
|
-
uniform float finalAmbientMultiplier;
|
|
18
|
-
uniform float nodataValue;
|
|
19
|
-
uniform bool littleEndian;
|
|
20
|
-
uniform int scaleLength;
|
|
21
|
-
uniform int sentinelLength;
|
|
22
|
-
uniform sampler2D scaleColormap;
|
|
23
|
-
uniform sampler2D sentinelColormap;
|
|
24
|
-
varying vec2 vTexCoordA;
|
|
25
|
-
varying vec2 vTexCoordB;
|
|
26
|
-
|
|
27
|
-
uniform vec4 aboveColor;
|
|
28
|
-
uniform vec4 belowColor;
|
|
29
|
-
|
|
30
|
-
void main() {
|
|
31
|
-
float f = texture2D(tInput, vTexCoordA).r;
|
|
32
|
-
|
|
33
|
-
if (isCloseEnough(f, nodataValue)) {
|
|
34
|
-
gl_FragColor = vec4(0.0);
|
|
35
|
-
return;
|
|
36
|
-
} else {
|
|
37
|
-
vec4 clr = computeColor(
|
|
38
|
-
f / floatScale,
|
|
39
|
-
scaleColormap,
|
|
40
|
-
sentinelColormap,
|
|
41
|
-
scaleLength,
|
|
42
|
-
sentinelLength,
|
|
43
|
-
littleEndian,
|
|
44
|
-
aboveColor,
|
|
45
|
-
belowColor
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
float softShadow = texture2D(tSoftShadow, vTexCoordB).r;
|
|
49
|
-
float ambient = texture2D(tAmbient, vTexCoordB).r;
|
|
50
|
-
// Add up the lighting
|
|
51
|
-
float light = finalSoftMultiplier * softShadow + finalAmbientMultiplier * ambient;
|
|
52
|
-
// Deepen the original color a bit by applying a curve, and multiply it by the light
|
|
53
|
-
vec3 color = light * pow(clr.rgb, vec3(2.0));
|
|
54
|
-
// apply gamma correction
|
|
55
|
-
color = pow(color, vec3(1.0/2.2));
|
|
56
|
-
gl_FragColor = vec4(color, 1.0);
|
|
57
|
-
// gl_FragColor = vec4(clr.rgb, 1.0);
|
|
58
|
-
}
|
|
59
|
-
// vec3 n = texture2D(tInput, vTexCoordA).rgb;
|
|
60
|
-
// gl_FragColor = vec4((0.5 * n + 0.5)*0.1, 1.0);
|
|
61
|
-
}`
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: isCloseEnough = require(../../util/isCloseEnough.glsl)
|
|
10
|
-
#pragma glslify: getTexelValue = require(../../util/getTexelValue.glsl)
|
|
11
|
-
|
|
12
|
-
uniform float nodataValue;
|
|
13
|
-
uniform bool littleEndian;
|
|
14
|
-
uniform sampler2D texture;
|
|
15
|
-
uniform float floatScale;
|
|
16
|
-
varying vec2 vTexCoord;
|
|
17
|
-
|
|
18
|
-
void main() {
|
|
19
|
-
float f = getTexelValue(texture, vTexCoord, littleEndian);
|
|
20
|
-
|
|
21
|
-
if (isCloseEnough(f, nodataValue)) {
|
|
22
|
-
gl_FragColor = vec4(nodataValue);
|
|
23
|
-
} else {
|
|
24
|
-
// Scale the input value and write to framebuffer
|
|
25
|
-
gl_FragColor = vec4(f * floatScale);
|
|
26
|
-
}
|
|
27
|
-
}`
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
uniform float nodataValue;
|
|
10
|
-
uniform bool littleEndian;
|
|
11
|
-
uniform sampler2D tInput;
|
|
12
|
-
uniform float pixelScale;
|
|
13
|
-
uniform float onePixel;
|
|
14
|
-
varying vec2 vTexCoord;
|
|
15
|
-
|
|
16
|
-
void main() {
|
|
17
|
-
float p0 = texture2D(tInput, vTexCoord).r;
|
|
18
|
-
float px = texture2D(tInput, vec2(vTexCoord.x + onePixel, vTexCoord.y)).r;
|
|
19
|
-
float py = texture2D(tInput, vec2(vTexCoord.x, vTexCoord.y + onePixel)).r;
|
|
20
|
-
vec3 dx = vec3(pixelScale, 0.0, px - p0);
|
|
21
|
-
vec3 dy = vec3(0.0, pixelScale, py - p0);
|
|
22
|
-
vec3 n = normalize(cross(dx, dy));
|
|
23
|
-
|
|
24
|
-
gl_FragColor = vec4(n, 1.0);
|
|
25
|
-
// gl_FragColor = vec4(0.5 * n + 0.5, 1.0); // to show
|
|
26
|
-
}`
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: isCloseEnough = require(../../util/isCloseEnough.glsl)
|
|
10
|
-
|
|
11
|
-
uniform float nodataValue;
|
|
12
|
-
uniform bool littleEndian;
|
|
13
|
-
uniform sampler2D tInput;
|
|
14
|
-
uniform float pixelScale;
|
|
15
|
-
uniform int kernelSize;
|
|
16
|
-
varying vec2 vTexCoord;
|
|
17
|
-
|
|
18
|
-
uniform float textureSize;
|
|
19
|
-
|
|
20
|
-
int kernelEnd = int(kernelSize/2);
|
|
21
|
-
int kernelStart = kernelEnd * -1;
|
|
22
|
-
|
|
23
|
-
float runConvKernel(vec2 pos, vec2 onePixel) {
|
|
24
|
-
float convKernelWeight = 0.0;
|
|
25
|
-
float sum = 0.0;
|
|
26
|
-
|
|
27
|
-
for (int i = -20; i < 20; i ++) {
|
|
28
|
-
if (i < kernelStart) continue;
|
|
29
|
-
if (i > kernelEnd) break;
|
|
30
|
-
for (int j = -20; j < 20; j ++) {
|
|
31
|
-
if (j < kernelStart) continue;
|
|
32
|
-
if (j > kernelEnd) break;
|
|
33
|
-
float texelValue = texture2D(tInput, pos + onePixel * vec2(i, j)).r;
|
|
34
|
-
if (!isCloseEnough(texelValue, nodataValue)) {
|
|
35
|
-
sum = sum + texelValue;
|
|
36
|
-
convKernelWeight = convKernelWeight + 1.0;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return (sum / convKernelWeight);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
void main() {
|
|
45
|
-
float texelFloat = texture2D(tInput, vTexCoord).r;
|
|
46
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
47
|
-
gl_FragColor = vec4(nodataValue);
|
|
48
|
-
} else {
|
|
49
|
-
vec2 onePixel = vec2(1.0, 1.0) / textureSize;
|
|
50
|
-
float texelFloatSmoothed = runConvKernel(vTexCoord, onePixel);
|
|
51
|
-
gl_FragColor = vec4(texelFloatSmoothed);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
uniform sampler2D tInput;
|
|
10
|
-
uniform sampler2D tNormal;
|
|
11
|
-
uniform sampler2D tSrc;
|
|
12
|
-
uniform vec3 sunDirection;
|
|
13
|
-
uniform vec2 resolution;
|
|
14
|
-
uniform float pixelScale;
|
|
15
|
-
uniform float softIterations;
|
|
16
|
-
varying vec2 vTexCoord;
|
|
17
|
-
|
|
18
|
-
void main() {
|
|
19
|
-
vec2 ires = 1.0 / resolution;
|
|
20
|
-
vec3 src = texture2D(tSrc, gl_FragCoord.xy * ires).rgb;
|
|
21
|
-
vec4 e0 = texture2D(tInput, vTexCoord);
|
|
22
|
-
vec3 n0 = texture2D(tNormal, vTexCoord).rgb;
|
|
23
|
-
|
|
24
|
-
// get 2D ray direction
|
|
25
|
-
vec2 sr = normalize(sunDirection.xy);
|
|
26
|
-
|
|
27
|
-
// initialize pixel traversal algorithm
|
|
28
|
-
vec2 p0 = vTexCoord * resolution;
|
|
29
|
-
vec2 p = floor(p0); // pixel we are starting in
|
|
30
|
-
vec2 stp = sign(sr);
|
|
31
|
-
|
|
32
|
-
// how far we need to travel in our ray direction to intersect the next pixel
|
|
33
|
-
// in the x- and y- directions
|
|
34
|
-
vec2 tMax = step(0.0, sr) * (1.0 - fract(p0)) + (1.0 - step(0.0, sr)) * fract(p0);
|
|
35
|
-
tMax /= abs(sr);
|
|
36
|
-
// how far must we travel along our ray to cover the width and height of a pixel
|
|
37
|
-
vec2 tDelta = 1.0 / abs(sr);
|
|
38
|
-
|
|
39
|
-
// pixel traversal routine
|
|
40
|
-
for (int i = 0; i < 65536; i++) {
|
|
41
|
-
if (tMax.x < tMax.y) {
|
|
42
|
-
tMax.x += tDelta.x;
|
|
43
|
-
p.x += stp.x;
|
|
44
|
-
} else {
|
|
45
|
-
tMax.y += tDelta.y;
|
|
46
|
-
p.y += stp.y;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// normalized texture coordinate for the center of the current pixel
|
|
50
|
-
vec2 ptex = ires * (p + 0.5);
|
|
51
|
-
|
|
52
|
-
// If we left the tile: add some illumination to the pixel for this iteration and stop traversing
|
|
53
|
-
if (ptex.x < 0.0 || ptex.x > 1.0 || ptex.y < 0.0 || ptex.y > 1.0) {
|
|
54
|
-
// illumination of this single ray
|
|
55
|
-
vec3 illumination = vec3(1.0/softIterations) * clamp(dot(n0, sunDirection), 0.0, 1.0);
|
|
56
|
-
// add illumination of this ray to result of previous iteration
|
|
57
|
-
gl_FragColor = vec4(src + illumination, 1.0);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// elevation/value at current pixel
|
|
62
|
-
vec4 e = texture2D(tInput, ptex);
|
|
63
|
-
// time we have traveled along the 2D ray
|
|
64
|
-
float time = distance(p + 0.5, p0);
|
|
65
|
-
// elevation along our original 3D ray at the current point
|
|
66
|
-
float z = e0.r + time * pixelScale * sunDirection.z;
|
|
67
|
-
|
|
68
|
-
// If we did not exit tile, have we hit the terrain?
|
|
69
|
-
if (e.r > z) {
|
|
70
|
-
// We hit terrain. Do not add illumination for this iteration
|
|
71
|
-
gl_FragColor = vec4(src, 1.0);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Should have hit terrain or left the tile by this point, so should never need this
|
|
77
|
-
// If we finish the loop somehow, let’s pretend it’s been illuminated
|
|
78
|
-
vec3 illumination = vec3(1.0/softIterations) * clamp(dot(n0, sunDirection), 0.0, 1.0);
|
|
79
|
-
gl_FragColor = vec4(src + illumination, 1.0);
|
|
80
|
-
}
|
|
81
|
-
`
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: computeColor = require(../../util/computeColor.glsl)
|
|
10
|
-
#pragma glslify: isCloseEnough = require(../../util/isCloseEnough.glsl)
|
|
11
|
-
#pragma glslify: getTexelValue = require(../../util/getTexelValue.glsl)
|
|
12
|
-
|
|
13
|
-
uniform int scaleLength;
|
|
14
|
-
uniform int sentinelLength;
|
|
15
|
-
uniform sampler2D scaleColormap;
|
|
16
|
-
uniform sampler2D sentinelColormap;
|
|
17
|
-
|
|
18
|
-
uniform vec4 aboveColor;
|
|
19
|
-
uniform vec4 belowColor;
|
|
20
|
-
|
|
21
|
-
uniform float nodataValue;
|
|
22
|
-
uniform sampler2D texture;
|
|
23
|
-
uniform bool littleEndian;
|
|
24
|
-
uniform sampler2D hillshadePregenTexture;
|
|
25
|
-
|
|
26
|
-
varying vec2 vTexCoordA;
|
|
27
|
-
varying vec2 vTexCoordB;
|
|
28
|
-
|
|
29
|
-
void main() {
|
|
30
|
-
float texelFloat = getTexelValue(texture, vTexCoordA, littleEndian);
|
|
31
|
-
|
|
32
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
33
|
-
discard;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
vec4 clr = computeColor(
|
|
37
|
-
texelFloat,
|
|
38
|
-
scaleColormap,
|
|
39
|
-
sentinelColormap,
|
|
40
|
-
scaleLength,
|
|
41
|
-
sentinelLength,
|
|
42
|
-
littleEndian,
|
|
43
|
-
aboveColor,
|
|
44
|
-
belowColor
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
// Hillshade
|
|
48
|
-
float light = texture2D(hillshadePregenTexture, vTexCoordB).r;
|
|
49
|
-
// float light = getTexelValue(vTexCoordB, hillshadePregenTexture, littleEndian).r;
|
|
50
|
-
clr.rgb = light * pow(clr.rgb, vec3(2.0));
|
|
51
|
-
clr.rgb = pow(clr.rgb, vec3(1.0/2.2));
|
|
52
|
-
|
|
53
|
-
gl_FragColor = clr;
|
|
54
|
-
}
|
|
55
|
-
`
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#define TRANSPARENT vec4(0.0)
|
|
10
|
-
|
|
11
|
-
#pragma glslify: computeColor = require(../util/computeColor.glsl)
|
|
12
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
13
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
14
|
-
|
|
15
|
-
uniform sampler2D textureA;
|
|
16
|
-
uniform sampler2D textureB;
|
|
17
|
-
|
|
18
|
-
uniform int scaleLengthA;
|
|
19
|
-
uniform int sentinelLengthA;
|
|
20
|
-
uniform sampler2D scaleColormapA;
|
|
21
|
-
uniform sampler2D sentinelColormapA;
|
|
22
|
-
|
|
23
|
-
uniform int scaleLengthB;
|
|
24
|
-
uniform int sentinelLengthB;
|
|
25
|
-
uniform sampler2D scaleColormapB;
|
|
26
|
-
uniform sampler2D sentinelColormapB;
|
|
27
|
-
|
|
28
|
-
uniform float nodataValue;
|
|
29
|
-
uniform bool littleEndian;
|
|
30
|
-
uniform float interpolationFraction;
|
|
31
|
-
|
|
32
|
-
uniform vec4 aboveColor;
|
|
33
|
-
uniform vec4 belowColor;
|
|
34
|
-
|
|
35
|
-
varying vec2 vTexCoordA;
|
|
36
|
-
varying vec2 vTexCoordB;
|
|
37
|
-
|
|
38
|
-
void main() {
|
|
39
|
-
if (interpolationFraction <= 0.0) {
|
|
40
|
-
float texelFloat = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
41
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
42
|
-
discard;
|
|
43
|
-
}
|
|
44
|
-
gl_FragColor = computeColor(texelFloat, scaleColormapA, sentinelColormapA, scaleLengthA, sentinelLengthA, littleEndian, aboveColor, belowColor);
|
|
45
|
-
} else if (interpolationFraction >= 1.0) {
|
|
46
|
-
float texelFloat = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
47
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
48
|
-
discard;
|
|
49
|
-
}
|
|
50
|
-
gl_FragColor = computeColor(texelFloat, scaleColormapB, sentinelColormapB, scaleLengthB, sentinelLengthB, littleEndian, aboveColor, belowColor);
|
|
51
|
-
} else {
|
|
52
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
53
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
54
|
-
vec4 colorA = (
|
|
55
|
-
isCloseEnough(texelFloatA, nodataValue)
|
|
56
|
-
? TRANSPARENT
|
|
57
|
-
: computeColor(texelFloatA, scaleColormapA, sentinelColormapA, scaleLengthA, sentinelLengthA, littleEndian, aboveColor, belowColor)
|
|
58
|
-
);
|
|
59
|
-
vec4 colorB = (
|
|
60
|
-
isCloseEnough(texelFloatB, nodataValue)
|
|
61
|
-
? TRANSPARENT
|
|
62
|
-
: computeColor(texelFloatB, scaleColormapB, sentinelColormapB, scaleLengthB, sentinelLengthB, littleEndian, aboveColor, belowColor)
|
|
63
|
-
);
|
|
64
|
-
gl_FragColor = mix(colorA, colorB, interpolationFraction);
|
|
65
|
-
}
|
|
66
|
-
}`
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: computeColor = require(../util/computeColor.glsl)
|
|
10
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
11
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D texture;
|
|
14
|
-
|
|
15
|
-
uniform int scaleLengthA;
|
|
16
|
-
uniform int sentinelLengthA;
|
|
17
|
-
uniform sampler2D scaleColormapA;
|
|
18
|
-
uniform sampler2D sentinelColormapA;
|
|
19
|
-
|
|
20
|
-
uniform int scaleLengthB;
|
|
21
|
-
uniform int sentinelLengthB;
|
|
22
|
-
uniform sampler2D scaleColormapB;
|
|
23
|
-
uniform sampler2D sentinelColormapB;
|
|
24
|
-
|
|
25
|
-
uniform float nodataValue;
|
|
26
|
-
uniform bool littleEndian;
|
|
27
|
-
uniform float interpolationFraction;
|
|
28
|
-
|
|
29
|
-
uniform vec4 aboveColor;
|
|
30
|
-
uniform vec4 belowColor;
|
|
31
|
-
|
|
32
|
-
varying vec2 vTexCoord;
|
|
33
|
-
|
|
34
|
-
void main() {
|
|
35
|
-
float texelFloat = getTexelValue(texture, vTexCoord, littleEndian);
|
|
36
|
-
|
|
37
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
38
|
-
discard;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (interpolationFraction <= 0.0) {
|
|
42
|
-
gl_FragColor = computeColor(texelFloat, scaleColormapA, sentinelColormapA, scaleLengthA, sentinelLengthA, littleEndian, aboveColor, belowColor);
|
|
43
|
-
} else if (interpolationFraction >= 1.0) {
|
|
44
|
-
gl_FragColor = computeColor(texelFloat, scaleColormapB, sentinelColormapB, scaleLengthB, sentinelLengthB, littleEndian, aboveColor, belowColor);
|
|
45
|
-
} else {
|
|
46
|
-
vec4 colorA = computeColor(texelFloat, scaleColormapA, sentinelColormapA, scaleLengthA, sentinelLengthA, littleEndian, aboveColor, belowColor);
|
|
47
|
-
vec4 colorB = computeColor(texelFloat, scaleColormapB, sentinelColormapB, scaleLengthB, sentinelLengthB, littleEndian, aboveColor, belowColor);
|
|
48
|
-
gl_FragColor = mix(colorA, colorB, interpolationFraction);
|
|
49
|
-
}
|
|
50
|
-
}`
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#define TRANSPARENT vec4(0.0)
|
|
10
|
-
|
|
11
|
-
#pragma glslify: computeColor = require(../util/computeColor.glsl)
|
|
12
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
13
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
14
|
-
|
|
15
|
-
uniform int scaleLength;
|
|
16
|
-
uniform int sentinelLength;
|
|
17
|
-
uniform sampler2D scaleColormap;
|
|
18
|
-
uniform sampler2D sentinelColormap;
|
|
19
|
-
|
|
20
|
-
uniform float nodataValue;
|
|
21
|
-
uniform sampler2D textureA;
|
|
22
|
-
uniform sampler2D textureB;
|
|
23
|
-
uniform bool littleEndian;
|
|
24
|
-
uniform float interpolationFraction;
|
|
25
|
-
|
|
26
|
-
uniform vec4 aboveColor;
|
|
27
|
-
uniform vec4 belowColor;
|
|
28
|
-
|
|
29
|
-
varying vec2 vTexCoordA;
|
|
30
|
-
varying vec2 vTexCoordB;
|
|
31
|
-
|
|
32
|
-
bool isSentinelValue(sampler2D sentinelColormap, int len, float value) {
|
|
33
|
-
for (int i = 0; i < SENTINEL_MAX_LENGTH; ++i) {
|
|
34
|
-
if (i == len) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
float i_f = float(i);
|
|
38
|
-
float lenFloat = float(len);
|
|
39
|
-
float sentinelOffset = getTexelValue(sentinelColormap, vec2((i_f + 0.5) / lenFloat, 0.75), littleEndian);
|
|
40
|
-
if (isCloseEnough(sentinelOffset, value)) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
void main() {
|
|
48
|
-
if (interpolationFraction <= 0.0) {
|
|
49
|
-
float texelFloat = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
50
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
51
|
-
discard;
|
|
52
|
-
}
|
|
53
|
-
gl_FragColor = computeColor(
|
|
54
|
-
texelFloat,
|
|
55
|
-
scaleColormap,
|
|
56
|
-
sentinelColormap,
|
|
57
|
-
scaleLength,
|
|
58
|
-
sentinelLength,
|
|
59
|
-
littleEndian,
|
|
60
|
-
aboveColor,
|
|
61
|
-
belowColor
|
|
62
|
-
);
|
|
63
|
-
} else if (interpolationFraction >= 1.0) {
|
|
64
|
-
float texelFloat = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
65
|
-
if (isCloseEnough(texelFloat, nodataValue)) {
|
|
66
|
-
discard;
|
|
67
|
-
}
|
|
68
|
-
gl_FragColor = computeColor(
|
|
69
|
-
texelFloat,
|
|
70
|
-
scaleColormap,
|
|
71
|
-
sentinelColormap,
|
|
72
|
-
scaleLength,
|
|
73
|
-
sentinelLength,
|
|
74
|
-
littleEndian,
|
|
75
|
-
aboveColor,
|
|
76
|
-
belowColor
|
|
77
|
-
);
|
|
78
|
-
} else {
|
|
79
|
-
// retrieve and decode pixel value from both tiles
|
|
80
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
81
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
82
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
83
|
-
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
84
|
-
if (aIsNodata && bIsNodata) {
|
|
85
|
-
discard;
|
|
86
|
-
} else if (
|
|
87
|
-
aIsNodata
|
|
88
|
-
|| bIsNodata
|
|
89
|
-
|| scaleLength == 0
|
|
90
|
-
|| isSentinelValue(sentinelColormap, sentinelLength, texelFloatA)
|
|
91
|
-
|| isSentinelValue(sentinelColormap, sentinelLength, texelFloatB)
|
|
92
|
-
) {
|
|
93
|
-
vec4 colorA = (
|
|
94
|
-
aIsNodata
|
|
95
|
-
? TRANSPARENT
|
|
96
|
-
: computeColor(
|
|
97
|
-
texelFloatA,
|
|
98
|
-
scaleColormap,
|
|
99
|
-
sentinelColormap,
|
|
100
|
-
scaleLength,
|
|
101
|
-
sentinelLength,
|
|
102
|
-
littleEndian,
|
|
103
|
-
aboveColor,
|
|
104
|
-
belowColor
|
|
105
|
-
)
|
|
106
|
-
);
|
|
107
|
-
vec4 colorB = (
|
|
108
|
-
bIsNodata
|
|
109
|
-
? TRANSPARENT
|
|
110
|
-
: computeColor(
|
|
111
|
-
texelFloatB,
|
|
112
|
-
scaleColormap,
|
|
113
|
-
sentinelColormap,
|
|
114
|
-
scaleLength,
|
|
115
|
-
sentinelLength,
|
|
116
|
-
littleEndian,
|
|
117
|
-
aboveColor,
|
|
118
|
-
belowColor
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
gl_FragColor = mix(colorA, colorB, interpolationFraction);
|
|
122
|
-
} else {
|
|
123
|
-
float interpolated = mix(texelFloatA, texelFloatB, interpolationFraction);
|
|
124
|
-
gl_FragColor = computeColor(
|
|
125
|
-
interpolated,
|
|
126
|
-
scaleColormap,
|
|
127
|
-
sentinelColormap,
|
|
128
|
-
scaleLength,
|
|
129
|
-
sentinelLength,
|
|
130
|
-
littleEndian,
|
|
131
|
-
aboveColor,
|
|
132
|
-
belowColor
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
`
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
-
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D textureA;
|
|
14
|
-
|
|
15
|
-
uniform float nodataValue;
|
|
16
|
-
uniform bool littleEndian;
|
|
17
|
-
|
|
18
|
-
uniform float filterLowA;
|
|
19
|
-
uniform float filterHighA;
|
|
20
|
-
uniform float multiplierA;
|
|
21
|
-
|
|
22
|
-
varying vec2 vTexCoord;
|
|
23
|
-
|
|
24
|
-
void main() {
|
|
25
|
-
float texelFloatA = getTexelValue(textureA, vTexCoord, littleEndian);
|
|
26
|
-
|
|
27
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
28
|
-
|
|
29
|
-
if (aIsNodata || texelFloatA < filterLowA || texelFloatA > filterHighA) {
|
|
30
|
-
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
31
|
-
} else {
|
|
32
|
-
float texelFloatFinal = texelFloatA * multiplierA;
|
|
33
|
-
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import glsl from 'glslify'
|
|
2
|
-
|
|
3
|
-
export default glsl`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
4
|
-
precision highp float;
|
|
5
|
-
#else
|
|
6
|
-
precision mediump float;
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#pragma glslify: getTexelValue = require(../util/getTexelValue.glsl)
|
|
10
|
-
#pragma glslify: floatToRgba = require(glsl-float-to-rgba)
|
|
11
|
-
#pragma glslify: isCloseEnough = require(../util/isCloseEnough.glsl)
|
|
12
|
-
|
|
13
|
-
uniform sampler2D textureA;
|
|
14
|
-
uniform sampler2D textureB;
|
|
15
|
-
|
|
16
|
-
uniform float nodataValue;
|
|
17
|
-
uniform bool littleEndian;
|
|
18
|
-
|
|
19
|
-
uniform float filterLowA;
|
|
20
|
-
uniform float filterHighA;
|
|
21
|
-
uniform float filterLowB;
|
|
22
|
-
uniform float filterHighB;
|
|
23
|
-
uniform float multiplierA;
|
|
24
|
-
uniform float multiplierB;
|
|
25
|
-
|
|
26
|
-
varying vec2 vTexCoordA;
|
|
27
|
-
varying vec2 vTexCoordB;
|
|
28
|
-
|
|
29
|
-
void main() {
|
|
30
|
-
float texelFloatA = getTexelValue(textureA, vTexCoordA, littleEndian);
|
|
31
|
-
float texelFloatB = getTexelValue(textureB, vTexCoordB, littleEndian);
|
|
32
|
-
|
|
33
|
-
bool aIsNodata = isCloseEnough(texelFloatA, nodataValue);
|
|
34
|
-
bool bIsNodata = isCloseEnough(texelFloatB, nodataValue);
|
|
35
|
-
|
|
36
|
-
if (aIsNodata || bIsNodata ||
|
|
37
|
-
texelFloatA < filterLowA || texelFloatA > filterHighA ||
|
|
38
|
-
texelFloatB < filterLowB || texelFloatB > filterHighB
|
|
39
|
-
) {
|
|
40
|
-
gl_FragColor = floatToRgba(nodataValue, littleEndian);
|
|
41
|
-
} else {
|
|
42
|
-
float texelFloatFinal = texelFloatA * multiplierA + texelFloatB * multiplierB;
|
|
43
|
-
gl_FragColor = floatToRgba(texelFloatFinal, littleEndian);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`
|