diff --git a/src/ImageSharp/PixelFormats/Alpha8.cs b/src/ImageSharp/PixelFormats/Alpha8.cs
index c184ed9cf6..582c28c789 100644
--- a/src/ImageSharp/PixelFormats/Alpha8.cs
+++ b/src/ImageSharp/PixelFormats/Alpha8.cs
@@ -62,7 +62,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Argb32.cs b/src/ImageSharp/PixelFormats/Argb32.cs
index 3749571c7b..2ca1183a30 100644
--- a/src/ImageSharp/PixelFormats/Argb32.cs
+++ b/src/ImageSharp/PixelFormats/Argb32.cs
@@ -237,7 +237,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Bgr24.cs b/src/ImageSharp/PixelFormats/Bgr24.cs
new file mode 100644
index 0000000000..2555c13a47
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/Bgr24.cs
@@ -0,0 +1,94 @@
+namespace ImageSharp.PixelFormats
+{
+ using System;
+ using System.Numerics;
+ using System.Runtime.CompilerServices;
+ using System.Runtime.InteropServices;
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Bgr24 : IPixel
+ {
+ ///
+ /// Gets or sets the blue component.
+ ///
+ public byte B;
+
+ ///
+ /// Gets or sets the green component.
+ ///
+ public byte G;
+
+ ///
+ /// Gets or sets the red component.
+ ///
+ public byte R;
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Bgr24(byte r, byte g, byte b)
+ {
+ this.R = r;
+ this.G = g;
+ this.B = b;
+ }
+
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool Equals(Bgr24 other)
+ {
+ return this.R == other.R && this.G == other.G && this.B == other.B;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return obj.GetType() == typeof(Bgr24) && this.Equals((Bgr24)obj);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int hashCode = this.B;
+ hashCode = (hashCode * 397) ^ this.G;
+ hashCode = (hashCode * 397) ^ this.R;
+ return hashCode;
+ }
+ }
+
+ public void PackFromBytes(byte x, byte y, byte z, byte w)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void PackFromVector4(Vector4 vector)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Vector4 ToVector4()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToXyzBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToXyzwBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToZyxBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToZyxwBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/PixelFormats/Bgr565.cs b/src/ImageSharp/PixelFormats/Bgr565.cs
index 92bbac14cc..6a568eeb5e 100644
--- a/src/ImageSharp/PixelFormats/Bgr565.cs
+++ b/src/ImageSharp/PixelFormats/Bgr565.cs
@@ -71,7 +71,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
/// Expands the packed representation into a .
diff --git a/src/ImageSharp/PixelFormats/Bgra4444.cs b/src/ImageSharp/PixelFormats/Bgra4444.cs
index 0bac00dfe3..2dafd0c98c 100644
--- a/src/ImageSharp/PixelFormats/Bgra4444.cs
+++ b/src/ImageSharp/PixelFormats/Bgra4444.cs
@@ -70,7 +70,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Bgra5551.cs b/src/ImageSharp/PixelFormats/Bgra5551.cs
index f151db644a..67fb4e0ec2 100644
--- a/src/ImageSharp/PixelFormats/Bgra5551.cs
+++ b/src/ImageSharp/PixelFormats/Bgra5551.cs
@@ -72,7 +72,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Byte4.cs b/src/ImageSharp/PixelFormats/Byte4.cs
index 264bc74972..2a0e6d75c3 100644
--- a/src/ImageSharp/PixelFormats/Byte4.cs
+++ b/src/ImageSharp/PixelFormats/Byte4.cs
@@ -73,7 +73,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/HalfSingle.cs b/src/ImageSharp/PixelFormats/HalfSingle.cs
index 4cc9acc222..b6f93d0593 100644
--- a/src/ImageSharp/PixelFormats/HalfSingle.cs
+++ b/src/ImageSharp/PixelFormats/HalfSingle.cs
@@ -76,7 +76,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
/// Expands the packed representation into a .
diff --git a/src/ImageSharp/PixelFormats/HalfVector2.cs b/src/ImageSharp/PixelFormats/HalfVector2.cs
index f490f71690..e96c5c0763 100644
--- a/src/ImageSharp/PixelFormats/HalfVector2.cs
+++ b/src/ImageSharp/PixelFormats/HalfVector2.cs
@@ -86,7 +86,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
/// Expands the packed representation into a .
diff --git a/src/ImageSharp/PixelFormats/HalfVector4.cs b/src/ImageSharp/PixelFormats/HalfVector4.cs
index 7c496c161b..d84a401980 100644
--- a/src/ImageSharp/PixelFormats/HalfVector4.cs
+++ b/src/ImageSharp/PixelFormats/HalfVector4.cs
@@ -89,7 +89,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/IPixel.cs b/src/ImageSharp/PixelFormats/IPixel.cs
index 030cb93f46..4e777cadf7 100644
--- a/src/ImageSharp/PixelFormats/IPixel.cs
+++ b/src/ImageSharp/PixelFormats/IPixel.cs
@@ -20,7 +20,7 @@ namespace ImageSharp.PixelFormats
/// This method is not intended to be consumed directly. Use instead.
///
/// The instance.
- PixelOperations CreateBulkOperations();
+ PixelOperations CreatePixelOperations();
}
///
diff --git a/src/ImageSharp/PixelFormats/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/NormalizedByte2.cs
index 47a4f30059..d1193e9c1c 100644
--- a/src/ImageSharp/PixelFormats/NormalizedByte2.cs
+++ b/src/ImageSharp/PixelFormats/NormalizedByte2.cs
@@ -91,7 +91,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
/// Expands the packed representation into a .
diff --git a/src/ImageSharp/PixelFormats/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/NormalizedByte4.cs
index 4559bd082f..565f269719 100644
--- a/src/ImageSharp/PixelFormats/NormalizedByte4.cs
+++ b/src/ImageSharp/PixelFormats/NormalizedByte4.cs
@@ -93,7 +93,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/NormalizedShort2.cs b/src/ImageSharp/PixelFormats/NormalizedShort2.cs
index 648b68905a..5b791eb256 100644
--- a/src/ImageSharp/PixelFormats/NormalizedShort2.cs
+++ b/src/ImageSharp/PixelFormats/NormalizedShort2.cs
@@ -91,7 +91,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/NormalizedShort4.cs b/src/ImageSharp/PixelFormats/NormalizedShort4.cs
index 7b520aacef..047c6a2507 100644
--- a/src/ImageSharp/PixelFormats/NormalizedShort4.cs
+++ b/src/ImageSharp/PixelFormats/NormalizedShort4.cs
@@ -93,7 +93,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs
index 993a11232a..5c51b59f88 100644
--- a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs
+++ b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs
@@ -20,7 +20,7 @@ namespace ImageSharp.PixelFormats
///
/// Gets the global instance for the pixel type
///
- public static PixelOperations Instance { get; } = default(TPixel).CreateBulkOperations();
+ public static PixelOperations Instance { get; } = default(TPixel).CreatePixelOperations();
///
/// Bulk version of
diff --git a/src/ImageSharp/PixelFormats/Rg32.cs b/src/ImageSharp/PixelFormats/Rg32.cs
index ea7d8729b4..0faf2fe803 100644
--- a/src/ImageSharp/PixelFormats/Rg32.cs
+++ b/src/ImageSharp/PixelFormats/Rg32.cs
@@ -76,7 +76,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
/// Expands the packed representation into a .
diff --git a/src/ImageSharp/PixelFormats/Rgb24.cs b/src/ImageSharp/PixelFormats/Rgb24.cs
new file mode 100644
index 0000000000..ff2b237ad8
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/Rgb24.cs
@@ -0,0 +1,94 @@
+namespace ImageSharp.PixelFormats
+{
+ using System;
+ using System.Numerics;
+ using System.Runtime.CompilerServices;
+ using System.Runtime.InteropServices;
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Rgb24 : IPixel
+ {
+ ///
+ /// Gets or sets the red component.
+ ///
+ public byte R;
+
+ ///
+ /// Gets or sets the green component.
+ ///
+ public byte G;
+
+ ///
+ /// Gets or sets the blue component.
+ ///
+ public byte B;
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Rgb24(byte r, byte g, byte b)
+ {
+ this.R = r;
+ this.G = g;
+ this.B = b;
+ }
+
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool Equals(Rgb24 other)
+ {
+ return this.R == other.R && this.G == other.G && this.B == other.B;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return obj.GetType() == typeof(Rgb24) && this.Equals((Rgb24)obj);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int hashCode = this.R;
+ hashCode = (hashCode * 397) ^ this.G;
+ hashCode = (hashCode * 397) ^ this.B;
+ return hashCode;
+ }
+ }
+
+ public void PackFromBytes(byte x, byte y, byte z, byte w)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void PackFromVector4(Vector4 vector)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Vector4 ToVector4()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToXyzBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToXyzwBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToZyxBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ToZyxwBytes(Span bytes, int startIndex)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ImageSharp/PixelFormats/Rgba1010102.cs b/src/ImageSharp/PixelFormats/Rgba1010102.cs
index ca7b74fbbd..8eaf5f7713 100644
--- a/src/ImageSharp/PixelFormats/Rgba1010102.cs
+++ b/src/ImageSharp/PixelFormats/Rgba1010102.cs
@@ -79,7 +79,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Rgba32.cs b/src/ImageSharp/PixelFormats/Rgba32.cs
index 446da5abb4..ba46332fbf 100644
--- a/src/ImageSharp/PixelFormats/Rgba32.cs
+++ b/src/ImageSharp/PixelFormats/Rgba32.cs
@@ -23,31 +23,27 @@ namespace ImageSharp
/// This struct is fully mutable. This is done (against the guidelines) for the sake of performance,
/// as it avoids the need to create new values for modification operations.
///
- [StructLayout(LayoutKind.Explicit)]
+ [StructLayout(LayoutKind.Sequential)]
public partial struct Rgba32 : IPixel, IPackedVector
{
///
/// Gets or sets the red component.
///
- [FieldOffset(0)]
public byte R;
///
/// Gets or sets the green component.
///
- [FieldOffset(1)]
public byte G;
///
/// Gets or sets the blue component.
///
- [FieldOffset(2)]
public byte B;
///
/// Gets or sets the alpha component.
///
- [FieldOffset(3)]
public byte A;
///
@@ -233,7 +229,7 @@ namespace ImageSharp
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Rgba64.cs b/src/ImageSharp/PixelFormats/Rgba64.cs
index 4178283686..2101d4ba0e 100644
--- a/src/ImageSharp/PixelFormats/Rgba64.cs
+++ b/src/ImageSharp/PixelFormats/Rgba64.cs
@@ -78,7 +78,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/RgbaVector.cs b/src/ImageSharp/PixelFormats/RgbaVector.cs
index 5332f4a8e7..314ac31e3b 100644
--- a/src/ImageSharp/PixelFormats/RgbaVector.cs
+++ b/src/ImageSharp/PixelFormats/RgbaVector.cs
@@ -211,7 +211,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new RgbaVector.PixelOperations();
+ public PixelOperations CreatePixelOperations() => new RgbaVector.PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Short2.cs b/src/ImageSharp/PixelFormats/Short2.cs
index b848b55053..a6fe95b49f 100644
--- a/src/ImageSharp/PixelFormats/Short2.cs
+++ b/src/ImageSharp/PixelFormats/Short2.cs
@@ -91,7 +91,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/PixelFormats/Short4.cs b/src/ImageSharp/PixelFormats/Short4.cs
index 763de19bc3..f254c7379f 100644
--- a/src/ImageSharp/PixelFormats/Short4.cs
+++ b/src/ImageSharp/PixelFormats/Short4.cs
@@ -93,7 +93,7 @@ namespace ImageSharp.PixelFormats
}
///
- public PixelOperations CreateBulkOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/Shared/stylecop.json b/src/Shared/stylecop.json
index df8f120a5b..b74a0af91d 100644
--- a/src/Shared/stylecop.json
+++ b/src/Shared/stylecop.json
@@ -3,7 +3,11 @@
"settings": {
"documentationRules": {
"companyName": "James Jackson-South",
- "copyrightText": "Copyright (c) James Jackson-South and contributors.\nLicensed under the Apache License, Version 2.0."
+ "copyrightText": "Copyright (c) James Jackson-South and contributors.\nLicensed under the Apache License, Version 2.0.",
+
+ "documentInterfaces": false,
+ "documentInternalElements": false,
+ "documentExposedElements": false
}
}
}
\ No newline at end of file
diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperations.cs b/tests/ImageSharp.Sandbox46/Tests/PixelFormats/PixelBlenderTests.cs
similarity index 96%
rename from tests/ImageSharp.Tests/PixelFormats/PixelOperations.cs
rename to tests/ImageSharp.Sandbox46/Tests/PixelFormats/PixelBlenderTests.cs
index a9108692ed..7efd3a6fcb 100644
--- a/tests/ImageSharp.Tests/PixelFormats/PixelOperations.cs
+++ b/tests/ImageSharp.Sandbox46/Tests/PixelFormats/PixelBlenderTests.cs
@@ -15,7 +15,7 @@ namespace ImageSharp.Tests.PixelFormats
public class PixelOperations
{
- public static TheoryData