import { AlphaFormat, DepthFormat, DepthStencilFormat, LuminanceAlphaFormat, LuminanceFormat, RedFormat, RedIntegerFormat, RGBAFormat, RGBAIntegerFormat, RGFormat, RGIntegerFormat } from 'three'; export const pixelFormatValues = { AlphaFormat, RGBAFormat, LuminanceFormat, LuminanceAlphaFormat, DepthFormat, DepthStencilFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, // _SRGBFormat, // fallback for WebGL 1 // _SRGBAFormat, // fallback for WebGL 1 }; export const pixelFormatNames: { [v: number]: PixelFormat } = {}; Object.keys(pixelFormatValues).forEach((k: PixelFormat) => { pixelFormatNames[pixelFormatValues[k]] = k; }); export type PixelFormat = keyof typeof pixelFormatValues;