@@ -38,7 +38,7 @@ public static int GetBT709Luminance(ref Vector4 vector, int luminanceLevels)
3838 /// <returns>The <see cref="byte"/>.</returns>
3939 [ MethodImpl ( InliningOptions . ShortMethod ) ]
4040 public static byte Get8BitBT709Luminance ( byte r , byte g , byte b ) =>
41- ( byte ) ( ( r * .2126F ) + ( g * .7152F ) + ( b * .0722F ) + 0.5f ) ;
41+ ( byte ) ( ( r * .2126F ) + ( g * .7152F ) + ( b * .0722F ) + 0.5F ) ;
4242
4343 /// <summary>
4444 /// Gets the luminance from the rgb components using the formula as specified by ITU-R Recommendation BT.709.
@@ -49,7 +49,7 @@ public static byte Get8BitBT709Luminance(byte r, byte g, byte b) =>
4949 /// <returns>The <see cref="ushort"/>.</returns>
5050 [ MethodImpl ( InliningOptions . ShortMethod ) ]
5151 public static ushort Get16BitBT709Luminance ( ushort r , ushort g , ushort b ) =>
52- ( ushort ) ( ( r * .2126F ) + ( g * .7152F ) + ( b * .0722F ) ) ;
52+ ( ushort ) ( ( r * .2126F ) + ( g * .7152F ) + ( b * .0722F ) + 0.5F ) ;
5353
5454 /// <summary>
5555 /// Gets the luminance from the rgb components using the formula as specified by ITU-R Recommendation BT.709.
@@ -60,7 +60,7 @@ public static ushort Get16BitBT709Luminance(ushort r, ushort g, ushort b) =>
6060 /// <returns>The <see cref="ushort"/>.</returns>
6161 [ MethodImpl ( InliningOptions . ShortMethod ) ]
6262 public static ushort Get16BitBT709Luminance ( float r , float g , float b ) =>
63- ( ushort ) ( ( r * .2126F ) + ( g * .7152F ) + ( b * .0722F ) ) ;
63+ ( ushort ) ( ( r * .2126F ) + ( g * .7152F ) + ( b * .0722F ) + 0.5F ) ;
6464
6565 /// <summary>
6666 /// Scales a value from a 16 bit <see cref="ushort"/> to it's 8 bit <see cref="byte"/> equivalent.
0 commit comments