diff --git a/src/ImageSharp/Formats/PixelTypeInfo.cs b/src/ImageSharp/Formats/PixelTypeInfo.cs
index d53d496fa5..718b05e33a 100644
--- a/src/ImageSharp/Formats/PixelTypeInfo.cs
+++ b/src/ImageSharp/Formats/PixelTypeInfo.cs
@@ -1,8 +1,7 @@
-// Copyright (c) Six Labors.
+// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices;
-
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats
@@ -16,9 +15,11 @@ public class PixelTypeInfo
/// Initializes a new instance of the class.
///
/// Color depth, in number of bits per pixel.
- internal PixelTypeInfo(int bitsPerPixel)
+ /// Tthe pixel alpha transparency behavior.
+ internal PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null)
{
this.BitsPerPixel = bitsPerPixel;
+ this.AlphaRepresentation = alpha;
}
///
@@ -26,8 +27,20 @@ internal PixelTypeInfo(int bitsPerPixel)
///
public int BitsPerPixel { get; }
+ ///
+ /// Gets the pixel alpha transparency behavior.
+ /// means unknown, unspecified.
+ ///
+ public PixelAlphaRepresentation? AlphaRepresentation { get; }
+
internal static PixelTypeInfo Create()
where TPixel : unmanaged, IPixel =>
new PixelTypeInfo(Unsafe.SizeOf() * 8);
+
+ internal static PixelTypeInfo Create(PixelAlphaRepresentation alpha)
+ where TPixel : unmanaged, IPixel
+ {
+ return new PixelTypeInfo(Unsafe.SizeOf() * 8, alpha);
+ }
}
}
diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj
index c3d9618c8c..f4e9851986 100644
--- a/src/ImageSharp/ImageSharp.csproj
+++ b/src/ImageSharp/ImageSharp.csproj
@@ -62,62 +62,62 @@
True
PixelOperations{TPixel}.Generated.tt
-
+
True
True
Argb32.PixelOperations.Generated.tt
-
+
True
True
Bgr24.PixelOperations.Generated.tt
-
+
True
True
Bgra32.PixelOperations.Generated.tt
-
+
True
True
Bgra5551.PixelOperations.Generated.tt
-
+
True
True
- L8.PixelOperations.Generated.tt
+ L16.PixelOperations.Generated.tt
-
+
True
True
- L16.PixelOperations.Generated.tt
+ L8.PixelOperations.Generated.tt
-
+
True
True
La16.PixelOperations.Generated.tt
-
+
True
True
La32.PixelOperations.Generated.tt
-
+
True
True
Rgb24.PixelOperations.Generated.tt
-
+
True
True
- Rgba32.PixelOperations.Generated.tt
+ Rgb48.PixelOperations.Generated.tt
-
+
True
True
- Rgb48.PixelOperations.Generated.tt
+ Rgba32.PixelOperations.Generated.tt
-
+
True
True
Rgba64.PixelOperations.Generated.tt
@@ -156,51 +156,51 @@
TextTemplatingFileGenerator
PixelOperations{TPixel}.Generated.cs
-
+
TextTemplatingFileGenerator
Argb32.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Bgr24.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Bgra32.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Bgra5551.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
L8.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
L16.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
La16.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
La32.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Rgb24.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Rgba32.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Rgb48.PixelOperations.Generated.cs
-
+
TextTemplatingFileGenerator
Rgba64.PixelOperations.Generated.cs
diff --git a/src/ImageSharp/PixelFormats/PixelAlphaRepresentation.cs b/src/ImageSharp/PixelFormats/PixelAlphaRepresentation.cs
new file mode 100644
index 0000000000..4690fb66ab
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelAlphaRepresentation.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides enumeration of the alpha value transparency behavior of a pixel format.
+ ///
+ public enum PixelAlphaRepresentation
+ {
+ ///
+ /// Indicates that the pixel format does not contain an alpha channel.
+ ///
+ None,
+
+ ///
+ /// Indicates that the transparency behavior is premultiplied.
+ /// Each color is first scaled by the alpha value. The alpha value itself is the same
+ /// in both straight and premultiplied alpha. Typically, no color channel value is
+ /// greater than the alpha channel value.
+ /// If a color channel value in a premultiplied format is greater than the alpha
+ /// channel, the standard source-over blending math results in an additive blend.
+ ///
+ Associated,
+
+ ///
+ /// Indicates that the transparency behavior is not premultiplied.
+ /// The alpha channel indicates the transparency of the color.
+ ///
+ Unassociated
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs b/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs
index b19c35a0ab..fc0723e9a7 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/A8.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [0, 0, 0, 0] to [0, 0, 0, 1] in vector form.
///
///
- public struct A8 : IPixel, IPackedVector
+ public partial struct A8 : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -57,7 +57,7 @@ public struct A8 : IPixel, IPackedVector
public static bool operator !=(A8 left, A8 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs
index 21ec24a6e6..fd12b68376 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgr565.cs
@@ -14,7 +14,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [0, 0, 0, 1] to [1, 1, 1, 1] in vector form.
///
///
- public struct Bgr565 : IPixel, IPackedVector
+ public partial struct Bgr565 : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -61,7 +61,7 @@ public Bgr565(float x, float y, float z)
public static bool operator !=(Bgr565 left, Bgr565 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs
index b2af3045a3..c8d2a82a84 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/Bgra4444.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form.
///
///
- public struct Bgra4444 : IPixel, IPackedVector
+ public partial struct Bgra4444 : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -59,7 +59,7 @@ public Bgra4444(float x, float y, float z, float w)
public static bool operator !=(Bgra4444 left, Bgra4444 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs
index 9c5289b86e..ad22a5aa17 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/Byte4.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [0, 0, 0, 0] to [255, 255, 255, 255] in vector form.
///
///
- public struct Byte4 : IPixel, IPackedVector
+ public partial struct Byte4 : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -62,7 +62,7 @@ public Byte4(float x, float y, float z, float w)
public static bool operator !=(Byte4 left, Byte4 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs
index e3e6e1383b..5c4aa1cfb6 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfSingle.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, 0, 0, 1] to [1, 0, 0, 1] in vector form.
///
///
- public struct HalfSingle : IPixel, IPackedVector
+ public partial struct HalfSingle : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -47,7 +47,7 @@ public struct HalfSingle : IPixel, IPackedVector
public static bool operator !=(HalfSingle left, HalfSingle right) => !left.Equals(right);
///
- public PixelOperations CreatePixelOperations() => new PixelOperations();
+ public PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs
index 43380eac03..39cb6f7993 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, -1, 0, 1] to [1, 1, 0, 1] in vector form.
///
///
- public struct HalfVector2 : IPixel, IPackedVector
+ public partial struct HalfVector2 : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -54,13 +54,13 @@ public struct HalfVector2 : IPixel, IPackedVector
public static bool operator !=(HalfVector2 left, HalfVector2 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
public void FromScaledVector4(Vector4 vector)
{
- var scaled = new Vector2(vector.X, vector.Y) * 2F;
+ Vector2 scaled = new Vector2(vector.X, vector.Y) * 2F;
scaled -= Vector2.One;
this.PackedValue = Pack(scaled.X, scaled.Y);
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs
index cb1ae1f404..9826d61a2b 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector4.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, -1, -1, -1] to [1, 1, 1, 1] in vector form.
///
///
- public struct HalfVector4 : IPixel, IPackedVector
+ public partial struct HalfVector4 : IPixel, IPackedVector
{
///
/// Initializes a new instance of the struct.
@@ -59,7 +59,7 @@ public HalfVector4(float x, float y, float z, float w)
public static bool operator !=(HalfVector4 left, HalfVector4 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs
index 70098b6665..8b244d391c 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, -1, 0, 1] to [1, 1, 0, 1] in vector form.
///
///
- public struct NormalizedByte2 : IPixel, IPackedVector
+ public partial struct NormalizedByte2 : IPixel, IPackedVector
{
private static readonly Vector2 Half = new Vector2(127);
private static readonly Vector2 MinusOne = new Vector2(-1F);
@@ -60,7 +60,7 @@ public NormalizedByte2(float x, float y)
public static bool operator !=(NormalizedByte2 left, NormalizedByte2 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs
index 2762073aa1..1b2ce0904c 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, -1, -1, -1] to [1, 1, 1, 1] in vector form.
///
///
- public struct NormalizedByte4 : IPixel, IPackedVector
+ public partial struct NormalizedByte4 : IPixel, IPackedVector
{
private static readonly Vector4 Half = new Vector4(127);
private static readonly Vector4 MinusOne = new Vector4(-1F);
@@ -62,7 +62,7 @@ public NormalizedByte4(float x, float y, float z, float w)
public static bool operator !=(NormalizedByte4 left, NormalizedByte4 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs
index 8eaec1411c..97bbc1206f 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, -1, 0, 1] to [1, 1, 0, 1] in vector form.
///
///
- public struct NormalizedShort2 : IPixel, IPackedVector
+ public partial struct NormalizedShort2 : IPixel, IPackedVector
{
private static readonly Vector2 Max = new Vector2(0x7FFF);
private static readonly Vector2 Min = Vector2.Negate(Max);
@@ -60,7 +60,7 @@ public NormalizedShort2(float x, float y)
public static bool operator !=(NormalizedShort2 left, NormalizedShort2 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs
index ce7c0035f6..1a5c891740 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort4.cs
@@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Ranges from [-1, -1, -1, -1] to [1, 1, 1, 1] in vector form.
///
///
- public struct NormalizedShort4 : IPixel, IPackedVector
+ public partial struct NormalizedShort4 : IPixel, IPackedVector
{
private static readonly Vector4 Max = new Vector4(0x7FFF);
private static readonly Vector4 Min = Vector4.Negate(Max);
@@ -62,7 +62,7 @@ public NormalizedShort4(float x, float y, float z, float w)
public static bool operator !=(NormalizedShort4 left, NormalizedShort4 right) => !left.Equals(right);
///
- public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
+ public readonly PixelOperations CreatePixelOperations() => new PixelOperations();
///
[MethodImpl(InliningOptions.ShortMethod)]
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/A8.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/A8.PixelOperations.cs
new file mode 100644
index 0000000000..7482a2e251
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/A8.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct A8
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Argb32.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Argb32.PixelOperations.cs
new file mode 100644
index 0000000000..f8f5715bd4
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Argb32.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Argb32
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal partial class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr24.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr24.PixelOperations.cs
new file mode 100644
index 0000000000..adae64d5de
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr24.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Bgr24
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal partial class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.None), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr565.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr565.PixelOperations.cs
new file mode 100644
index 0000000000..d75b79f5dd
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr565.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Bgr565
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.None), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra32.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra32.PixelOperations.cs
new file mode 100644
index 0000000000..5f7e516e59
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra32.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Bgra32
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal partial class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra4444.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra4444.PixelOperations.cs
new file mode 100644
index 0000000000..eac8e4f170
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra4444.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Bgra4444
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra5551.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra5551.PixelOperations.cs
new file mode 100644
index 0000000000..d0470b7a1f
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra5551.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Bgra5551
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal partial class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Byte4.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Byte4.PixelOperations.cs
new file mode 100644
index 0000000000..0a2fa10b2d
--- /dev/null
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Byte4.PixelOperations.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Six Labors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp.Formats;
+
+namespace SixLabors.ImageSharp.PixelFormats
+{
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ public partial struct Byte4
+ {
+ ///
+ /// Provides optimized overrides for bulk operations.
+ ///
+ internal class PixelOperations : PixelOperations
+ {
+ private static readonly Lazy LazyInfo =
+ new Lazy(() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated), true);
+
+ ///
+ public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
+ }
+ }
+}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs
similarity index 86%
rename from src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs
rename to src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs
index d30616997c..9df708d44d 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs
@@ -1,15 +1,13 @@
-// Copyright (c) Six Labors.
+// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
//
-using SixLabors.ImageSharp.PixelFormats.Utils;
using System;
-using System.Buffers;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-
+using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats
{
@@ -21,8 +19,9 @@ public partial struct Argb32
///
/// Provides optimized overrides for bulk operations.
///
- internal class PixelOperations : PixelOperations
+ internal partial class PixelOperations : PixelOperations
{
+
///
public override void FromArgb32(Configuration configuration, ReadOnlySpan source, Span destinationPixels)
{
@@ -42,16 +41,25 @@ public override void ToArgb32(Configuration configuration, ReadOnlySpan
}
///
- public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destinationPixels, PixelConversionModifiers modifiers)
+ public override void FromVector4Destructive(
+ Configuration configuration,
+ Span sourceVectors,
+ Span destinationPixels,
+ PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destinationPixels, modifiers.Remove(PixelConversionModifiers.Scale));
}
///
- public override void ToVector4(Configuration configuration, ReadOnlySpan sourcePixels, Span destVectors, PixelConversionModifiers modifiers)
+ public override void ToVector4(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destVectors,
+ PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale));
}
+
///
public override void ToRgba32(
Configuration configuration,
@@ -79,6 +87,7 @@ public override void FromRgba32(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromRgba32.ToArgb32(source, dest);
}
+
///
public override void ToBgra32(
Configuration configuration,
@@ -106,6 +115,7 @@ public override void FromBgra32(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromBgra32.ToArgb32(source, dest);
}
+
///
public override void ToRgb24(
Configuration configuration,
@@ -133,6 +143,7 @@ public override void FromRgb24(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromRgb24.ToArgb32(source, dest);
}
+
///
public override void ToBgr24(
Configuration configuration,
@@ -162,7 +173,10 @@ public override void FromBgr24(
}
///
- public override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToL8(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -180,7 +194,10 @@ public override void ToL8(Configuration configuration, ReadOnlySpan sour
}
///
- public override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToL16(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -198,7 +215,10 @@ public override void ToL16(Configuration configuration, ReadOnlySpan sou
}
///
- public override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToLa16(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -216,7 +236,10 @@ public override void ToLa16(Configuration configuration, ReadOnlySpan so
}
///
- public override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToLa32(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -234,7 +257,10 @@ public override void ToLa32(Configuration configuration, ReadOnlySpan so
}
///
- public override void ToRgb48(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToRgb48(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -252,7 +278,10 @@ public override void ToRgb48(Configuration configuration, ReadOnlySpan s
}
///
- public override void ToRgba64(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToRgba64(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -270,7 +299,10 @@ public override void ToRgba64(Configuration configuration, ReadOnlySpan
}
///
- public override void ToBgra5551(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToBgra5551(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -286,6 +318,7 @@ public override void ToBgra5551(Configuration configuration, ReadOnlySpan
public override void From(
Configuration configuration,
@@ -294,6 +327,7 @@ public override void From(
{
PixelOperations.Instance.ToArgb32(configuration, sourcePixels, destinationPixels);
}
+
}
}
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt
similarity index 78%
rename from src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.tt
rename to src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt
index 3a4c7b459d..bbee95f24c 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.tt
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt
@@ -1,6 +1,5 @@
-<#@include file="_Common.ttinclude" #>
+<#@include file="_Common.ttinclude" #>
<#@ output extension=".cs" #>
-
namespace SixLabors.ImageSharp.PixelFormats
{
///
@@ -11,7 +10,7 @@ namespace SixLabors.ImageSharp.PixelFormats
///
/// Provides optimized overrides for bulk operations.
///
- internal class PixelOperations : PixelOperations
+ internal partial class PixelOperations : PixelOperations
{
<# GenerateAllDefaultConversionMethods("Argb32"); #>
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs
similarity index 86%
rename from src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs
rename to src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs
index 50d4942ecb..a66a6e12c8 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs
@@ -1,15 +1,13 @@
-// Copyright (c) Six Labors.
+// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
//
-using SixLabors.ImageSharp.PixelFormats.Utils;
using System;
-using System.Buffers;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-
+using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats
{
@@ -21,8 +19,9 @@ public partial struct Bgr24
///
/// Provides optimized overrides for bulk operations.
///
- internal class PixelOperations : PixelOperations
+ internal partial class PixelOperations : PixelOperations
{
+
///
public override void FromBgr24(Configuration configuration, ReadOnlySpan source, Span destinationPixels)
{
@@ -42,16 +41,25 @@ public override void ToBgr24(Configuration configuration, ReadOnlySpan so
}
///
- public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destinationPixels, PixelConversionModifiers modifiers)
+ public override void FromVector4Destructive(
+ Configuration configuration,
+ Span sourceVectors,
+ Span destinationPixels,
+ PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destinationPixels, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}
///
- public override void ToVector4(Configuration configuration, ReadOnlySpan sourcePixels, Span destVectors, PixelConversionModifiers modifiers)
+ public override void ToVector4(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destVectors,
+ PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}
+
///
public override void ToRgba32(
Configuration configuration,
@@ -79,6 +87,7 @@ public override void FromRgba32(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromRgba32.ToBgr24(source, dest);
}
+
///
public override void ToArgb32(
Configuration configuration,
@@ -106,6 +115,7 @@ public override void FromArgb32(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromArgb32.ToBgr24(source, dest);
}
+
///
public override void ToBgra32(
Configuration configuration,
@@ -133,6 +143,7 @@ public override void FromBgra32(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromBgra32.ToBgr24(source, dest);
}
+
///
public override void ToRgb24(
Configuration configuration,
@@ -162,7 +173,10 @@ public override void FromRgb24(
}
///
- public override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToL8(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -180,7 +194,10 @@ public override void ToL8(Configuration configuration, ReadOnlySpan sourc
}
///
- public override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToL16(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -198,7 +215,10 @@ public override void ToL16(Configuration configuration, ReadOnlySpan sour
}
///
- public override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToLa16(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -216,7 +236,10 @@ public override void ToLa16(Configuration configuration, ReadOnlySpan sou
}
///
- public override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToLa32(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -234,7 +257,10 @@ public override void ToLa32(Configuration configuration, ReadOnlySpan sou
}
///
- public override void ToRgb48(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToRgb48(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -252,7 +278,10 @@ public override void ToRgb48(Configuration configuration, ReadOnlySpan so
}
///
- public override void ToRgba64(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToRgba64(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -270,7 +299,10 @@ public override void ToRgba64(Configuration configuration, ReadOnlySpan s
}
///
- public override void ToBgra5551(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
+ public override void ToBgra5551(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
@@ -286,6 +318,7 @@ public override void ToBgra5551(Configuration configuration, ReadOnlySpan
dp.FromBgr24(sp);
}
}
+
///
public override void From(
Configuration configuration,
@@ -294,6 +327,7 @@ public override void From(
{
PixelOperations.Instance.ToBgr24(configuration, sourcePixels, destinationPixels);
}
+
}
}
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt
similarity index 78%
rename from src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.tt
rename to src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt
index cfaefeda9c..48b6daa3aa 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.tt
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt
@@ -1,6 +1,5 @@
-<#@include file="_Common.ttinclude" #>
+<#@include file="_Common.ttinclude" #>
<#@ output extension=".cs" #>
-
namespace SixLabors.ImageSharp.PixelFormats
{
///
@@ -11,7 +10,7 @@ namespace SixLabors.ImageSharp.PixelFormats
///
/// Provides optimized overrides for bulk operations.
///
- internal class PixelOperations : PixelOperations
+ internal partial class PixelOperations : PixelOperations
{
<# GenerateAllDefaultConversionMethods("Bgr24"); #>
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs
similarity index 86%
rename from src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs
rename to src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs
index b38e5f19d6..77b665a4c7 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs
@@ -1,15 +1,13 @@
-// Copyright (c) Six Labors.
+// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
//
-using SixLabors.ImageSharp.PixelFormats.Utils;
using System;
-using System.Buffers;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-
+using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats
{
@@ -21,8 +19,9 @@ public partial struct Bgra32
///
/// Provides optimized overrides for bulk operations.
///
- internal class PixelOperations : PixelOperations
+ internal partial class PixelOperations : PixelOperations
{
+
///
public override void FromBgra32(Configuration configuration, ReadOnlySpan source, Span destinationPixels)
{
@@ -42,16 +41,25 @@ public override void ToBgra32(Configuration configuration, ReadOnlySpan
}
///
- public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destinationPixels, PixelConversionModifiers modifiers)
+ public override void FromVector4Destructive(
+ Configuration configuration,
+ Span sourceVectors,
+ Span destinationPixels,
+ PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destinationPixels, modifiers.Remove(PixelConversionModifiers.Scale));
}
///
- public override void ToVector4(Configuration configuration, ReadOnlySpan sourcePixels, Span destVectors, PixelConversionModifiers modifiers)
+ public override void ToVector4(
+ Configuration configuration,
+ ReadOnlySpan sourcePixels,
+ Span destVectors,
+ PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale));
}
+
///
public override void ToRgba32(
Configuration configuration,
@@ -79,6 +87,7 @@ public override void FromRgba32(
Span dest = MemoryMarshal.Cast(destinationPixels);
PixelConverter.FromRgba32.ToBgra32(source, dest);
}
+
///
public override void ToArgb32(
Configuration configuration,
@@ -106,6 +115,7 @@ public override void FromArgb32(
Span dest = MemoryMarshal.Cast