vec22.js 1.2 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.25/esri/copyright.txt for details.
  4. */
  5. import{isInteger as e,maximumValue as t,isSigned as r}from"../geometry/support/buffer/types.js";function f(e,t,r){const f=e.typedBuffer,n=e.typedBufferStride,d=t.typedBuffer,o=t.typedBufferStride,u=r?r.count:t.count;let s=(r&&r.dstIndex?r.dstIndex:0)*n,c=(r&&r.srcIndex?r.srcIndex:0)*o;for(let p=0;p<u;++p)f[s]=d[c],f[s+1]=d[c+1],s+=n,c+=o}function n(n,d,o){const u=n.typedBuffer,s=n.typedBufferStride,c=d.typedBuffer,p=d.typedBufferStride,l=o?o.count:d.count;let y=(o&&o.dstIndex?o.dstIndex:0)*s,i=(o&&o.srcIndex?o.srcIndex:0)*p;if(e(d.elementType)){const e=t(d.elementType);if(r(d.elementType))for(let t=0;t<l;++t)u[y]=Math.max(c[i]/e,-1),u[y+1]=Math.max(c[i+1]/e,-1),y+=s,i+=p;else for(let t=0;t<l;++t)u[y]=c[i]/e,u[y+1]=c[i+1]/e,y+=s,i+=p}else f(n,d,o);return n}function d(e,t,r,f){const n=e.typedBuffer,d=e.typedBufferStride,o=f?.count??e.count;let u=(f?.dstIndex??0)*d;for(let s=0;s<o;++s)n[u]=t,n[u+1]=r,u+=d}const o=Object.freeze(Object.defineProperty({__proto__:null,copy:f,normalizeIntegerBuffer:n,fill:d},Symbol.toStringTag,{value:"Module"}));export{f as c,d as f,n,o as v};