@mapcatch/util 2.0.3-b → 2.0.4

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.
@@ -19,7 +19,9 @@ vec4 computeColor(
19
19
  sampler2D sentinelColormap,
20
20
  int scaleLength,
21
21
  int sentinelLength,
22
- bool littleEndian
22
+ bool littleEndian,
23
+ vec4 aboveColor,
24
+ vec4 belowColor
23
25
  ) {
24
26
 
25
27
  // vertical texture coordinate to find color and offset
@@ -44,16 +46,15 @@ vec4 computeColor(
44
46
  }
45
47
  }
46
48
  }
47
-
48
49
  // Do linear interpolation using the color scale, if defined.
49
50
  if (scaleLength > 0) {
50
51
  // If value below color scale range, clamp to lowest color stop.
51
52
  float scaleOffsetLowest = getTexelValue(scaleColormap, vec2(0.0, offsetRow), littleEndian);
52
53
  float scaleOffsetHighest = getTexelValue(scaleColormap, vec2(1.0, offsetRow), littleEndian);
53
54
  if (inputVal < scaleOffsetLowest) {
54
- return texture2D(scaleColormap, vec2(0.0, colorRow));
55
+ return belowColor;
55
56
  } else if (inputVal > scaleOffsetHighest) {
56
- return texture2D(scaleColormap, vec2(1.0, colorRow));
57
+ return aboveColor;
57
58
  } else {
58
59
  for (int i = 0; i < SCALE_MAX_LENGTH; ++i) {
59
60
  float i_f = float(i);