Browse Source

Use WithW

pull/2359/head
James Jackson-South 3 years ago
parent
commit
78eb2f1764
  1. 20
      src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs

20
src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs

@ -278,9 +278,7 @@ internal static partial class PorterDuffFunctions
// unpremultiply
color /= Vector4.Max(alpha, new(Constants.Epsilon));
color.W = alpha.W;
return color;
return WithW(color, alpha);
}
/// <summary>
@ -339,9 +337,7 @@ internal static partial class PorterDuffFunctions
// unpremultiply
color /= Vector4.Max(alpha, new(Constants.Epsilon));
color.W = alpha.W;
return color;
return WithW(color, alpha);
}
/// <summary>
@ -385,9 +381,7 @@ internal static partial class PorterDuffFunctions
Vector4 color = source * alpha; // premultiply
color /= Vector4.Max(alpha, new(Constants.Epsilon)); // unpremultiply
color.W = alpha.W;
return color;
return WithW(color, alpha);
}
/// <summary>
@ -425,9 +419,7 @@ internal static partial class PorterDuffFunctions
Vector4 color = source * alpha; // premultiply
color /= Vector4.Max(alpha, new(Constants.Epsilon)); // unpremultiply
color.W = alpha.W;
return color;
return WithW(color, alpha);
}
/// <summary>
@ -470,9 +462,7 @@ internal static partial class PorterDuffFunctions
// unpremultiply
color /= Vector4.Max(alpha, new(Constants.Epsilon));
color.W = alpha.W;
return color;
return WithW(color, alpha);
}
/// <summary>

Loading…
Cancel
Save