Browse Source

using LayoutKind.Explicit for bgr24, to fix CloneAs_ToBgr24 failing sporadically (#576)

pull/591/head
popow 8 years ago
parent
commit
7f7e6d3bc2
  1. 5
      src/ImageSharp/PixelFormats/Bgr24.cs

5
src/ImageSharp/PixelFormats/Bgr24.cs

@ -14,22 +14,25 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form.
/// </para>
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Explicit)]
public struct Bgr24 : IPixel<Bgr24>
{
/// <summary>
/// The blue component.
/// </summary>
[FieldOffset(0)]
public byte B;
/// <summary>
/// The green component.
/// </summary>
[FieldOffset(1)]
public byte G;
/// <summary>
/// The red component.
/// </summary>
[FieldOffset(2)]
public byte R;
/// <summary>

Loading…
Cancel
Save