Browse Source

Don't autogenerate GetPixelTypeInfo

js/color-alpha-handling
James Jackson-South 6 years ago
parent
commit
86d4b7214e
  1. 22
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Argb32.PixelOperations.cs
  2. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgr24.PixelOperations.cs
  3. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra32.PixelOperations.cs
  4. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Bgra5551.PixelOperations.cs
  5. 6
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs
  6. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt
  7. 6
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs
  8. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt
  9. 6
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs
  10. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.tt
  11. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs
  12. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.tt
  13. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs
  14. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.tt
  15. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs
  16. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.tt
  17. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs
  18. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.tt
  19. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs
  20. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.tt
  21. 6
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs
  22. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.tt
  23. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs
  24. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.tt
  25. 5
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs
  26. 1
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.tt
  27. 7
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs
  28. 3
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.tt
  29. 41
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude
  30. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L16.PixelOperations.cs
  31. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/L8.PixelOperations.cs
  32. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La16.PixelOperations.cs
  33. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/La32.PixelOperations.cs
  34. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs
  35. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb48.PixelOperations.cs
  36. 6
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs
  37. 23
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba64.PixelOperations.cs

22
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Argb32
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Argb32>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Argb32>(PixelAlphaRepresentation.Unassociated);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Bgr24
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Bgr24>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Bgr24>(PixelAlphaRepresentation.None);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Bgra32
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Bgra32>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Bgra32>(PixelAlphaRepresentation.Unassociated);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Bgra5551
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Bgra5551>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Bgra5551>(PixelAlphaRepresentation.Unassociated);
}
}
}

6
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Argb32> internal partial class PixelOperations : PixelOperations<Argb32>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Argb32>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromArgb32(Configuration configuration, ReadOnlySpan<Argb32> source, Span<Argb32> destinationPixels) public override void FromArgb32(Configuration configuration, ReadOnlySpan<Argb32> source, Span<Argb32> destinationPixels)
{ {

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Argb32.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Argb32> internal partial class PixelOperations : PixelOperations<Argb32>
{ {
<# GeneratePixelTypeInfo("Argb32"); #>
<# GenerateAllDefaultConversionMethods("Argb32"); #> <# GenerateAllDefaultConversionMethods("Argb32"); #>
} }
} }

6
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Bgr24> internal partial class PixelOperations : PixelOperations<Bgr24>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgr24>(PixelAlphaRepresentation.None);
/// <inheritdoc /> /// <inheritdoc />
public override void FromBgr24(Configuration configuration, ReadOnlySpan<Bgr24> source, Span<Bgr24> destinationPixels) public override void FromBgr24(Configuration configuration, ReadOnlySpan<Bgr24> source, Span<Bgr24> destinationPixels)
{ {

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgr24.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Bgr24> internal partial class PixelOperations : PixelOperations<Bgr24>
{ {
<# GeneratePixelTypeInfo("Bgr24"); #>
<# GenerateAllDefaultConversionMethods("Bgr24"); #> <# GenerateAllDefaultConversionMethods("Bgr24"); #>
} }
} }

