diff --git a/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs b/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs
index 1d3ccf6ee..1ab349a73 100644
--- a/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs
+++ b/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs
@@ -1,10 +1,10 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
+using SixLabors.ImageSharp.Memory;
using System;
using System.Buffers;
using System.Numerics;
-using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.PixelFormats
{
@@ -27,25 +27,6 @@ namespace SixLabors.ImageSharp.PixelFormats
/// The final pixel value after composition.
public abstract TPixel Blend(TPixel background, TPixel source, float amount);
- ///
- /// Blends 2 rows together
- ///
- /// to use internally
- /// the destination span
- /// the background span
- /// the source span
- ///
- /// A span with values between 0 and 1 indicating the weight of the second source vector.
- /// At amount = 0, "background" is returned, at amount = 1, "source" is returned.
- ///
- public void Blend(
- Configuration configuration,
- Span destination,
- ReadOnlySpan background,
- ReadOnlySpan source,
- ReadOnlySpan amount)
- => this.Blend(configuration, destination, background, source, amount);
-
///
/// Blends 2 rows together
///
@@ -55,7 +36,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// the background span
/// the source span
///
- /// A span with values between 0 and 1 indicating the weight of the second source vector.
+ /// A value between 0 and 1 indicating the weight of the second source vector.
/// At amount = 0, "background" is returned, at amount = 1, "source" is returned.
///
public void Blend(
@@ -63,12 +44,12 @@ namespace SixLabors.ImageSharp.PixelFormats
Span destination,
ReadOnlySpan background,
ReadOnlySpan source,
- ReadOnlySpan amount)
+ float amount)
where TPixelSrc : struct, IPixel
{
Guard.MustBeGreaterThanOrEqualTo(background.Length, destination.Length, nameof(background.Length));
Guard.MustBeGreaterThanOrEqualTo(source.Length, destination.Length, nameof(source.Length));
- Guard.MustBeGreaterThanOrEqualTo(amount.Length, destination.Length, nameof(amount.Length));
+ Guard.MustBeBetweenOrEqualTo(amount, 0, 1, nameof(amount));
using (IMemoryOwner buffer =
configuration.MemoryAllocator.Allocate(destination.Length * 3))
@@ -89,6 +70,25 @@ namespace SixLabors.ImageSharp.PixelFormats
}
}
+ ///
+ /// Blends 2 rows together
+ ///
+ /// to use internally
+ /// the destination span
+ /// the background span
+ /// the source span
+ ///
+ /// A span with values between 0 and 1 indicating the weight of the second source vector.
+ /// At amount = 0, "background" is returned, at amount = 1, "source" is returned.
+ ///
+ public void Blend(
+ Configuration configuration,
+ Span destination,
+ ReadOnlySpan background,
+ ReadOnlySpan source,
+ ReadOnlySpan amount)
+ => this.Blend(configuration, destination, background, source, amount);
+
///
/// Blends 2 rows together
///
@@ -98,7 +98,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// the background span
/// the source span
///
- /// A value between 0 and 1 indicating the weight of the second source vector.
+ /// A span with values between 0 and 1 indicating the weight of the second source vector.
/// At amount = 0, "background" is returned, at amount = 1, "source" is returned.
///
public void Blend(
@@ -106,12 +106,12 @@ namespace SixLabors.ImageSharp.PixelFormats
Span destination,
ReadOnlySpan background,
ReadOnlySpan source,
- float amount)
+ ReadOnlySpan amount)
where TPixelSrc : struct, IPixel
{
Guard.MustBeGreaterThanOrEqualTo(background.Length, destination.Length, nameof(background.Length));
Guard.MustBeGreaterThanOrEqualTo(source.Length, destination.Length, nameof(source.Length));
- Guard.MustBeBetweenOrEqualTo(amount, 0, 1, nameof(amount));
+ Guard.MustBeGreaterThanOrEqualTo(amount.Length, destination.Length, nameof(amount.Length));
using (IMemoryOwner buffer =
configuration.MemoryAllocator.Allocate(destination.Length * 3))