/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import r from"../../../../../../../Color.js";import e from"../../../../../../../core/Error.js";import t from"../../../../../../../core/Logger.js";const n=()=>t.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),o=0,c=100;function s(r,e){return[!!r?.minScale&&e.scaleToZoom(r.minScale)||o,!!r?.maxScale&&e.scaleToZoom(r.maxScale)||c]}function i(r){return 1<<r}function u(r){let e=0;for(const[t,n]of r)n&&(e|=1<<t);return e}function a(t){let o;if(!t)return[0,0,0,0];if("string"==typeof t){const c=r.fromString(t);if(!c)return n().errorOnce(new e("mapview:mesh-processing","Unable to parse string into color",{color:t})),[0,0,0,0];o=c.toArray()}else o=t;const[c,s,i,u]=o;return[c*(u/255),s*(u/255),i*(u/255),u]}function f(r){switch(r){case"butt":case"Butt":return 0;case"round":case"Round":return 1;case"square":case"Square":return 2}}function m(r){switch(r){case"bevel":case"Bevel":return 0;case"miter":case"Miter":return 2;case"round":case"Round":return 1}}function l(r,e){return Math.round(Math.min(Math.sqrt(r*e),255))}function g(r,e){return Math.round(r*e)/e}export{i as getBitMask,s as getMinMaxZoom,u as packBitset,l as packByteSqrt,g as packRounded,a as processColorInput,f as processLineCapInput,m as processLineJoinInput};
