Browse Source

Restore constructor, fix casing

pull/2474/head
James Jackson-South 3 years ago
parent
commit
3f65ff61b3
  1. 34
      src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor.cs
  2. 2
      tests/ImageSharp.Tests/TestImages.cs

34
src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor.cs

@ -14,23 +14,41 @@ public class DrawImageProcessor : IImageProcessor
/// <summary>
/// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
/// </summary>
/// <param name="image">The image to blend.</param>
/// <param name="foreground">The image to blend.</param>
/// <param name="backgroundLocation">The location to draw the foreground image on the background.</param>
/// <param name="foregoundRectangle">The rectangular portion of the foreground image to draw.</param>
/// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
/// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
/// <param name="opacity">The opacity of the image to blend.</param>
public DrawImageProcessor(
Image image,
Image foreground,
Point backgroundLocation,
Rectangle foregoundRectangle,
PixelColorBlendingMode colorBlendingMode,
PixelAlphaCompositionMode alphaCompositionMode,
float opacity)
: this(foreground, backgroundLocation, foreground.Bounds, colorBlendingMode, alphaCompositionMode, opacity)
{
this.Image = image;
}
/// <summary>
/// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
/// </summary>
/// <param name="foreground">The image to blend.</param>
/// <param name="backgroundLocation">The location to draw the foreground image on the background.</param>
/// <param name="foregroundRectangle">The rectangular portion of the foreground image to draw.</param>
/// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
/// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
/// <param name="opacity">The opacity of the image to blend.</param>
public DrawImageProcessor(
Image foreground,
Point backgroundLocation,
Rectangle foregroundRectangle,
PixelColorBlendingMode colorBlendingMode,
PixelAlphaCompositionMode alphaCompositionMode,
float opacity)
{
this.ForeGround = foreground;
this.BackgroundLocation = backgroundLocation;
this.ForegroundRectangle = foregoundRectangle;
this.ForegroundRectangle = foregroundRectangle;
this.ColorBlendingMode = colorBlendingMode;
this.AlphaCompositionMode = alphaCompositionMode;
this.Opacity = opacity;
@ -39,7 +57,7 @@ public class DrawImageProcessor : IImageProcessor
/// <summary>
/// Gets the image to blend.
/// </summary>
public Image Image { get; }
public Image ForeGround { get; }
/// <summary>
/// Gets the location to draw the foreground image on the background.
@ -71,7 +89,7 @@ public class DrawImageProcessor : IImageProcessor
where TPixelBg : unmanaged, IPixel<TPixelBg>
{
ProcessorFactoryVisitor<TPixelBg> visitor = new(configuration, this, source);
this.Image.AcceptVisitor(visitor);
this.ForeGround.AcceptVisitor(visitor);
return visitor.Result!;
}

2
tests/ImageSharp.Tests/TestImages.cs

@ -133,7 +133,7 @@ public static class TestImages
public const string Issue2259 = "Png/issues/Issue_2259.png";
// Issue 2447: https://github.com/SixLabors/ImageSharp/issues/2447
public const string Issue2447 = "Png/issues/Issue_2447.png";
public const string Issue2447 = "Png/issues/issue_2447.png";
public static class Bad
{

Loading…
Cancel
Save