Esempio n. 1
0
 public static void SetUpHeaderForFormat(BitmapFormat format, DDSHeader header)
 {
     if (!ExtractionDefinitions.TryGetValue(format, out BitmapFormatDefinition definition))
     {
         throw new InvalidOperationException("Invalid bitmap format: " + format);
     }
     header.PixelFormat.RGBBitCount = definition.BitsPerPixel;
     header.PixelFormat.RBitMask    = definition.RBitMask;
     header.PixelFormat.GBitMask    = definition.GBitMask;
     header.PixelFormat.BBitMask    = definition.BBitMask;
     header.PixelFormat.ABitMask    = definition.ABitMask;
     header.PixelFormat.FourCC      = definition.FourCc;
 }
Esempio n. 2
0
 public static void SetUpHeaderForFormat(BitmapFormat format, DdsHeader header)
 {
     if (!ExtractionDefinitions.TryGetValue(format, out BitmapFormatDefinition definition))
     {
         throw new InvalidOperationException("Invalid bitmap format: " + format);
     }
     header.FormatType   = definition.FormatType;
     header.BitsPerPixel = definition.BitsPerPixel;
     header.RBitMask     = definition.RBitMask;
     header.GBitMask     = definition.GBitMask;
     header.BBitMask     = definition.BBitMask;
     header.ABitMask     = definition.ABitMask;
     header.FourCc       = definition.FourCc;
     header.D3D10Format  = definition.D3D10Format;
 }