/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{SizedPixelFormat as e,PixelType as n,SizedDepthStencilFormat as r,SizedDepthFormat as a}from"../../../webgl/enums.js";import{TextureDescriptor as t}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as o}from"../../../webgl/textureUtils.js";function s(e){switch(e){case 0:return"R8UNORM";case 1:return"R8UINT";case 2:return"RG8UNORM";case 3:return"RG8UINT";case 4:return"RGBA4UNORM";case 5:return"RGBA8UNORM";case 6:return"RGBA8UNORM_MIPMAP";case 7:return"R16FLOAT";case 8:return"RGBA16FLOAT";case 9:return"RGBA16FLOAT_MIPMAP";case 10:return"R32FLOAT";case 11:return"RG32FLOAT";case 12:return"RGBA32UINT";case 13:return"COUNT"}}function p(e){switch(e){case 13:return"DEPTH16";case 14:return"DEPTH24_STENCIL8"}}function i(e){return T(e)?p(e):s(e)}function T(e){return e>=13}const m=new t;m.pixelFormat=6403,m.internalFormat=e.R8,m.wrapMode=33071;const F=new t;F.pixelFormat=36244,F.internalFormat=e.R8UI,F.wrapMode=33071,F.samplingMode=9728;const c=new t;c.pixelFormat=33319,c.internalFormat=e.RG8,c.wrapMode=33071;const l=new t;l.pixelFormat=33320,l.internalFormat=e.RG8UI,l.wrapMode=33071,l.samplingMode=9728;const N=new t;N.internalFormat=e.RGBA4,N.dataType=n.UNSIGNED_SHORT_4_4_4_4,N.wrapMode=33071;const M=new t;M.wrapMode=33071;const R=new t;R.wrapMode=33071,R.samplingMode=9987,R.hasMipmap=!0,R.maxAnisotropy=8;const w=new t;w.pixelFormat=6403,w.dataType=n.HALF_FLOAT,w.internalFormat=e.R16F,w.samplingMode=9728;const _=new t;_.dataType=n.HALF_FLOAT,_.internalFormat=e.RGBA16F,_.wrapMode=33071;const u=new t;u.dataType=n.HALF_FLOAT,u.internalFormat=e.RGBA16F,u.wrapMode=33071,u.samplingMode=9987,u.hasMipmap=!0,u.maxAnisotropy=8;const A=new t;A.pixelFormat=6403,A.dataType=n.FLOAT,A.internalFormat=e.R32F,A.samplingMode=9728;const d=new t;d.pixelFormat=33319,d.dataType=n.FLOAT,d.internalFormat=e.RG32F,d.samplingMode=9728;const O=new t;O.pixelFormat=36249,O.dataType=n.UNSIGNED_INT,O.internalFormat=e.RGBA32UI,O.samplingMode=9728,O.wrapMode=33071;const E={0:m,1:F,2:c,3:l,4:N,5:M,6:R,7:w,8:_,9:u,10:A,11:d,12:O,13:null},I={[a.DEPTH_COMPONENT16]:n.UNSIGNED_SHORT,[a.DEPTH_COMPONENT24]:n.UNSIGNED_INT,[a.DEPTH_COMPONENT32F]:n.FLOAT,[r.DEPTH24_STENCIL8]:n.UNSIGNED_INT_24_8,[r.DEPTH32F_STENCIL8]:n.FLOAT_32_UNSIGNED_INT_24_8_REV},G={14:L(r.DEPTH24_STENCIL8),13:L(a.DEPTH_COMPONENT16)};function L(e){const n=new t;return n.pixelFormat=o(e)?6402:34041,n.dataType=I[e],n.samplingMode=9728,n.wrapMode=33071,n.internalFormat=e,n.hasMipmap=!1,n.isImmutable=!0,n}export{E as ColorFormats,G as DepthTextureFormats,i as formatString,T as isDepthFormat};
