Browse Source

Prevent duplicate ctr in extensions

af/merge-core
James Jackson-South 7 years ago
parent
commit
3ed4f3cf73
  1. 2
      src/ImageSharp.Drawing/Processing/EllipticGradientBrush.cs
  2. 36
      src/ImageSharp.Drawing/Processing/Extensions/DrawImageExtensions.cs

2
src/ImageSharp.Drawing/Processing/EllipticGradientBrush.cs

@ -89,6 +89,7 @@ namespace SixLabors.ImageSharp.Processing
/// Initializes a new instance of the <see cref="RadialGradientBrushApplicator{TPixel}" /> class.
/// </summary>
/// <param name="configuration">The configuration instance to use when performing operations.</param>
/// <param name="options">The graphics options.</param>
/// <param name="target">The target image.</param>
/// <param name="center">Center of the ellipse.</param>
/// <param name="referenceAxisEnd">Point on one angular points of the ellipse.</param>
@ -97,7 +98,6 @@ namespace SixLabors.ImageSharp.Processing
/// the first is defined by <see cref="center"/> and <see cref="referenceAxisEnd"/>.</param>
/// <param name="colorStops">Definition of colors.</param>
/// <param name="repetitionMode">Defines how the gradient colors are repeated.</param>
/// <param name="options">The graphics options.</param>
public RadialGradientBrushApplicator(
Configuration configuration,
GraphicsOptions options,

36
src/ImageSharp.Drawing/Processing/Extensions/DrawImageExtensions.cs

@ -22,14 +22,17 @@ namespace SixLabors.ImageSharp.Processing
public static IImageProcessingContext DrawImage(
this IImageProcessingContext source,
Image image,
float opacity) =>
source.ApplyProcessor(
float opacity)
{
var options = new GraphicsOptions();
return source.ApplyProcessor(
new DrawImageProcessor(
image,
Point.Empty,
new GraphicsOptions().ColorBlendingMode,
new GraphicsOptions().AlphaCompositionMode,
opacity));
image,
Point.Empty,
options.ColorBlendingMode,
options.AlphaCompositionMode,
opacity));
}
/// <summary>
/// Draws the given image together with the current one by blending their pixels.
@ -100,14 +103,17 @@ namespace SixLabors.ImageSharp.Processing
this IImageProcessingContext source,
Image image,
Point location,
float opacity) =>
source.ApplyProcessor(
float opacity)
{
var options = new GraphicsOptions();
return source.ApplyProcessor(
new DrawImageProcessor(
image,
location,
new GraphicsOptions().ColorBlendingMode,
new GraphicsOptions().AlphaCompositionMode,
opacity));
image,
location,
options.ColorBlendingMode,
options.AlphaCompositionMode,
opacity));
}
/// <summary>
/// Draws the given image together with the current one by blending their pixels.
@ -172,4 +178,4 @@ namespace SixLabors.ImageSharp.Processing
options.AlphaCompositionMode,
options.BlendPercentage));
}
}
}

Loading…
Cancel
Save