public GenericBitmapTexture(byte[] FileData, int width, int height) { Format = TEX_FORMAT.R8G8B8A8_UNORM; Width = (uint)width; Height = (uint)height; ImageData = DDSCompressor.CompressBlock(FileData, width, height, DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB); }
public static byte[] CompressBlock(byte[] data, int width, int height, TEX_FORMAT format, TEX_FORMAT_TYPE type, float alphaRef) { if (IsCompressed(format)) { return(DDSCompressor.CompressBlock(data, width, height, DDS.GetDXGI_Format(format, type), alphaRef)); } else if (IsAtscFormat(format)) { return(null); } else { return(DDSCompressor.EncodePixelBlock(data, width, height, DDS.GetDXGI_Format(format, type))); } }
public static byte[] CompressBlock(byte[] data, int width, int height, TEX_FORMAT format, float alphaRef, STCompressionMode CompressionMode = STCompressionMode.Fast) { if (IsCompressed(format)) { return(DDSCompressor.CompressBlock(data, width, height, (DDS.DXGI_FORMAT)format, alphaRef, CompressionMode)); } else if (IsAtscFormat(format)) { return(null); } else { return(DDSCompressor.EncodePixelBlock(data, width, height, (DDS.DXGI_FORMAT)format)); } }