Esempio n. 1
0
        public override void SetImageData(Bitmap bitmap, int ArrayLevel)
        {
            byte[] Data = BitmapExtension.ImageToByte(bitmap);
            Width  = (uint)bitmap.Width;
            Height = (uint)bitmap.Height;

            ImageData = DDSCompressor.EncodePixelBlock(Data, bitmap.Width, bitmap.Width, DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB);
        }
Esempio n. 2
0
 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));
     }
 }