/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{MeshWriter as t}from"../mesh/MeshWriter.js";import{DataType as e}from"../../../../../../webgl/enums.js";const r={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:e.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:e.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:e.UNSIGNED_BYTE,count:1},offset:{type:e.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};class i extends t{constructor(){super(...arguments),this.vertexSpec=r}_write(t,{target:e}){t.recordStart(this.instanceId,this.attributeLayout);const r=e.getDisplayId();if("esriGeometryPoint"===e.geometryType){const i=e.readXForDisplay(),o=e.readYForDisplay();this._writeQuad(t,r,i,o)}else if("esriGeometryMultipoint"===e.geometryType){const i=e.readGeometryForDisplay();i?.forEachVertex((e,i)=>{e>=0&&e<=512&&i>=0&&i<=512&&this._writeQuad(t,r,e,i)})}t.recordEnd()}_writeQuad(t,e,r,i){const o=t.vertexCount();this._writeVertex(t,e,r,i),t.indexWrite(o+0),t.indexWrite(o+1),t.indexWrite(o+2),t.indexWrite(o+1),t.indexWrite(o+3),t.indexWrite(o+2)}}export{i as HeatmapMeshWriter,r as heatmapVertexSpec};
