/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{glsl as o}from"../../shaderModules/glsl.js";function r(r){r.code.add(o`struct MaskedColor {
vec4 color;
bvec4 mask;
};`)}function e(e){e.include(r),e.code.add(o`
    MaskedColor createMaskedFromUInt8NaNColor(vec4 color) {
      return MaskedColor(color * ${o.float(1/254)}, equal(color, vec4(255)));
    }
  `)}function c(e){e.include(r),e.code.add(o`vec4 maskedColorSelectOrOne(MaskedColor color) {
return vec4(
color.mask.r ? 1.0 : color.color.r,
color.mask.g ? 1.0 : color.color.g,
color.mask.b ? 1.0 : color.color.b,
color.mask.a ? 1.0 : color.color.a
);
}
MaskedColor multiplyMaskedColors(MaskedColor color1, MaskedColor color2) {
vec4 masked1 = maskedColorSelectOrOne(color1);
vec4 masked2 = maskedColorSelectOrOne(color2);
return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
}`)}function l(e){e.include(r),e.code.add(o`MaskedColor createMaskedFromNaNColor(vec4 color) {
return MaskedColor(color, isnan(color));
}`)}export{l as CreateMaskedFromNaNColor,e as CreateMaskedFromUInt8NaNColor,r as MaskedColorDefinition,c as MultiplyMaskedColors};
