|
|
@ -27,7 +27,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>Src(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>Src(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return source; |
|
|
return source; |
|
|
} |
|
|
} |
|
|
@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>SrcAtop(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>SrcAtop(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Atop(backdrop, source, <#=blender#>(backdrop, source)); |
|
|
return Atop(backdrop, source, <#=blender#>(backdrop, source)); |
|
|
} |
|
|
} |
|
|
@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>SrcOver(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>SrcOver(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Over(backdrop, source, <#=blender#>(backdrop, source)); |
|
|
return Over(backdrop, source, <#=blender#>(backdrop, source)); |
|
|
} |
|
|
} |
|
|
@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>SrcIn(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>SrcIn(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return In(backdrop, source, <#=blender#>(backdrop, source)); |
|
|
return In(backdrop, source, <#=blender#>(backdrop, source)); |
|
|
} |
|
|
} |
|
|
@ -59,7 +59,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>SrcOut(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>SrcOut(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Out(backdrop, source); |
|
|
return Out(backdrop, source); |
|
|
} |
|
|
} |
|
|
@ -73,7 +73,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>DestAtop(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>DestAtop(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Atop(source, backdrop, <#=blender#>(source, backdrop)); |
|
|
return Atop(source, backdrop, <#=blender#>(source, backdrop)); |
|
|
} |
|
|
} |
|
|
@ -81,7 +81,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>DestOver(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>DestOver(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Over(source, backdrop, <#=blender#>(source, backdrop)); |
|
|
return Over(source, backdrop, <#=blender#>(source, backdrop)); |
|
|
} |
|
|
} |
|
|
@ -89,7 +89,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>DestIn(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>DestIn(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return In(source, backdrop, <#=blender#>(source, backdrop)); |
|
|
return In(source, backdrop, <#=blender#>(source, backdrop)); |
|
|
} |
|
|
} |
|
|
@ -97,7 +97,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>DestOut(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>DestOut(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Out(source, backdrop); |
|
|
return Out(source, backdrop); |
|
|
} |
|
|
} |
|
|
@ -105,7 +105,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>Xor(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>Xor(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Xor(backdrop, source); |
|
|
return Xor(backdrop, source); |
|
|
} |
|
|
} |
|
|
@ -113,7 +113,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
public static Vector4 <#=blender#>Clear(Vector4 backdrop, Vector4 source, float opacity) |
|
|
public static Vector4 <#=blender#>Clear(Vector4 backdrop, Vector4 source, float opacity) |
|
|
{ |
|
|
{ |
|
|
source.W *= opacity.Clamp(0,1); |
|
|
source.W *= opacity; |
|
|
|
|
|
|
|
|
return Clear(backdrop, source); |
|
|
return Clear(backdrop, source); |
|
|
} |
|
|
} |
|
|
@ -126,8 +126,9 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders |
|
|
public static TPixel <#=blender#><#=composer#><TPixel>(TPixel backdrop, TPixel source, float opacity) |
|
|
public static TPixel <#=blender#><#=composer#><TPixel>(TPixel backdrop, TPixel source, float opacity) |
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
where TPixel : struct, IPixel<TPixel> |
|
|
{ |
|
|
{ |
|
|
|
|
|
opacity = opacity.Clamp(0, 1); |
|
|
TPixel dest = default; |
|
|
TPixel dest = default; |
|
|
dest.PackFromVector4(<#=blender#><#=composer#>(backdrop.ToVector4(),source.ToVector4(),opacity)); |
|
|
dest.PackFromScaledVector4(<#=blender#><#=composer#>(backdrop.ToScaledVector4(), source.ToScaledVector4(), opacity)); |
|
|
return dest; |
|
|
return dest; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|