{"version":3,"sources":["webpack:///./node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Colorize.js"],"names":["r","this","_size","_programDesc","vsPath","fsPath","attributes","Map","_layerFBOTexture","dispose","e","t","width","s","height","i","_createOrResizeResources","context","o","painter","a","materialManager","n","l","c","_quad","u","colorMatrix","bind","p","bindFramebuffer","copyToTexture","setBlendingEnabled","setStencilTestEnabled","h","getProgram","useProgram","bindTexture","setUniformMatrix4fv","setUniform1i","draw","setBlendFunction","unbind","resize","target","pixelFormat","internalFormat","dataType","wrapMode","samplingMode","flipped"],"mappings":"kHAAA,oJAI+Y,MAAMA,EAAE,cAAcC,KAAKC,MAAM,CAAC,EAAE,GAAGD,KAAKE,aAAa,CAACC,OAAO,qBAAqBC,OAAO,+BAA+BC,WAAW,IAAIC,IAAI,CAAC,CAAC,aAAa,MAAM,UAAUN,KAAKO,mBAAmBP,KAAKO,iBAAiBC,UAAUR,KAAKO,iBAAiB,MAAM,KAAKE,EAAEC,EAAEX,GAAG,MAAMY,MAAMC,EAAEC,OAAOC,GAAGJ,EAAEV,KAAKe,yBAAyBN,EAAEG,EAAEE,GAAG,MAAME,QAAQC,EAAEC,QAAQC,GAAGV,GAAGW,gBAAgBC,GAAGF,EAAEG,EAAEtB,KAAKE,aAAaqB,EAAEvB,KAAKwB,MAAMC,EAAE1B,EAAE2B,YAAYH,EAAEI,OAAO,MAAMC,EAAE5B,KAAKO,iBAAiBU,EAAEY,gBAAgBnB,GAAGA,EAAEoB,cAAc,EAAE,EAAElB,EAAEE,EAAE,EAAE,EAAEc,GAAGX,EAAEc,oBAAmB,GAAId,EAAEe,uBAAsB,GAAI,MAAMC,EAAEZ,EAAEa,WAAWzB,EAAEa,GAAGL,EAAEkB,WAAWF,GAAGhB,EAAEmB,YAAYR,EAAE,GAAGK,EAAEI,oBAAoB,iBAAiBZ,GAAGQ,EAAEK,aAAa,iBAAiB,GAAGf,EAAEgB,OAAOtB,EAAEc,oBAAmB,GAAId,EAAEuB,iBAAiB,EAAE,KAAKvB,EAAEe,uBAAsB,GAAIT,EAAEkB,SAAS,yBAAyB1C,EAAEa,EAAEE,GAAG,MAAME,QAAQC,GAAGlB,EAAEC,KAAKO,kBAAkBP,KAAKC,MAAM,KAAKW,GAAGZ,KAAKC,MAAM,KAAKa,IAAId,KAAKC,MAAM,GAAGW,EAAEZ,KAAKC,MAAM,GAAGa,EAAEd,KAAKO,iBAAiBP,KAAKO,iBAAiBmC,OAAO9B,EAAEE,GAAGd,KAAKO,iBAAiB,IAAI,OAAEU,EAAE,CAAC0B,OAAO,KAAKC,YAAY,KAAKC,eAAe,KAAKC,SAAS,KAAKC,SAAS,MAAMC,aAAa,KAAKC,SAAQ,EAAGtC,MAAMC,EAAEC,OAAOC,IAAId,KAAKwB,QAAQxB,KAAKwB,MAAM,IAAI,OAAEP,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE","file":"js/chunk-2d0c55a7.bb23c375.js","sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.20/esri/copyright.txt for details.\n*/\nimport\"../../../../../webgl/BufferObject.js\";import\"../../../../../webgl/FramebufferObject.js\";import\"../../../../../../core/has.js\";import\"../../../../../webgl/enums.js\";import\"../../../../../webgl/RenderingContext.js\";import\"../../../../../../chunks/builtins.js\";import e from\"../../../../../webgl/Texture.js\";import\"../../../../../webgl/VertexArrayObject.js\";import t from\"../../VertexStream.js\";class r{constructor(){this._size=[0,0],this._programDesc={vsPath:\"post-processing/pp\",fsPath:\"post-processing/filterEffect\",attributes:new Map([[\"a_position\",0]])}}dispose(){this._layerFBOTexture&&(this._layerFBOTexture.dispose(),this._layerFBOTexture=null)}draw(e,t,r){const{width:s,height:i}=t;this._createOrResizeResources(e,s,i);const{context:o,painter:a}=e,{materialManager:n}=a,l=this._programDesc,c=this._quad,u=r.colorMatrix;c.bind();const p=this._layerFBOTexture;o.bindFramebuffer(t),t.copyToTexture(0,0,s,i,0,0,p),o.setBlendingEnabled(!1),o.setStencilTestEnabled(!1);const h=n.getProgram(e,l);o.useProgram(h),o.bindTexture(p,2),h.setUniformMatrix4fv(\"u_coefficients\",u),h.setUniform1i(\"u_colorTexture\",2),c.draw(),o.setBlendingEnabled(!0),o.setBlendFunction(1,771),o.setStencilTestEnabled(!0),c.unbind()}_createOrResizeResources(r,s,i){const{context:o}=r;this._layerFBOTexture&&this._size[0]===s&&this._size[1]===i||(this._size[0]=s,this._size[1]=i,this._layerFBOTexture?this._layerFBOTexture.resize(s,i):this._layerFBOTexture=new e(o,{target:3553,pixelFormat:6408,internalFormat:6408,dataType:5121,wrapMode:33071,samplingMode:9729,flipped:!1,width:s,height:i}),this._quad||(this._quad=new t(o,[-1,-1,1,-1,-1,1,1,1])))}}export{r as Colorize};\n"],"sourceRoot":""}