/* 2020-9-22 15:23:25 | 版权所有 军懋国兴  */
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./WebGLConstants-95ceb4e9"],function(e,a,E,r){"use strict";var N={BYTE:r.WebGLConstants.BYTE,UNSIGNED_BYTE:r.WebGLConstants.UNSIGNED_BYTE,SHORT:r.WebGLConstants.SHORT,UNSIGNED_SHORT:r.WebGLConstants.UNSIGNED_SHORT,INT:r.WebGLConstants.INT,UNSIGNED_INT:r.WebGLConstants.UNSIGNED_INT,FLOAT:r.WebGLConstants.FLOAT,DOUBLE:r.WebGLConstants.DOUBLE,getSizeInBytes:function(e){if(!a.defined(e))throw new E.DeveloperError("value is required.");switch(e){case N.BYTE:return Int8Array.BYTES_PER_ELEMENT;case N.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case N.SHORT:return Int16Array.BYTES_PER_ELEMENT;case N.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case N.INT:return Int32Array.BYTES_PER_ELEMENT;case N.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case N.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case N.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new E.DeveloperError("componentDatatype is not a valid value.")}},fromTypedArray:function(e){return e instanceof Int8Array?N.BYTE:e instanceof Uint8Array?N.UNSIGNED_BYTE:e instanceof Int16Array?N.SHORT:e instanceof Uint16Array?N.UNSIGNED_SHORT:e instanceof Int32Array?N.INT:e instanceof Uint32Array?N.UNSIGNED_INT:e instanceof Float32Array?N.FLOAT:e instanceof Float64Array?N.DOUBLE:void 0},validate:function(e){return a.defined(e)&&(e===N.BYTE||e===N.UNSIGNED_BYTE||e===N.SHORT||e===N.UNSIGNED_SHORT||e===N.INT||e===N.UNSIGNED_INT||e===N.FLOAT||e===N.DOUBLE)},createTypedArray:function(e,r){if(!a.defined(e))throw new E.DeveloperError("componentDatatype is required.");if(!a.defined(r))throw new E.DeveloperError("valuesOrLength is required.");switch(e){case N.BYTE:return new Int8Array(r);case N.UNSIGNED_BYTE:return new Uint8Array(r);case N.SHORT:return new Int16Array(r);case N.UNSIGNED_SHORT:return new Uint16Array(r);case N.INT:return new Int32Array(r);case N.UNSIGNED_INT:return new Uint32Array(r);case N.FLOAT:return new Float32Array(r);case N.DOUBLE:return new Float64Array(r);default:throw new E.DeveloperError("componentDatatype is not a valid value.")}},createArrayBufferView:function(e,r,n,t){if(!a.defined(e))throw new E.DeveloperError("componentDatatype is required.");if(!a.defined(r))throw new E.DeveloperError("buffer is required.");switch(n=a.defaultValue(n,0),t=a.defaultValue(t,(r.byteLength-n)/N.getSizeInBytes(e)),e){case N.BYTE:return new Int8Array(r,n,t);case N.UNSIGNED_BYTE:return new Uint8Array(r,n,t);case N.SHORT:return new Int16Array(r,n,t);case N.UNSIGNED_SHORT:return new Uint16Array(r,n,t);case N.INT:return new Int32Array(r,n,t);case N.UNSIGNED_INT:return new Uint32Array(r,n,t);case N.FLOAT:return new Float32Array(r,n,t);case N.DOUBLE:return new Float64Array(r,n,t);default:throw new E.DeveloperError("componentDatatype is not a valid value.")}},fromName:function(e){switch(e){case"BYTE":return N.BYTE;case"UNSIGNED_BYTE":return N.UNSIGNED_BYTE;case"SHORT":return N.SHORT;case"UNSIGNED_SHORT":return N.UNSIGNED_SHORT;case"INT":return N.INT;case"UNSIGNED_INT":return N.UNSIGNED_INT;case"FLOAT":return N.FLOAT;case"DOUBLE":return N.DOUBLE;default:throw new E.DeveloperError("name is not a valid value.")}}},n=Object.freeze(N);e.ComponentDatatype=n});