@@ -36,31 +36,31 @@ private BmpMetadata(BmpMetadata other)
3636 /// <summary>
3737 /// Gets or sets the number of bits per pixel.
3838 /// </summary>
39- public BmpBitsPerPixel BitsPerPixel { get ; set ; } = BmpBitsPerPixel . Pixel24 ;
39+ public BmpBitsPerPixel BitsPerPixel { get ; set ; } = BmpBitsPerPixel . Bit24 ;
4040
4141 /// <inheritdoc/>
4242 public static BmpMetadata FromFormatConnectingMetadata ( FormatConnectingMetadata metadata )
4343 {
4444 int bpp = metadata . PixelTypeInfo . BitsPerPixel ;
4545 return bpp switch
4646 {
47- 1 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Pixel1 } ,
48- 2 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Pixel2 } ,
49- <= 4 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Pixel4 } ,
50- <= 8 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Pixel8 } ,
47+ 1 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Bit1 } ,
48+ 2 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Bit2 } ,
49+ <= 4 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Bit4 } ,
50+ <= 8 => new BmpMetadata { BitsPerPixel = BmpBitsPerPixel . Bit8 } ,
5151 <= 16 => new BmpMetadata
5252 {
53- BitsPerPixel = BmpBitsPerPixel . Pixel16 ,
53+ BitsPerPixel = BmpBitsPerPixel . Bit16 ,
5454 InfoHeaderType = BmpInfoHeaderType . WinVersion3
5555 } ,
5656 <= 24 => new BmpMetadata
5757 {
58- BitsPerPixel = BmpBitsPerPixel . Pixel24 ,
58+ BitsPerPixel = BmpBitsPerPixel . Bit24 ,
5959 InfoHeaderType = BmpInfoHeaderType . WinVersion4
6060 } ,
6161 _ => new BmpMetadata
6262 {
63- BitsPerPixel = BmpBitsPerPixel . Pixel32 ,
63+ BitsPerPixel = BmpBitsPerPixel . Bit32 ,
6464 InfoHeaderType = BmpInfoHeaderType . WinVersion5
6565 }
6666 } ;
@@ -92,34 +92,34 @@ BmpInfoHeaderType.WinVersion5 or
9292 PixelColorType color ;
9393 switch ( this . BitsPerPixel )
9494 {
95- case BmpBitsPerPixel . Pixel1 :
95+ case BmpBitsPerPixel . Bit1 :
9696 info = PixelComponentInfo . Create ( 1 , bpp , 1 ) ;
9797 color = PixelColorType . Indexed ;
9898 break ;
99- case BmpBitsPerPixel . Pixel2 :
99+ case BmpBitsPerPixel . Bit2 :
100100 info = PixelComponentInfo . Create ( 1 , bpp , 2 ) ;
101101 color = PixelColorType . Indexed ;
102102 break ;
103- case BmpBitsPerPixel . Pixel4 :
103+ case BmpBitsPerPixel . Bit4 :
104104 info = PixelComponentInfo . Create ( 1 , bpp , 4 ) ;
105105 color = PixelColorType . Indexed ;
106106 break ;
107- case BmpBitsPerPixel . Pixel8 :
107+ case BmpBitsPerPixel . Bit8 :
108108 info = PixelComponentInfo . Create ( 1 , bpp , 8 ) ;
109109 color = PixelColorType . Indexed ;
110110 break ;
111111
112112 // Could be 555 with padding but 565 is more common in newer bitmaps and offers
113113 // greater accuracy due to extra green precision.
114- case BmpBitsPerPixel . Pixel16 :
114+ case BmpBitsPerPixel . Bit16 :
115115 info = PixelComponentInfo . Create ( 3 , bpp , 5 , 6 , 5 ) ;
116116 color = PixelColorType . RGB ;
117117 break ;
118- case BmpBitsPerPixel . Pixel24 :
118+ case BmpBitsPerPixel . Bit24 :
119119 info = PixelComponentInfo . Create ( 3 , bpp , 8 , 8 , 8 ) ;
120120 color = PixelColorType . RGB ;
121121 break ;
122- case BmpBitsPerPixel . Pixel32 or _:
122+ case BmpBitsPerPixel . Bit32 or _:
123123 info = PixelComponentInfo . Create ( 4 , bpp , 8 , 8 , 8 , 8 ) ;
124124 color = PixelColorType . RGB | PixelColorType . Alpha ;
125125 break ;
0 commit comments