/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../shaderModules/FloatPassUniform","../../shaderModules/interfaces","../../shaderModules/Texture2DPassUniform"],(function(e,o,r,l){"use strict";function a(e){e.fragment.uniforms.add([new l.Texture2DPassUniform("u_colormap",(e=>e.u_colormap)),new o.FloatPassUniform("u_colormapOffset",(e=>e.colormap.u_colormapOffset)),new o.FloatPassUniform("u_colormapMaxIndex",(e=>e.colormap.u_colormapMaxIndex)),new o.FloatPassUniform("u_opacity",(e=>e.common.u_opacity))]),e.fragment.code.add(r.glsl`vec4 colormap(vec4 currentPixel, bool isFloat) {
float clrIndex = isFloat ? currentPixel.r - u_colormapOffset : currentPixel.r * 255.0 - u_colormapOffset;
vec4 result;
if (currentPixel.a == 0.0 || clrIndex > u_colormapMaxIndex) {
result = vec4(0.0, 0.0, 0.0, 0.0);
} else {
vec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0);
result = texture2D(u_colormap, clrPosition);
}
return result;
}`)}e.Colormap=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
