Axiom.Media.DDSCodec.ConvertFourCCFormat C# (CSharp) Method

ConvertFourCCFormat() private method

private ConvertFourCCFormat ( UInt32 fourcc ) : PixelFormat
fourcc System.UInt32
return PixelFormat
        private PixelFormat ConvertFourCCFormat( UInt32 fourcc )
        {
		// convert dxt pixel format
			if (fourcc == FourCC.DXT1)
				return PixelFormat.DXT1;
			if (fourcc == FourCC.DXT2)
				return PixelFormat.DXT2;
			if (fourcc == FourCC.DXT3)
				return PixelFormat.DXT3;
			if (fourcc == FourCC.DXT4)
				return PixelFormat.DXT4;
			if (fourcc == FourCC.DXT5)
				return PixelFormat.DXT5;
			switch (fourcc)
			{
				case D3DFMT_R16F:
					return PixelFormat.FLOAT16_R;
				case D3DFMT_G16R16F:
					return PixelFormat.FLOAT16_GR;
				case D3DFMT_A16B16G16R16F:
					return PixelFormat.FLOAT16_RGBA;
				case D3DFMT_R32F:
					return PixelFormat.FLOAT32_R;
				case D3DFMT_G32R32F:
					return PixelFormat.FLOAT32_GR;
				case D3DFMT_A32B32G32R32F:
					return PixelFormat.FLOAT32_RGBA;
					// We could support 3Dc here, but only ATI cards support it, not nVidia
				default:
					throw new AxiomException( "Unsupported FourCC format found in DDS file" );
			}
        }