示例#1
0
 private PixelFormat(Guid guid, string name, int bpp, int channels, PixelNumericRepresentation numericRepresentation,
                     PixelColorRepresentation colorRepresentation = PixelColorRepresentation.Unspecified, PixelAlphaRepresentation alphaRepresentation = PixelAlphaRepresentation.None,
                     PixelValueEncoding encoding = PixelValueEncoding.Unspecified, bool isWic = false
                     )
 {
     FormatGuid            = guid;
     Name                  = name;
     IsWicNative           = isWic;
     BitsPerPixel          = bpp;
     ChannelCount          = channels;
     NumericRepresentation = numericRepresentation;
     ColorRepresentation   = colorRepresentation;
     AlphaRepresentation   = alphaRepresentation;
     Encoding              = encoding;
 }
示例#2
0
 internal static PixelTypeInfo Create <TPixel>(PixelAlphaRepresentation alpha)
     where TPixel : unmanaged, IPixel <TPixel>
 {
     return(new PixelTypeInfo(Unsafe.SizeOf <TPixel>() * 8, alpha));
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
 /// </summary>
 /// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
 /// <param name="alpha">The pixel alpha transparency behavior.</param>
 public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation alpha)
 {
     this.BitsPerPixel        = bitsPerPixel;
     this.AlphaRepresentation = alpha;
 }