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 000000000..f81932955 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Argb32.PixelOperations.cs @@ -0,0 +1,22 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +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 + { + /// + public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + } + } +} 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 000000000..cd77f5816 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr24.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +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 + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.None); + } + } +} 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 000000000..849f53835 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra32.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +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 + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + } + } +} 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 000000000..4714a8be2 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra5551.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +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 + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs index ce72eba81..9df708d44 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromArgb32(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt index 1854bcd41..bbee95f24 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Argb32"); #> <# GenerateAllDefaultConversionMethods("Argb32"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs index 7b15a2611..a66a6e12c 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.None); - /// public override void FromBgr24(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt index 01c9fde89..48b6daa3a 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Bgr24"); #> <# GenerateAllDefaultConversionMethods("Bgr24"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs index 8304ad2ca..77b665a4c 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromBgra32(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.tt index 606631431..7e1597989 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Bgra32"); #> <# GenerateAllDefaultConversionMethods("Bgra32"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs index 33b955619..1d13722e4 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromBgra5551(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.tt index 3c18f4744..c74dfb4bd 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Bgra5551"); #> <# GenerateAllDefaultConversionMethods("Bgra5551"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs index 88dc85f57..03b84be5d 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.None); - /// public override void FromL16(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.tt index 27b977059..9c0f725e6 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("L16"); #> <# GenerateAllDefaultConversionMethods("L16"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs index 2b16851d6..f52e77b1a 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.None); - /// public override void FromL8(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.tt index c054d0847..e6d4a45ef 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("L8"); #> <# GenerateAllDefaultConversionMethods("L8"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs index 7cc94ecae..e01399b8a 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromLa16(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.tt index 06d2ec1ab..7b88fd4f1 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("La16"); #> <# GenerateAllDefaultConversionMethods("La16"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs index ccee68190..0aa2afef5 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromLa32(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.tt index 34f54e77a..f85652cad 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("La32"); #> <# GenerateAllDefaultConversionMethods("La32"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs index 23b982400..a9303f9d8 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.None); - /// public override void FromRgb24(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.tt index e1d2878ca..056c2a279 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Rgb24"); #> <# GenerateAllDefaultConversionMethods("Rgb24"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs index ce067906c..30328366d 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.None); - /// public override void FromRgb48(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.tt index 6d05b4851..f46493e62 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Rgb48"); #> <# GenerateAllDefaultConversionMethods("Rgb48"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs index 90b05f786..c23198e76 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -23,9 +22,6 @@ namespace SixLabors.ImageSharp.PixelFormats internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromRgba32(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.tt index d40af0f4d..6a6cac4e3 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.tt @@ -12,7 +12,6 @@ namespace SixLabors.ImageSharp.PixelFormats /// internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Rgba32"); #> <# GenerateAllDefaultConversionMethods("Rgba32"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs index 2cd27e8e3..129e9ff0b 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs @@ -7,7 +7,6 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); - /// public override void FromRgba64(Configuration configuration, ReadOnlySpan source, Span destinationPixels) { @@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats sourcePixels.CopyTo(destinationPixels); } - /// public override void ToArgb32( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.tt index d0f4265f3..cf02d38ee 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.tt @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Provides optimized overrides for bulk operations. /// - internal class PixelOperations : PixelOperations + internal partial class PixelOperations : PixelOperations { - <# GeneratePixelTypeInfo("Rgba64"); #> <# GenerateAllDefaultConversionMethods("Rgba64"); #> } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude index 7a29e4659..7c2eccedc 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude @@ -12,31 +12,8 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; <#+ - private static readonly string[] UnassociatedAlphaPixelTypes = - { - "A8", - "Argb32", - "Bgra32", - "Bgra4444", - "Bgra5551", - "Byte4", - "HalfVector4", - "La16", - "La32", - "NormalizedByte4", - "NormalizedShort4", - "Rgba1010102", - "Rgba32", - "Rgba64", - "RgbaVector", - "Short4" - }; - - private static readonly string[] AssociatedAlphaPixelTypes = Array.Empty(); - private static readonly string[] CommonPixelTypes = { "Argb32", @@ -71,23 +48,6 @@ using SixLabors.ImageSharp.PixelFormats.Utils; "Bgr24" }; - void GeneratePixelTypeInfo(string pixelType) - { - string alpha = "PixelAlphaRepresentation.None"; - if (AssociatedAlphaPixelTypes.Contains(pixelType)) - { - alpha = "PixelAlphaRepresentation.Associated"; - } - else if (UnassociatedAlphaPixelTypes.Contains(pixelType)) - { - alpha = "PixelAlphaRepresentation.Unassociated"; - } -#> - /// - public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<<#=pixelType#>>(<#=alpha#>); -<#+ - } - void GenerateGenericConverterMethods(string pixelType) { #> @@ -123,7 +83,6 @@ using SixLabors.ImageSharp.PixelFormats.Utils; sourcePixels.CopyTo(destinationPixels); } - <#+ } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L16.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L16.PixelOperations.cs new file mode 100644 index 000000000..62d0e6164 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L16.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct L16 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.None); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L8.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L8.PixelOperations.cs new file mode 100644 index 000000000..5da55ffb4 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L8.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct L8 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.None); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La16.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La16.PixelOperations.cs new file mode 100644 index 000000000..feb4b65fd --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La16.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct La16 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La32.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La32.PixelOperations.cs new file mode 100644 index 000000000..f69e6c185 --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La32.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct La32 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs new file mode 100644 index 000000000..c4c6ac8ad --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct Rgb24 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.None); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb48.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb48.PixelOperations.cs new file mode 100644 index 000000000..bbe12315f --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb48.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct Rgb48 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.None); + } + } +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs index dcf304e9b..bc4454859 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; - +using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats.Utils; namespace SixLabors.ImageSharp.PixelFormats @@ -19,6 +19,10 @@ namespace SixLabors.ImageSharp.PixelFormats /// internal partial class PixelOperations : PixelOperations { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + /// public override void ToVector4( Configuration configuration, diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba64.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba64.PixelOperations.cs new file mode 100644 index 000000000..e953a378e --- /dev/null +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba64.PixelOperations.cs @@ -0,0 +1,23 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.Formats; + +namespace SixLabors.ImageSharp.PixelFormats +{ + /// + /// Provides optimized overrides for bulk operations. + /// + public partial struct Rgba64 + { + /// + /// Provides optimized overrides for bulk operations. + /// + internal partial class PixelOperations : PixelOperations + { + /// + public override PixelTypeInfo GetPixelTypeInfo() + => PixelTypeInfo.Create(PixelAlphaRepresentation.Unassociated); + } + } +}