Browse Source

Update the PorterDuffFunctions.Generated.tt to include the Vector256<float> variants.

pull/2359/head
James Jackson-South 3 years ago
parent
commit
4c546d7de8
  1. 1406
      src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs
  2. 152
      src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt

1406
src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs

File diff suppressed because it is too large

152
src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt

@ -15,6 +15,8 @@
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders; namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders;
@ -36,6 +38,17 @@ internal static partial class PorterDuffFunctions
return source; return source;
} }
/// <summary>
/// Returns the result of the "<#=blender#>Src compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>Src(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl);
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>SrcAtop" compositing equation. /// Returns the result of the "<#=blender#>SrcAtop" compositing equation.
/// </summary> /// </summary>
@ -51,6 +64,21 @@ internal static partial class PorterDuffFunctions
return Atop(backdrop, source, <#=blender#>(backdrop, source)); return Atop(backdrop, source, <#=blender#>(backdrop, source));
} }
/// <summary>
/// Returns the result of the "<#=blender#>SrcAtop" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>SrcAtop(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
{
source = Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl);
return Atop(backdrop, source, <#=blender#>(backdrop, source));
}
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>SrcOver" compositing equation. /// Returns the result of the "<#=blender#>SrcOver" compositing equation.
/// </summary> /// </summary>
@ -66,6 +94,21 @@ internal static partial class PorterDuffFunctions
return Over(backdrop, source, <#=blender#>(backdrop, source)); return Over(backdrop, source, <#=blender#>(backdrop, source));
} }
/// <summary>
/// Returns the result of the "<#=blender#>SrcOver" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>SrcOver(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
{
source = Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl);
return Over(backdrop, source, <#=blender#>(backdrop, source));
}
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>SrcIn" compositing equation. /// Returns the result of the "<#=blender#>SrcIn" compositing equation.
/// </summary> /// </summary>
@ -81,6 +124,17 @@ internal static partial class PorterDuffFunctions
return In(backdrop, source); return In(backdrop, source);
} }
/// <summary>
/// Returns the result of the "<#=blender#>SrcIn" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>SrcIn(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> In(backdrop, Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl));
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>SrcOut" compositing equation. /// Returns the result of the "<#=blender#>SrcOut" compositing equation.
/// </summary> /// </summary>
@ -96,6 +150,17 @@ internal static partial class PorterDuffFunctions
return Out(backdrop, source); return Out(backdrop, source);
} }
/// <summary>
/// Returns the result of the "<#=blender#>SrcOut" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>SrcOut(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> Out(backdrop, Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl));
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>Dest" compositing equation. /// Returns the result of the "<#=blender#>Dest" compositing equation.
/// </summary> /// </summary>
@ -109,6 +174,19 @@ internal static partial class PorterDuffFunctions
return backdrop; return backdrop;
} }
/// <summary>
/// Returns the result of the "<#=blender#>Dest" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>Dest(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
{
return backdrop;
}
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>DestAtop" compositing equation. /// Returns the result of the "<#=blender#>DestAtop" compositing equation.
/// </summary> /// </summary>
@ -124,6 +202,21 @@ internal static partial class PorterDuffFunctions
return Atop(source, backdrop, <#=blender#>(source, backdrop)); return Atop(source, backdrop, <#=blender#>(source, backdrop));
} }
/// <summary>
/// Returns the result of the "<#=blender#>DestAtop" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>DestAtop(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
{
source = Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl);
return Atop(source, backdrop, <#=blender#>(source, backdrop));
}
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>DestOver" compositing equation. /// Returns the result of the "<#=blender#>DestOver" compositing equation.
/// </summary> /// </summary>
@ -139,6 +232,21 @@ internal static partial class PorterDuffFunctions
return Over(source, backdrop, <#=blender#>(source, backdrop)); return Over(source, backdrop, <#=blender#>(source, backdrop));
} }
/// <summary>
/// Returns the result of the "<#=blender#>DestOver" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>DestOver(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
{
source = Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl);
return Over(source, backdrop, <#=blender#>(source, backdrop));
}
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>DestIn" compositing equation. /// Returns the result of the "<#=blender#>DestIn" compositing equation.
/// </summary> /// </summary>
@ -154,6 +262,17 @@ internal static partial class PorterDuffFunctions
return In(source, backdrop); return In(source, backdrop);
} }
/// <summary>
/// Returns the result of the "<#=blender#>DestIn" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>DestIn(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> In(Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl), backdrop);
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>DestOut" compositing equation. /// Returns the result of the "<#=blender#>DestOut" compositing equation.
/// </summary> /// </summary>
@ -169,6 +288,17 @@ internal static partial class PorterDuffFunctions
return Out(source, backdrop); return Out(source, backdrop);
} }
/// <summary>
/// Returns the result of the "<#=blender#>DestOut" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>DestOut(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> Out(Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl), backdrop);
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>Xor" compositing equation. /// Returns the result of the "<#=blender#>Xor" compositing equation.
/// </summary> /// </summary>
@ -184,6 +314,17 @@ internal static partial class PorterDuffFunctions
return Xor(backdrop, source); return Xor(backdrop, source);
} }
/// <summary>
/// Returns the result of the "<#=blender#>Xor" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>Xor(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> Xor(backdrop, Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl));
/// <summary> /// <summary>
/// Returns the result of the "<#=blender#>Clear" compositing equation. /// Returns the result of the "<#=blender#>Clear" compositing equation.
/// </summary> /// </summary>
@ -199,6 +340,17 @@ internal static partial class PorterDuffFunctions
return Clear(backdrop, source); return Clear(backdrop, source);
} }
/// <summary>
/// Returns the result of the "<#=blender#>Clear" compositing equation.
/// </summary>
/// <param name="backdrop">The backdrop vector.</param>
/// <param name="source">The source vector.</param>
/// <param name="opacity">The source opacity. Range 0..1</param>
/// <returns>The <see cref="Vector256{Single}"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector256<float> <#=blender#>Xor(Vector256<float> backdrop, Vector256<float> source, Vector256<float> opacity)
=> Clear(backdrop, Avx.Blend(source, Avx.Multiply(source, opacity), BlendAlphaControl));
<#} #> <#} #>
<# void GenerateGenericPixelBlender(string blender, string composer) { #> <# void GenerateGenericPixelBlender(string blender, string composer) { #>

Loading…
Cancel
Save