/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
class e{constructor(e,t,r,s=0){this.layout=e,this.byteOffset=s,this._bufferViews=new Map,this.buffer="number"==typeof t?new ArrayBuffer(t*e.byteStride):t,this.texelElementBuffer=new r(this.buffer,s);const f=this._bufferViews;for(const[n,i]of this.layout.fields)f.set(n,new i.bufferViewConstructor(this.buffer,s+i.byteOffset,this.layout.byteStride))}get stride(){return this.layout.byteStride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this._bufferViews.get(e);return null!=r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}get usedMemory(){return this.byteLength}}export{e as TextureBufferView};
