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

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

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

Loading…
Cancel
Save