Skip to content
Prev Previous commit
Next Next commit
Don't autogenerate GetPixelTypeInfo
  • Loading branch information
JimBobSquarePants committed Nov 11, 2020
commit e18ef9f7e30c419aada4e464308e0c64794f6b66
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct Argb32
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Argb32>
internal partial class PixelOperations : PixelOperations<Argb32>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Argb32>(PixelAlphaRepresentation.Unassociated);

/// <inheritdoc />
public override void FromArgb32(Configuration configuration, ReadOnlySpan<Argb32> source, Span<Argb32> destinationPixels)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Argb32>
internal partial class PixelOperations : PixelOperations<Argb32>
{
<# GeneratePixelTypeInfo("Argb32"); #>
<# GenerateAllDefaultConversionMethods("Argb32"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct Bgr24
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Bgr24>
internal partial class PixelOperations : PixelOperations<Bgr24>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgr24>(PixelAlphaRepresentation.None);

/// <inheritdoc />
public override void FromBgr24(Configuration configuration, ReadOnlySpan<Bgr24> source, Span<Bgr24> destinationPixels)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Bgr24>
internal partial class PixelOperations : PixelOperations<Bgr24>
{
<# GeneratePixelTypeInfo("Bgr24"); #>
<# GenerateAllDefaultConversionMethods("Bgr24"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct Bgra32
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Bgra32>
internal partial class PixelOperations : PixelOperations<Bgra32>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgra32>(PixelAlphaRepresentation.Unassociated);

/// <inheritdoc />
public override void FromBgra32(Configuration configuration, ReadOnlySpan<Bgra32> source, Span<Bgra32> destinationPixels)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Bgra32>
internal partial class PixelOperations : PixelOperations<Bgra32>
{
<# GeneratePixelTypeInfo("Bgra32"); #>
<# GenerateAllDefaultConversionMethods("Bgra32"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct Bgra5551
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Bgra5551>
internal partial class PixelOperations : PixelOperations<Bgra5551>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<Bgra5551>(PixelAlphaRepresentation.Unassociated);

/// <inheritdoc />
public override void FromBgra5551(Configuration configuration, ReadOnlySpan<Bgra5551> source, Span<Bgra5551> destinationPixels)
{
Expand All @@ -44,7 +40,6 @@ public override void ToBgra5551(Configuration configuration, ReadOnlySpan<Bgra55
sourcePixels.CopyTo(destinationPixels);
}


/// <inheritdoc />
public override void ToArgb32(
Configuration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<Bgra5551>
internal partial class PixelOperations : PixelOperations<Bgra5551>
{
<# GeneratePixelTypeInfo("Bgra5551"); #>
<# GenerateAllDefaultConversionMethods("Bgra5551"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct L16
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<L16>
internal partial class PixelOperations : PixelOperations<L16>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<L16>(PixelAlphaRepresentation.None);

/// <inheritdoc />
public override void FromL16(Configuration configuration, ReadOnlySpan<L16> source, Span<L16> destinationPixels)
{
Expand All @@ -44,7 +40,6 @@ public override void ToL16(Configuration configuration, ReadOnlySpan<L16> source
sourcePixels.CopyTo(destinationPixels);
}


/// <inheritdoc />
public override void ToArgb32(
Configuration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<L16>
internal partial class PixelOperations : PixelOperations<L16>
{
<# GeneratePixelTypeInfo("L16"); #>
<# GenerateAllDefaultConversionMethods("L16"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct L8
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<L8>
internal partial class PixelOperations : PixelOperations<L8>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<L8>(PixelAlphaRepresentation.None);

/// <inheritdoc />
public override void FromL8(Configuration configuration, ReadOnlySpan<L8> source, Span<L8> destinationPixels)
{
Expand All @@ -44,7 +40,6 @@ public override void ToL8(Configuration configuration, ReadOnlySpan<L8> sourcePi
sourcePixels.CopyTo(destinationPixels);
}


/// <inheritdoc />
public override void ToArgb32(
Configuration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<L8>
internal partial class PixelOperations : PixelOperations<L8>
{
<# GeneratePixelTypeInfo("L8"); #>
<# GenerateAllDefaultConversionMethods("L8"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct La16
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<La16>
internal partial class PixelOperations : PixelOperations<La16>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<La16>(PixelAlphaRepresentation.Unassociated);

/// <inheritdoc />
public override void FromLa16(Configuration configuration, ReadOnlySpan<La16> source, Span<La16> destinationPixels)
{
Expand All @@ -44,7 +40,6 @@ public override void ToLa16(Configuration configuration, ReadOnlySpan<La16> sour
sourcePixels.CopyTo(destinationPixels);
}


/// <inheritdoc />
public override void ToArgb32(
Configuration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<La16>
internal partial class PixelOperations : PixelOperations<La16>
{
<# GeneratePixelTypeInfo("La16"); #>
<# GenerateAllDefaultConversionMethods("La16"); #>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats.Utils;

namespace SixLabors.ImageSharp.PixelFormats
Expand All @@ -20,12 +19,9 @@ public partial struct La32
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<La32>
internal partial class PixelOperations : PixelOperations<La32>
{

/// <inheritdoc />
public override PixelTypeInfo GetPixelTypeInfo() => PixelTypeInfo.Create<La32>(PixelAlphaRepresentation.Unassociated);

/// <inheritdoc />
public override void FromLa32(Configuration configuration, ReadOnlySpan<La32> source, Span<La32> destinationPixels)
{
Expand All @@ -44,7 +40,6 @@ public override void ToLa32(Configuration configuration, ReadOnlySpan<La32> sour
sourcePixels.CopyTo(destinationPixels);
}


/// <inheritdoc />
public override void ToArgb32(
Configuration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <summary>
/// Provides optimized overrides for bulk operations.
/// </summary>
internal class PixelOperations : PixelOperations<La32>
internal partial class PixelOperations : PixelOperations<La32>
{
<# GeneratePixelTypeInfo("La32"); #>
<# GenerateAllDefaultConversionMethods("La32"); #>
}
}
Expand Down
Loading