6
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Bgra32> internal partial class PixelOperations : PixelOperations<Bgra32>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgra32>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromBgra32(Configuration configuration, ReadOnlySpan<Bgra32> source, Span<Bgra32> destinationPixels) public override void FromBgra32(Configuration configuration, ReadOnlySpan<Bgra32> source, Span<Bgra32> destinationPixels)
{ {

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra32.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Bgra32> internal partial class PixelOperations : PixelOperations<Bgra32>
{ {
<# GeneratePixelTypeInfo("Bgra32"); #>
<# GenerateAllDefaultConversionMethods("Bgra32"); #> <# GenerateAllDefaultConversionMethods("Bgra32"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Bgra5551> internal partial class PixelOperations : PixelOperations<Bgra5551>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgra5551>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromBgra5551(Configuration configuration, ReadOnlySpan<Bgra5551> source, Span<Bgra5551> destinationPixels) public override void FromBgra5551(Configuration configuration, ReadOnlySpan<Bgra5551> source, Span<Bgra5551> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Bgra5551.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Bgra5551> internal partial class PixelOperations : PixelOperations<Bgra5551>
{ {
<# GeneratePixelTypeInfo("Bgra5551"); #>
<# GenerateAllDefaultConversionMethods("Bgra5551"); #> <# GenerateAllDefaultConversionMethods("Bgra5551"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<L16> internal partial class PixelOperations : PixelOperations<L16>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<L16>(PixelAlphaRepresentation.None);
/// <inheritdoc /> /// <inheritdoc />
public override void FromL16(Configuration configuration, ReadOnlySpan<L16> source, Span<L16> destinationPixels) public override void FromL16(Configuration configuration, ReadOnlySpan<L16> source, Span<L16> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L16.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<L16> internal partial class PixelOperations : PixelOperations<L16>
{ {
<# GeneratePixelTypeInfo("L16"); #>
<# GenerateAllDefaultConversionMethods("L16"); #> <# GenerateAllDefaultConversionMethods("L16"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<L8> internal partial class PixelOperations : PixelOperations<L8>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<L8>(PixelAlphaRepresentation.None);
/// <inheritdoc /> /// <inheritdoc />
public override void FromL8(Configuration configuration, ReadOnlySpan<L8> source, Span<L8> destinationPixels) public override void FromL8(Configuration configuration, ReadOnlySpan<L8> source, Span<L8> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/L8.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<L8> internal partial class PixelOperations : PixelOperations<L8>
{ {
<# GeneratePixelTypeInfo("L8"); #>
<# GenerateAllDefaultConversionMethods("L8"); #> <# GenerateAllDefaultConversionMethods("L8"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<La16> internal partial class PixelOperations : PixelOperations<La16>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<La16>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromLa16(Configuration configuration, ReadOnlySpan<La16> source, Span<La16> destinationPixels) public override void FromLa16(Configuration configuration, ReadOnlySpan<La16> source, Span<La16> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La16.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<La16> internal partial class PixelOperations : PixelOperations<La16>
{ {
<# GeneratePixelTypeInfo("La16"); #>
<# GenerateAllDefaultConversionMethods("La16"); #> <# GenerateAllDefaultConversionMethods("La16"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<La32> internal partial class PixelOperations : PixelOperations<La32>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<La32>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromLa32(Configuration configuration, ReadOnlySpan<La32> source, Span<La32> destinationPixels) public override void FromLa32(Configuration configuration, ReadOnlySpan<La32> source, Span<La32> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/La32.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<La32> internal partial class PixelOperations : PixelOperations<La32>
{ {
<# GeneratePixelTypeInfo("La32"); #>
<# GenerateAllDefaultConversionMethods("La32"); #> <# GenerateAllDefaultConversionMethods("La32"); #>
} }
} }

6
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Rgb24> internal partial class PixelOperations : PixelOperations<Rgb24>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Rgb24>(PixelAlphaRepresentation.None);
/// <inheritdoc /> /// <inheritdoc />
public override void FromRgb24(Configuration configuration, ReadOnlySpan<Rgb24> source, Span<Rgb24> destinationPixels) public override void FromRgb24(Configuration configuration, ReadOnlySpan<Rgb24> source, Span<Rgb24> destinationPixels)
{ {

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb24.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Rgb24> internal partial class PixelOperations : PixelOperations<Rgb24>
{ {
<# GeneratePixelTypeInfo("Rgb24"); #>
<# GenerateAllDefaultConversionMethods("Rgb24"); #> <# GenerateAllDefaultConversionMethods("Rgb24"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Rgb48> internal partial class PixelOperations : PixelOperations<Rgb48>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Rgb48>(PixelAlphaRepresentation.None);
/// <inheritdoc /> /// <inheritdoc />
public override void FromRgb48(Configuration configuration, ReadOnlySpan<Rgb48> source, Span<Rgb48> destinationPixels) public override void FromRgb48(Configuration configuration, ReadOnlySpan<Rgb48> source, Span<Rgb48> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgb48.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Rgb48> internal partial class PixelOperations : PixelOperations<Rgb48>
{ {
<# GeneratePixelTypeInfo("Rgb48"); #>
<# GenerateAllDefaultConversionMethods("Rgb48"); #> <# GenerateAllDefaultConversionMethods("Rgb48"); #>
} }
} }

5
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -23,9 +22,6 @@ namespace SixLabors.ImageSharp.PixelFormats
internal partial class PixelOperations : PixelOperations<Rgba32> internal partial class PixelOperations : PixelOperations<Rgba32>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Rgba32>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromRgba32(Configuration configuration, ReadOnlySpan<Rgba32> source, Span<Rgba32> destinationPixels) public override void FromRgba32(Configuration configuration, ReadOnlySpan<Rgba32> source, Span<Rgba32> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

1
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba32.PixelOperations.Generated.tt

@ -12,7 +12,6 @@ namespace SixLabors.ImageSharp.PixelFormats
/// </summary> /// </summary>
internal partial class PixelOperations : PixelOperations<Rgba32> internal partial class PixelOperations : PixelOperations<Rgba32>
{ {
<# GeneratePixelTypeInfo("Rgba32"); #>
<# GenerateAllDefaultConversionMethods("Rgba32"); #> <# GenerateAllDefaultConversionMethods("Rgba32"); #>
} }
} }

7
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.cs

@ -7,7 +7,6 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -20,12 +19,9 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Rgba64> internal partial class PixelOperations : PixelOperations<Rgba64>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Rgba64>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void FromRgba64(Configuration configuration, ReadOnlySpan<Rgba64> source, Span<Rgba64> destinationPixels) public override void FromRgba64(Configuration configuration, ReadOnlySpan<Rgba64> source, Span<Rgba64> destinationPixels)
{ {
@ -44,7 +40,6 @@ namespace SixLabors.ImageSharp.PixelFormats
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
/// <inheritdoc /> /// <inheritdoc />
public override void ToArgb32( public override void ToArgb32(
Configuration configuration, Configuration configuration,

3
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/Rgba64.PixelOperations.Generated.tt

@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary> /// <summary>
/// Provides optimized overrides for bulk operations. /// Provides optimized overrides for bulk operations.
/// </summary> /// </summary>
internal class PixelOperations : PixelOperations<Rgba64> internal partial class PixelOperations : PixelOperations<Rgba64>
{ {
<# GeneratePixelTypeInfo("Rgba64"); #>
<# GenerateAllDefaultConversionMethods("Rgba64"); #> <# GenerateAllDefaultConversionMethods("Rgba64"); #>
} }
} }

41
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Generated/_Common.ttinclude

@ -12,31 +12,8 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; 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<string>();
private static readonly string[] CommonPixelTypes = private static readonly string[] CommonPixelTypes =
{ {
"Argb32", "Argb32",
@ -71,23 +48,6 @@ using SixLabors.ImageSharp.PixelFormats.Utils;
"Bgr24" "Bgr24"
}; };
void GeneratePixelTypeInfo(string pixelType)
{
string alpha = "PixelAlphaRepresentation.None";
if (AssociatedAlphaPixelTypes.Contains(pixelType))
{
alpha = "PixelAlphaRepresentation.Associated";
}
else if (UnassociatedAlphaPixelTypes.Contains(pixelType))
{
alpha = "PixelAlphaRepresentation.Unassociated";
}
#>
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<<#=pixelType#>>(<#=alpha#>);
<#+
}
void GenerateGenericConverterMethods(string pixelType) void GenerateGenericConverterMethods(string pixelType)
{ {
#> #>
@ -123,7 +83,6 @@ using SixLabors.ImageSharp.PixelFormats.Utils;
sourcePixels.CopyTo(destinationPixels); sourcePixels.CopyTo(destinationPixels);
} }
<#+ <#+
} }

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct L16
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<L16>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<L16>(PixelAlphaRepresentation.None);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct L8
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<L8>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<L8>(PixelAlphaRepresentation.None);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct La16
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<La16>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<La16>(PixelAlphaRepresentation.Unassociated);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct La32
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<La32>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<La32>(PixelAlphaRepresentation.Unassociated);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Rgb24
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Rgb24>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Rgb24>(PixelAlphaRepresentation.None);
}
}
}

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Rgb48
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Rgb48>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Rgb48>(PixelAlphaRepresentation.None);
}
}
}

6
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils; using SixLabors.ImageSharp.PixelFormats.Utils;
namespace SixLabors.ImageSharp.PixelFormats namespace SixLabors.ImageSharp.PixelFormats
@ -19,6 +19,10 @@ namespace SixLabors.ImageSharp.PixelFormats
/// </summary> /// </summary>
internal partial class PixelOperations : PixelOperations<Rgba32> internal partial class PixelOperations : PixelOperations<Rgba32>
{ {
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Rgba32>(PixelAlphaRepresentation.Unassociated);
/// <inheritdoc /> /// <inheritdoc />
public override void ToVector4( public override void ToVector4(
Configuration configuration, Configuration configuration,

23
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
{
/// <content>
/// Provides optimized overrides for bulk operations.
/// </content>
public partial struct Rgba64
{
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal partial class PixelOperations : PixelOperations<Rgba64>
{
/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo()
=> PixelTypeInfo.Create<Rgba64>(PixelAlphaRepresentation.Unassociated);
}
}
}
Loading…
Cancel
Save