UNPKG

@dp_unity/dpu-gis-viewer

Version:

DPU GIS Viewer version Beta

2 lines 1.65 kB
/*! For license information please see chunk-34ULWVZF.js.LICENSE.txt */ import{a}from"./chunk-UCTPWOTZ.js";import{a as N}from"./chunk-54PMPXZ4.js";import{a as t}from"./chunk-G75U3WZT.js";import{e as i}from"./chunk-3THTQ4QB.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)},createTypedArray:function(r,e){if(!i(r))throw new t("numberOfVertices is required.");return r>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},createTypedArrayFromArrayBuffer:function(r,e,n,N){if(!i(r))throw new t("numberOfVertices is required.");if(!i(e))throw new t("sourceArray is required.");if(!i(n))throw new t("byteOffset is required.");return r>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,N):new Uint16Array(e,n,N)},fromTypedArray:function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")}},u=Object.freeze(r);export{u as a};