@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 2.57 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{SizedPixelFormat as e,PixelType as r,SizedDepthStencilFormat as n,SizedDepthFormat as t}from"../../../webgl/enums.js";import{TextureDescriptor as a}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"RGBA32FLOAT";case 10:return"R32FLOAT";case 11:return"RG32FLOAT";case 12:return"RGBA32UINT";case 13:return"COUNT"}}function T(e){switch(e){case 13:return"DEPTH16";case 14:return"DEPTH24_STENCIL8"}}function p(e){return i(e)?T(e):s(e)}function i(e){return e>=13}const F=new a;F.pixelFormat=6403,F.internalFormat=e.R8,F.wrapMode=33071;const m=new a;m.pixelFormat=36244,m.internalFormat=e.R8UI,m.wrapMode=33071,m.samplingMode=9728;const c=new a;c.pixelFormat=33319,c.internalFormat=e.RG8,c.wrapMode=33071;const N=new a;N.pixelFormat=33320,N.internalFormat=e.RG8UI,N.wrapMode=33071,N.samplingMode=9728;const l=new a;l.internalFormat=e.RGBA4,l.dataType=r.UNSIGNED_SHORT_4_4_4_4,l.wrapMode=33071;const M=new a;M.wrapMode=33071;const R=new a;R.wrapMode=33071,R.samplingMode=9987,R.hasMipmap=!0,R.maxAnisotropy=8;const w=new a;w.pixelFormat=6403,w.dataType=r.HALF_FLOAT,w.internalFormat=e.R16F,w.samplingMode=9728;const u=new a;u.dataType=r.HALF_FLOAT,u.internalFormat=e.RGBA16F,u.wrapMode=33071;const O=new a;O.dataType=r.FLOAT,O.internalFormat=e.RGBA32F,O.wrapMode=33071;const _=new a;_.pixelFormat=6403,_.dataType=r.FLOAT,_.internalFormat=e.R32F,_.samplingMode=9728;const d=new a;d.pixelFormat=33319,d.dataType=r.FLOAT,d.internalFormat=e.RG32F,d.samplingMode=9728;const A=new a;A.pixelFormat=36249,A.dataType=r.UNSIGNED_INT,A.internalFormat=e.RGBA32UI,A.samplingMode=9728,A.wrapMode=33071;const E={0:F,1:m,2:c,3:N,4:l,5:M,6:R,7:w,8:u,9:O,10:_,11:d,12:A,13:null},G={[t.DEPTH_COMPONENT16]:r.UNSIGNED_SHORT,[t.DEPTH_COMPONENT24]:r.UNSIGNED_INT,[t.DEPTH_COMPONENT32F]:r.FLOAT,[n.DEPTH24_STENCIL8]:r.UNSIGNED_INT_24_8,[n.DEPTH32F_STENCIL8]:r.FLOAT_32_UNSIGNED_INT_24_8_REV},I={14:U(n.DEPTH24_STENCIL8),13:U(t.DEPTH_COMPONENT16)};function U(e){const r=new a;return r.pixelFormat=o(e)?6402:34041,r.dataType=G[e],r.samplingMode=9728,r.wrapMode=33071,r.internalFormat=e,r.hasMipmap=!1,r.isImmutable=!0,r}export{E as ColorFormats,I as DepthTextureFormats,p as formatString,i as isDepthFormat};