Browse Source

Update src/ImageSharp/PixelFormats/HalfTypeHelper.cs

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
pull/2233/head
James Jackson-South 4 years ago
committed by GitHub
parent
commit
13701d1456
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/ImageSharp/PixelFormats/HalfTypeHelper.cs

3
src/ImageSharp/PixelFormats/HalfTypeHelper.cs

@ -18,8 +18,7 @@ internal static class HalfTypeHelper
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ushort Pack(float value)
{
Half h = (Half)value;
return Unsafe.As<Half, ushort>(ref h);
return BitConverter.HalfToUInt16Bits((Half)value);
}
/// <summary>

Loading…
Cancel
Save