diff --git a/Directory.Build.targets b/Directory.Build.targets
index 1551a29d8..1dc081782 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -25,7 +25,7 @@
-
+
diff --git a/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor{TPixelBg,TPixelFg}.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor{TPixelBg,TPixelFg}.cs
index 76082136c..eab6b2f4a 100644
--- a/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor{TPixelBg,TPixelFg}.cs
+++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor{TPixelBg,TPixelFg}.cs
@@ -4,7 +4,7 @@
using System;
using SixLabors.ImageSharp.Advanced;
-using SixLabors.ImageSharp.ParallelUtils;
+using SixLabors.ImageSharp.Advanced.ParallelUtils;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
diff --git a/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor{TPixel}.cs
index a7c22f6d7..4e052818d 100644
--- a/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor{TPixel}.cs
@@ -5,8 +5,8 @@ using System;
using System.Buffers;
using SixLabors.ImageSharp.Advanced;
+using SixLabors.ImageSharp.Advanced.ParallelUtils;
using SixLabors.ImageSharp.Memory;
-using SixLabors.ImageSharp.ParallelUtils;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
@@ -45,7 +45,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Drawing
int width = maxX - minX;
- var workingRect = Rectangle.FromLTRB(minX, minY, maxX, maxY);
+ Rectangle workingRect = Rectangle.FromLTRB(minX, minY, maxX, maxY);
IBrush brush = this.definition.Brush;
GraphicsOptions options = this.definition.Options;
@@ -53,9 +53,10 @@ namespace SixLabors.ImageSharp.Processing.Processors.Drawing
// If there's no reason for blending, then avoid it.
if (this.IsSolidBrushWithoutBlending(out SolidBrush solidBrush))
{
- ParallelExecutionSettings parallelSettings = configuration.GetParallelSettings().MultiplyMinimumPixelsPerTask(4);
+ ParallelExecutionSettings parallelSettings = ParallelExecutionSettings.FromConfiguration(configuration)
+ .MultiplyMinimumPixelsPerTask(4);
- TPixel colorPixel = solidBrush.Color.ToPixel();
+ var colorPixel = solidBrush.Color.ToPixel();
ParallelHelper.IterateRows(
workingRect,
diff --git a/src/ImageSharp/Common/ParallelUtils/ParallelExecutionSettings.cs b/src/ImageSharp/Advanced/ParallelUtils/ParallelExecutionSettings.cs
similarity index 55%
rename from src/ImageSharp/Common/ParallelUtils/ParallelExecutionSettings.cs
rename to src/ImageSharp/Advanced/ParallelUtils/ParallelExecutionSettings.cs
index 40163bc78..431656ef9 100644
--- a/src/ImageSharp/Common/ParallelUtils/ParallelExecutionSettings.cs
+++ b/src/ImageSharp/Advanced/ParallelUtils/ParallelExecutionSettings.cs
@@ -1,16 +1,17 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
+using System;
using System.Threading.Tasks;
using SixLabors.Memory;
-namespace SixLabors.ImageSharp.ParallelUtils
+namespace SixLabors.ImageSharp.Advanced.ParallelUtils
{
///
/// Defines execution settings for methods in .
///
- internal readonly struct ParallelExecutionSettings
+ public readonly struct ParallelExecutionSettings
{
///
/// Default value for .
@@ -20,11 +21,24 @@ namespace SixLabors.ImageSharp.ParallelUtils
///
/// Initializes a new instance of the struct.
///
+ /// The value used for initializing when using TPL.
+ /// The value for .
+ /// The .
public ParallelExecutionSettings(
int maxDegreeOfParallelism,
int minimumPixelsProcessedPerTask,
MemoryAllocator memoryAllocator)
{
+ // Shall be compatible with ParallelOptions.MaxDegreeOfParallelism:
+ // https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.paralleloptions.maxdegreeofparallelism
+ if (maxDegreeOfParallelism == 0 || maxDegreeOfParallelism < -1)
+ {
+ throw new ArgumentOutOfRangeException(nameof(maxDegreeOfParallelism));
+ }
+
+ Guard.MustBeGreaterThan(minimumPixelsProcessedPerTask, 0, nameof(minimumPixelsProcessedPerTask));
+ Guard.NotNull(memoryAllocator, nameof(memoryAllocator));
+
this.MaxDegreeOfParallelism = maxDegreeOfParallelism;
this.MinimumPixelsProcessedPerTask = minimumPixelsProcessedPerTask;
this.MemoryAllocator = memoryAllocator;
@@ -33,13 +47,15 @@ namespace SixLabors.ImageSharp.ParallelUtils
///
/// Initializes a new instance of the struct.
///
+ /// The value used for initializing when using TPL.
+ /// The .
public ParallelExecutionSettings(int maxDegreeOfParallelism, MemoryAllocator memoryAllocator)
: this(maxDegreeOfParallelism, DefaultMinimumPixelsProcessedPerTask, memoryAllocator)
{
}
///
- /// Gets the MemoryAllocator
+ /// Gets the .
///
public MemoryAllocator MemoryAllocator { get; }
@@ -60,12 +76,26 @@ namespace SixLabors.ImageSharp.ParallelUtils
/// Creates a new instance of
/// having multiplied by
///
+ /// The value to multiply with.
+ /// The modified .
public ParallelExecutionSettings MultiplyMinimumPixelsPerTask(int multiplier)
{
+ Guard.MustBeGreaterThan(multiplier, 0, nameof(multiplier));
+
return new ParallelExecutionSettings(
this.MaxDegreeOfParallelism,
this.MinimumPixelsProcessedPerTask * multiplier,
this.MemoryAllocator);
}
+
+ ///
+ /// Get the default for a
+ ///
+ /// The .
+ /// The .
+ public static ParallelExecutionSettings FromConfiguration(Configuration configuration)
+ {
+ return new ParallelExecutionSettings(configuration.MaxDegreeOfParallelism, configuration.MemoryAllocator);
+ }
}
-}
\ No newline at end of file
+}
diff --git a/src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs b/src/ImageSharp/Advanced/ParallelUtils/ParallelHelper.cs
similarity index 77%
rename from src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs
rename to src/ImageSharp/Advanced/ParallelUtils/ParallelHelper.cs
index 1e7299720..c56337bff 100644
--- a/src/ImageSharp/Common/ParallelUtils/ParallelHelper.cs
+++ b/src/ImageSharp/Advanced/ParallelUtils/ParallelHelper.cs
@@ -10,29 +10,25 @@ using SixLabors.ImageSharp.Memory;
using SixLabors.Memory;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.ParallelUtils
+namespace SixLabors.ImageSharp.Advanced.ParallelUtils
{
///
/// Utility methods for batched processing of pixel row intervals.
- /// Parallel execution is optimized for image processing.
- /// Use this instead of direct calls!
+ /// Parallel execution is optimized for image processing based on values defined
+ /// or .
+ /// Using this class is preferred over direct usage of utility methods.
///
- internal static class ParallelHelper
+ public static class ParallelHelper
{
- ///
- /// Get the default for a
- ///
- public static ParallelExecutionSettings GetParallelSettings(this Configuration configuration)
- {
- return new ParallelExecutionSettings(configuration.MaxDegreeOfParallelism, configuration.MemoryAllocator);
- }
-
///
/// Iterate through the rows of a rectangle in optimized batches defined by -s.
///
+ /// The .
+ /// The to get the parallel settings from.
+ /// The method body defining the iteration logic on a single .
public static void IterateRows(Rectangle rectangle, Configuration configuration, Action body)
{
- ParallelExecutionSettings parallelSettings = configuration.GetParallelSettings();
+ ParallelExecutionSettings parallelSettings = ParallelExecutionSettings.FromConfiguration(configuration);
IterateRows(rectangle, parallelSettings, body);
}
@@ -40,6 +36,9 @@ namespace SixLabors.ImageSharp.ParallelUtils
///
/// Iterate through the rows of a rectangle in optimized batches defined by -s.
///
+ /// The .
+ /// The .
+ /// The method body defining the iteration logic on a single .
public static void IterateRows(
Rectangle rectangle,
in ParallelExecutionSettings parallelSettings,
@@ -47,7 +46,9 @@ namespace SixLabors.ImageSharp.ParallelUtils
{
ValidateRectangle(rectangle);
- int maxSteps = DivideCeil(rectangle.Width * rectangle.Height, parallelSettings.MinimumPixelsProcessedPerTask);
+ int maxSteps = DivideCeil(
+ rectangle.Width * rectangle.Height,
+ parallelSettings.MinimumPixelsProcessedPerTask);
int numOfSteps = Math.Min(parallelSettings.MaxDegreeOfParallelism, maxSteps);
@@ -81,7 +82,7 @@ namespace SixLabors.ImageSharp.ParallelUtils
/// Iterate through the rows of a rectangle in optimized batches defined by -s
/// instantiating a temporary buffer for each invocation.
///
- public static void IterateRowsWithTempBuffer(
+ internal static void IterateRowsWithTempBuffer(
Rectangle rectangle,
in ParallelExecutionSettings parallelSettings,
Action> body)
@@ -133,13 +134,13 @@ namespace SixLabors.ImageSharp.ParallelUtils
/// Iterate through the rows of a rectangle in optimized batches defined by -s
/// instantiating a temporary buffer for each invocation.
///
- public static void IterateRowsWithTempBuffer(
+ internal static void IterateRowsWithTempBuffer(
Rectangle rectangle,
Configuration configuration,
Action> body)
where T : unmanaged
{
- IterateRowsWithTempBuffer(rectangle, configuration.GetParallelSettings(), body);
+ IterateRowsWithTempBuffer(rectangle, ParallelExecutionSettings.FromConfiguration(configuration), body);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/src/ImageSharp/Color/Color.NamedColors.cs b/src/ImageSharp/Color/Color.NamedColors.cs
index 8811516c1..0575a3e99 100644
--- a/src/ImageSharp/Color/Color.NamedColors.cs
+++ b/src/ImageSharp/Color/Color.NamedColors.cs
@@ -174,9 +174,9 @@ namespace SixLabors.ImageSharp
public static readonly Color DarkSalmon = FromRgba(233, 150, 122, 255);
///
- /// Represents a matching the W3C definition that has an hex value of #8FBC8B.
+ /// Represents a matching the W3C definition that has an hex value of #8FBC8F.
///
- public static readonly Color DarkSeaGreen = FromRgba(143, 188, 139, 255);
+ public static readonly Color DarkSeaGreen = FromRgba(143, 188, 143, 255);
///
/// Represents a matching the W3C definition that has an hex value of #483D8B.
@@ -718,4 +718,4 @@ namespace SixLabors.ImageSharp
///
public static readonly Color YellowGreen = FromRgba(154, 205, 50, 255);
}
-}
\ No newline at end of file
+}
diff --git a/src/ImageSharp/Color/Color.cs b/src/ImageSharp/Color/Color.cs
index 4bdbe088c..76f399517 100644
--- a/src/ImageSharp/Color/Color.cs
+++ b/src/ImageSharp/Color/Color.cs
@@ -105,7 +105,7 @@ namespace SixLabors.ImageSharp
[MethodImpl(InliningOptions.ShortMethod)]
public static Color FromHex(string hex)
{
- Rgba32 rgba = Rgba32.FromHex(hex);
+ var rgba = Rgba32.FromHex(hex);
return new Color(rgba);
}
@@ -178,7 +178,7 @@ namespace SixLabors.ImageSharp
where TPixel : struct, IPixel
{
ReadOnlySpan rgba64Span = MemoryMarshal.Cast(source);
- PixelOperations.Instance.FromRgba64(Configuration.Default, rgba64Span, destination);
+ PixelOperations.Instance.FromRgba64(configuration, rgba64Span, destination);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs
index e385fba5e..4dba7a7e8 100644
--- a/src/ImageSharp/Configuration.cs
+++ b/src/ImageSharp/Configuration.cs
@@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp
get => this.maxDegreeOfParallelism;
set
{
- if (value <= 0)
+ if (value == 0 || value < -1)
{
throw new ArgumentOutOfRangeException(nameof(this.MaxDegreeOfParallelism));
}
diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanBuffer.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanBuffer.cs
index 13c89c82c..34fe1aecb 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanBuffer.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanBuffer.cs
@@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
[MethodImpl(InliningOptions.ShortMethod)]
public void CheckBits()
{
- if (this.remainingBits < 16)
+ if (this.remainingBits < JpegConstants.Huffman.MinBits)
{
this.FillBuffer();
}
@@ -85,8 +85,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
{
// Attempt to load at least the minimum number of required bits into the buffer.
// We fail to do so only if we hit a marker or reach the end of the input stream.
- this.remainingBits += 48;
- this.data = (this.data << 48) | this.GetBytes();
+ this.remainingBits += JpegConstants.Huffman.FetchBits;
+ this.data = (this.data << JpegConstants.Huffman.FetchBits) | this.GetBytes();
}
[MethodImpl(InliningOptions.ShortMethod)]
@@ -141,7 +141,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
private ulong GetBytes()
{
ulong temp = 0;
- for (int i = 0; i < 6; i++)
+ for (int i = 0; i < JpegConstants.Huffman.FetchLoop; i++)
{
int b = this.ReadStream();
diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs
index 4685ba289..602593016 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs
@@ -82,12 +82,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
// Figure C.1: make table of Huffman code length for each symbol
int p = 0;
- for (int l = 1; l <= 16; l++)
+ for (int j = 1; j <= 16; j++)
{
- int i = this.Sizes[l];
+ int i = this.Sizes[j];
while (i-- != 0)
{
- huffSize[p++] = (char)l;
+ huffSize[p++] = (char)j;
}
}
@@ -111,20 +111,19 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
// Figure F.15: generate decoding tables for bit-sequential decoding
p = 0;
- for (int l = 1; l <= 16; l++)
+ for (int j = 1; j <= 16; j++)
{
- if (this.Sizes[l] != 0)
+ if (this.Sizes[j] != 0)
{
- int offset = p - (int)huffCode[p];
- this.ValOffset[l] = offset;
- p += this.Sizes[l];
- this.MaxCode[l] = huffCode[p - 1]; // Maximum code of length l
- this.MaxCode[l] <<= 64 - l; // Left justify
- this.MaxCode[l] |= (1ul << (64 - l)) - 1;
+ this.ValOffset[j] = p - (int)huffCode[p];
+ p += this.Sizes[j];
+ this.MaxCode[j] = huffCode[p - 1]; // Maximum code of length l
+ this.MaxCode[j] <<= JpegConstants.Huffman.RegisterSize - j; // Left justify
+ this.MaxCode[j] |= (1ul << (JpegConstants.Huffman.RegisterSize - j)) - 1;
}
else
{
- this.MaxCode[l] = 0;
+ this.MaxCode[j] = 0;
}
}
@@ -142,11 +141,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
p = 0;
for (int length = 1; length <= JpegConstants.Huffman.LookupBits; length++)
{
+ int jShift = JpegConstants.Huffman.LookupBits - length;
for (int i = 1; i <= this.Sizes[length]; i++, p++)
{
// length = current code's length, p = its index in huffCode[] & Values[].
// Generate left-justified code followed by all possible bit sequences
- int lookBits = (int)(huffCode[p] << (JpegConstants.Huffman.LookupBits - length));
+ int lookBits = (int)(huffCode[p] << jShift);
for (int ctr = 1 << (JpegConstants.Huffman.LookupBits - length); ctr > 0; ctr--)
{
this.LookaheadSize[lookBits] = (byte)length;
diff --git a/src/ImageSharp/Formats/Jpeg/JpegConstants.cs b/src/ImageSharp/Formats/Jpeg/JpegConstants.cs
index a39480e12..9f50e2cab 100644
--- a/src/ImageSharp/Formats/Jpeg/JpegConstants.cs
+++ b/src/ImageSharp/Formats/Jpeg/JpegConstants.cs
@@ -1,7 +1,8 @@
-// Copyright (c) Six Labors and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Collections.Generic;
+using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder;
namespace SixLabors.ImageSharp.Formats.Jpeg
{
@@ -249,6 +250,21 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
///
public const int RegisterSize = 64;
+ ///
+ /// The number of bits to fetch when filling the buffer.
+ ///
+ public const int FetchBits = 48;
+
+ ///
+ /// The number of times to read the input stream when filling the buffer.
+ ///
+ public const int FetchLoop = FetchBits / 8;
+
+ ///
+ /// The minimum number of bits allowed before by the before fetching.
+ ///
+ public const int MinBits = RegisterSize - FetchBits;
+
///
/// If the next Huffman code is no more than this number of bits, we can obtain its length
/// and the corresponding symbol directly from this tables.
@@ -266,4 +282,4 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public const int LookupSize = 1 << LookupBits;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/ImageSharp/ImageFrameCollection{TPixel}.cs b/src/ImageSharp/ImageFrameCollection{TPixel}.cs
index 893a7a4a8..722a4ddea 100644
--- a/src/ImageSharp/ImageFrameCollection{TPixel}.cs
+++ b/src/ImageSharp/ImageFrameCollection{TPixel}.cs
@@ -351,7 +351,7 @@ namespace SixLabors.ImageSharp
this.parent.GetConfiguration(),
source.Size(),
source.Metadata.DeepClone());
- source.CopyPixelsTo(result.PixelBuffer.Span);
+ source.CopyPixelsTo(result.PixelBuffer.GetSpan());
return result;
}
}
diff --git a/src/ImageSharp/ImageFrame{TPixel}.cs b/src/ImageSharp/ImageFrame{TPixel}.cs
index 0436eb9d2..64f37a340 100644
--- a/src/ImageSharp/ImageFrame{TPixel}.cs
+++ b/src/ImageSharp/ImageFrame{TPixel}.cs
@@ -6,9 +6,9 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SixLabors.ImageSharp.Advanced;
+using SixLabors.ImageSharp.Advanced.ParallelUtils;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Metadata;
-using SixLabors.ImageSharp.ParallelUtils;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory;
using SixLabors.Primitives;
@@ -218,10 +218,10 @@ namespace SixLabors.ImageSharp
if (typeof(TPixel) == typeof(TDestinationPixel))
{
Span dest1 = MemoryMarshal.Cast(destination);
- this.PixelBuffer.Span.CopyTo(dest1);
+ this.PixelBuffer.GetSpan().CopyTo(dest1);
}
- PixelOperations.Instance.To(this.Configuration, this.PixelBuffer.Span, destination);
+ PixelOperations.Instance.To(this.Configuration, this.PixelBuffer.GetSpan(), destination);
}
///
diff --git a/src/ImageSharp/Memory/Buffer2DExtensions.cs b/src/ImageSharp/Memory/Buffer2DExtensions.cs
index 59247aa2d..35d55ba59 100644
--- a/src/ImageSharp/Memory/Buffer2DExtensions.cs
+++ b/src/ImageSharp/Memory/Buffer2DExtensions.cs
@@ -13,13 +13,69 @@ namespace SixLabors.ImageSharp.Memory
///
/// Defines extension methods for .
///
- internal static class Buffer2DExtensions
+ public static class Buffer2DExtensions
{
+ ///
+ /// Gets a to the backing buffer of .
+ ///
+ /// The .
+ /// The value type.
+ /// The referencing the memory area.
+ public static Span GetSpan(this Buffer2D buffer)
+ where T : struct
+ {
+ Guard.NotNull(buffer, nameof(buffer));
+ return buffer.MemorySource.GetSpan();
+ }
+
+ ///
+ /// Gets the holding the backing buffer of .
+ ///
+ /// The .
+ /// The value type.
+ /// The .
+ public static Memory GetMemory(this Buffer2D buffer)
+ where T : struct
+ {
+ Guard.NotNull(buffer, nameof(buffer));
+ return buffer.MemorySource.Memory;
+ }
+
+ ///
+ /// Gets a to the row 'y' beginning from the pixel at the first pixel on that row.
+ ///
+ /// The buffer
+ /// The y (row) coordinate
+ /// The element type
+ /// The
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Span GetRowSpan(this Buffer2D buffer, int y)
+ where T : struct
+ {
+ Guard.NotNull(buffer, nameof(buffer));
+ return buffer.GetSpan().Slice(y * buffer.Width, buffer.Width);
+ }
+
+ ///
+ /// Gets a to the row 'y' beginning from the pixel at the first pixel on that row.
+ ///
+ /// The buffer
+ /// The y (row) coordinate
+ /// The element type
+ /// The
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Memory GetRowMemory(this Buffer2D buffer, int y)
+ where T : struct
+ {
+ Guard.NotNull(buffer, nameof(buffer));
+ return buffer.MemorySource.Memory.Slice(y * buffer.Width, buffer.Width);
+ }
+
///
/// Copy columns of inplace,
/// from positions starting at to positions at .
///
- public static unsafe void CopyColumns(
+ internal static unsafe void CopyColumns(
this Buffer2D buffer,
int sourceIndex,
int destIndex,
@@ -37,7 +93,7 @@ namespace SixLabors.ImageSharp.Memory
int dOffset = destIndex * elementSize;
long count = columnCount * elementSize;
- Span span = MemoryMarshal.AsBytes(buffer.Memory.Span);
+ Span span = MemoryMarshal.AsBytes(buffer.GetMemory().Span);
fixed (byte* ptr = span)
{
@@ -60,7 +116,7 @@ namespace SixLabors.ImageSharp.Memory
/// The element type
/// The
/// The
- public static Rectangle FullRectangle(this Buffer2D buffer)
+ internal static Rectangle FullRectangle(this Buffer2D buffer)
where T : struct
{
return new Rectangle(0, 0, buffer.Width, buffer.Height);
@@ -73,11 +129,11 @@ namespace SixLabors.ImageSharp.Memory
/// The
/// The rectangle subarea
/// The
- public static BufferArea GetArea(this Buffer2D buffer, in Rectangle rectangle)
+ internal static BufferArea GetArea(this Buffer2D buffer, in Rectangle rectangle)
where T : struct =>
new BufferArea(buffer, rectangle);
- public static BufferArea GetArea(this Buffer2D buffer, int x, int y, int width, int height)
+ internal static BufferArea GetArea(this Buffer2D buffer, int x, int y, int width, int height)
where T : struct =>
new BufferArea(buffer, new Rectangle(x, y, width, height));
@@ -87,64 +143,17 @@ namespace SixLabors.ImageSharp.Memory
/// The element type
/// The
/// The
- public static BufferArea GetArea(this Buffer2D buffer)
+ internal static BufferArea GetArea(this Buffer2D buffer)
where T : struct =>
new BufferArea(buffer);
- public static BufferArea GetAreaBetweenRows(this Buffer2D buffer, int minY, int maxY)
- where T : struct =>
- new BufferArea(buffer, new Rectangle(0, minY, buffer.Width, maxY - minY));
-
///
/// Gets a span for all the pixels in defined by
///
- public static Span GetMultiRowSpan(this Buffer2D buffer, in RowInterval rows)
+ internal static Span GetMultiRowSpan(this Buffer2D buffer, in RowInterval rows)
where T : struct
{
- return buffer.Span.Slice(rows.Min * buffer.Width, rows.Height * buffer.Width);
- }
-
- ///
- /// Gets a to the row 'y' beginning from the pixel at the first pixel on that row.
- ///
- /// The buffer
- /// The y (row) coordinate
- /// The element type
- /// The
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Memory GetRowMemory(this Buffer2D buffer, int y)
- where T : struct
- {
- return buffer.MemorySource.Memory.Slice(y * buffer.Width, buffer.Width);
- }
-
- ///
- /// Gets a to the row 'y' beginning from the pixel at 'x'.
- ///
- /// The buffer
- /// The x coordinate (position in the row)
- /// The y (row) coordinate
- /// The element type
- /// The
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Span GetRowSpan(this Buffer2D buffer, int x, int y)
- where T : struct
- {
- return buffer.GetSpan().Slice((y * buffer.Width) + x, buffer.Width - x);
- }
-
- ///
- /// Gets a to the row 'y' beginning from the pixel at the first pixel on that row.
- ///
- /// The buffer
- /// The y (row) coordinate
- /// The element type
- /// The
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static Span GetRowSpan(this Buffer2D buffer, int y)
- where T : struct
- {
- return buffer.GetSpan().Slice(y * buffer.Width, buffer.Width);
+ return buffer.GetSpan().Slice(rows.Min * buffer.Width, rows.Height * buffer.Width);
}
///
@@ -153,21 +162,12 @@ namespace SixLabors.ImageSharp.Memory
/// The element type
/// The
/// The of the buffer
- public static Size Size(this Buffer2D buffer)
+ internal static Size Size(this Buffer2D buffer)
where T : struct
{
return new Size(buffer.Width, buffer.Height);
}
- ///
- /// Gets a to the backing buffer of .
- ///
- internal static Span GetSpan(this Buffer2D buffer)
- where T : struct
- {
- return buffer.MemorySource.GetSpan();
- }
-
[Conditional("DEBUG")]
private static void CheckColumnRegionsDoNotOverlap(
Buffer2D buffer,
diff --git a/src/ImageSharp/Memory/Buffer2D{T}.cs b/src/ImageSharp/Memory/Buffer2D{T}.cs
index 82a98bfc6..06cfdf560 100644
--- a/src/ImageSharp/Memory/Buffer2D{T}.cs
+++ b/src/ImageSharp/Memory/Buffer2D{T}.cs
@@ -12,8 +12,12 @@ namespace SixLabors.ImageSharp.Memory
/// Represents a buffer of value type objects
/// interpreted as a 2D region of x elements.
///
+ ///
+ /// Before RC1, this class might be target of API changes, use it on your own risk!
+ ///
/// The value type.
- internal sealed class Buffer2D : IDisposable
+ // TODO: Consider moving this type to the SixLabors.Memory namespace (SixLabors.Core).
+ public sealed class Buffer2D : IDisposable
where T : struct
{
private MemorySource memorySource;
@@ -24,7 +28,7 @@ namespace SixLabors.ImageSharp.Memory
/// The buffer to wrap
/// The number of elements in a row
/// The number of rows
- public Buffer2D(MemorySource memorySource, int width, int height)
+ internal Buffer2D(MemorySource memorySource, int width, int height)
{
this.memorySource = memorySource;
this.Width = width;
@@ -44,11 +48,7 @@ namespace SixLabors.ImageSharp.Memory
///
/// Gets the backing
///
- public MemorySource MemorySource => this.memorySource;
-
- public Memory Memory => this.MemorySource.Memory;
-
- public Span Span => this.Memory.Span;
+ internal MemorySource MemorySource => this.memorySource;
///
/// Gets a reference to the element at the specified position.
@@ -56,7 +56,7 @@ namespace SixLabors.ImageSharp.Memory
/// The x coordinate (row)
/// The y coordinate (position at row)
/// A reference to the element.
- public ref T this[int x, int y]
+ internal ref T this[int x, int y]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
@@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp.Memory
DebugGuard.MustBeLessThan(x, this.Width, nameof(x));
DebugGuard.MustBeLessThan(y, this.Height, nameof(y));
- Span span = this.Span;
+ Span span = this.GetSpan();
return ref span[(this.Width * y) + x];
}
}
@@ -81,7 +81,7 @@ namespace SixLabors.ImageSharp.Memory
DebugGuard.MustBeGreaterThan(h, 0, nameof(h));
DebugGuard.MustBeLessThanOrEqualTo(y + h, this.Height, nameof(h));
- Memory slice = this.Memory.Slice(y * this.Width, h * this.Width);
+ Memory slice = this.GetMemory().Slice(y * this.Width, h * this.Width);
var memory = new MemorySource(slice);
return new Buffer2D(memory, this.Width, h);
}
@@ -98,7 +98,7 @@ namespace SixLabors.ImageSharp.Memory
/// Swaps the contents of 'destination' with 'source' if the buffers are owned (1),
/// copies the contents of 'source' to 'destination' otherwise (2). Buffers should be of same size in case 2!
///
- public static void SwapOrCopyContent(Buffer2D destination, Buffer2D source)
+ internal static void SwapOrCopyContent(Buffer2D destination, Buffer2D source)
{
MemorySource.SwapOrCopyContent(ref destination.memorySource, ref source.memorySource);
SwapDimensionData(destination, source);
diff --git a/src/ImageSharp/Memory/RowInterval.cs b/src/ImageSharp/Memory/RowInterval.cs
index 815918754..13037c889 100644
--- a/src/ImageSharp/Memory/RowInterval.cs
+++ b/src/ImageSharp/Memory/RowInterval.cs
@@ -10,26 +10,32 @@ namespace SixLabors.ImageSharp.Memory
///
/// Represents an interval of rows in a and/or
///
- internal readonly struct RowInterval : IEquatable
+ ///
+ /// Before RC1, this class might be target of API changes, use it on your own risk!
+ ///
+ // TODO: Consider moving this type to the SixLabors.Memory namespace (SixLabors.Core).
+ public readonly struct RowInterval : IEquatable
{
///
/// Initializes a new instance of the struct.
///
+ /// The inclusive minimum row.
+ /// The exclusive maximum row.
public RowInterval(int min, int max)
{
- DebugGuard.MustBeLessThan(min, max, nameof(min));
+ Guard.MustBeLessThan(min, max, nameof(min));
this.Min = min;
this.Max = max;
}
///
- /// Gets the INCLUSIVE minimum.
+ /// Gets the inclusive minimum row.
///
public int Min { get; }
///
- /// Gets the EXCLUSIVE maximum.
+ /// Gets the exclusive maximum row.
///
public int Max { get; }
@@ -38,33 +44,48 @@ namespace SixLabors.ImageSharp.Memory
///
public int Height => this.Max - this.Min;
+ ///
+ /// Returns a boolean indicating whether the given two -s are equal.
+ ///
+ /// The first to compare.
+ /// The second to compare.
+ /// True if the given -s are equal; False otherwise.
public static bool operator ==(RowInterval left, RowInterval right)
{
return left.Equals(right);
}
+ ///
+ /// Returns a boolean indicating whether the given two -s are not equal.
+ ///
+ /// The first to compare.
+ /// The second to compare.
+ /// True if the given -s are not equal; False otherwise.
public static bool operator !=(RowInterval left, RowInterval right)
{
return !left.Equals(right);
}
///
- public override string ToString() => $"RowInterval [{this.Min}->{this.Max}]";
-
- public RowInterval Slice(int start) => new RowInterval(this.Min + start, this.Max);
-
- public RowInterval Slice(int start, int length) => new RowInterval(this.Min + start, this.Min + start + length);
-
public bool Equals(RowInterval other)
{
return this.Min == other.Min && this.Max == other.Max;
}
+ ///
public override bool Equals(object obj)
{
return !ReferenceEquals(null, obj) && obj is RowInterval other && this.Equals(other);
}
+ ///
public override int GetHashCode() => HashCode.Combine(this.Min, this.Max);
+
+ ///
+ public override string ToString() => $"RowInterval [{this.Min}->{this.Max}]";
+
+ internal RowInterval Slice(int start) => new RowInterval(this.Min + start, this.Max);
+
+ internal RowInterval Slice(int start, int length) => new RowInterval(this.Min + start, this.Min + start + length);
}
-}
\ No newline at end of file
+}
diff --git a/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs b/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs
index 62dc0fcf5..b2f6261ef 100644
--- a/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs
+++ b/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs
@@ -9,17 +9,17 @@ namespace SixLabors.ImageSharp.PixelFormats
public enum PixelAlphaCompositionMode
{
///
- /// returns the destination over the source.
+ /// Returns the destination over the source.
///
SrcOver = 0,
///
- /// returns the source colors.
+ /// Returns the source colors.
///
Src,
///
- /// returns the source over the destination.
+ /// Returns the source over the destination.
///
SrcAtop,
diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs
index e94ea452b..51ee5d12d 100644
--- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs
@@ -26,7 +26,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
where TPixel : struct, IPixel
{
- internal class NormalSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalSrc" composition equation.
+ ///
+ public class NormalSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -61,7 +65,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplySrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplySrc" composition equation.
+ ///
+ public class MultiplySrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -96,7 +104,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddSrc" composition equation.
+ ///
+ public class AddSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -131,7 +143,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractSrc" composition equation.
+ ///
+ public class SubtractSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -166,7 +182,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenSrc" composition equation.
+ ///
+ public class ScreenSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -201,7 +221,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenSrc" composition equation.
+ ///
+ public class DarkenSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -236,7 +260,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenSrc" composition equation.
+ ///
+ public class LightenSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -271,7 +299,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlaySrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlaySrc" composition equation.
+ ///
+ public class OverlaySrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -306,7 +338,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightSrc : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightSrc" composition equation.
+ ///
+ public class HardLightSrc : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -341,7 +377,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalSrcAtop" composition equation.
+ ///
+ public class NormalSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -376,7 +416,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplySrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplySrcAtop" composition equation.
+ ///
+ public class MultiplySrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -411,7 +455,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddSrcAtop" composition equation.
+ ///
+ public class AddSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -446,7 +494,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractSrcAtop" composition equation.
+ ///
+ public class SubtractSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -481,7 +533,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenSrcAtop" composition equation.
+ ///
+ public class ScreenSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -516,7 +572,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenSrcAtop" composition equation.
+ ///
+ public class DarkenSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -551,7 +611,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenSrcAtop" composition equation.
+ ///
+ public class LightenSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -586,7 +650,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlaySrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlaySrcAtop" composition equation.
+ ///
+ public class OverlaySrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -621,7 +689,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightSrcAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightSrcAtop" composition equation.
+ ///
+ public class HardLightSrcAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -656,7 +728,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalSrcOver" composition equation.
+ ///
+ public class NormalSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -691,7 +767,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplySrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplySrcOver" composition equation.
+ ///
+ public class MultiplySrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -726,7 +806,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddSrcOver" composition equation.
+ ///
+ public class AddSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -761,7 +845,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractSrcOver" composition equation.
+ ///
+ public class SubtractSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -796,7 +884,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenSrcOver" composition equation.
+ ///
+ public class ScreenSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -831,7 +923,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenSrcOver" composition equation.
+ ///
+ public class DarkenSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -866,7 +962,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenSrcOver" composition equation.
+ ///
+ public class LightenSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -901,7 +1001,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlaySrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlaySrcOver" composition equation.
+ ///
+ public class OverlaySrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -936,7 +1040,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightSrcOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightSrcOver" composition equation.
+ ///
+ public class HardLightSrcOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -971,7 +1079,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalSrcIn" composition equation.
+ ///
+ public class NormalSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1006,7 +1118,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplySrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplySrcIn" composition equation.
+ ///
+ public class MultiplySrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1041,7 +1157,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddSrcIn" composition equation.
+ ///
+ public class AddSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1076,7 +1196,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractSrcIn" composition equation.
+ ///
+ public class SubtractSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1111,7 +1235,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenSrcIn" composition equation.
+ ///
+ public class ScreenSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1146,7 +1274,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenSrcIn" composition equation.
+ ///
+ public class DarkenSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1181,7 +1313,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenSrcIn" composition equation.
+ ///
+ public class LightenSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1216,7 +1352,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlaySrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlaySrcIn" composition equation.
+ ///
+ public class OverlaySrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1251,7 +1391,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightSrcIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightSrcIn" composition equation.
+ ///
+ public class HardLightSrcIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1286,7 +1430,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalSrcOut" composition equation.
+ ///
+ public class NormalSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1321,7 +1469,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplySrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplySrcOut" composition equation.
+ ///
+ public class MultiplySrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1356,7 +1508,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddSrcOut" composition equation.
+ ///
+ public class AddSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1391,7 +1547,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractSrcOut" composition equation.
+ ///
+ public class SubtractSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1426,7 +1586,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenSrcOut" composition equation.
+ ///
+ public class ScreenSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1461,7 +1625,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenSrcOut" composition equation.
+ ///
+ public class DarkenSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1496,7 +1664,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenSrcOut" composition equation.
+ ///
+ public class LightenSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1531,7 +1703,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlaySrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlaySrcOut" composition equation.
+ ///
+ public class OverlaySrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1566,7 +1742,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightSrcOut : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightSrcOut" composition equation.
+ ///
+ public class HardLightSrcOut : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1601,7 +1781,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalDest" composition equation.
+ ///
+ public class NormalDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1636,7 +1820,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplyDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplyDest" composition equation.
+ ///
+ public class MultiplyDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1671,7 +1859,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddDest" composition equation.
+ ///
+ public class AddDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1706,7 +1898,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractDest" composition equation.
+ ///
+ public class SubtractDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1741,7 +1937,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenDest" composition equation.
+ ///
+ public class ScreenDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1776,7 +1976,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenDest" composition equation.
+ ///
+ public class DarkenDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1811,7 +2015,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenDest" composition equation.
+ ///
+ public class LightenDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1846,7 +2054,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlayDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlayDest" composition equation.
+ ///
+ public class OverlayDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1881,7 +2093,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightDest : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightDest" composition equation.
+ ///
+ public class HardLightDest : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1916,7 +2132,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalDestAtop" composition equation.
+ ///
+ public class NormalDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1951,7 +2171,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplyDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplyDestAtop" composition equation.
+ ///
+ public class MultiplyDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -1986,7 +2210,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddDestAtop" composition equation.
+ ///
+ public class AddDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2021,7 +2249,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractDestAtop" composition equation.
+ ///
+ public class SubtractDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2056,7 +2288,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenDestAtop" composition equation.
+ ///
+ public class ScreenDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2091,7 +2327,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenDestAtop" composition equation.
+ ///
+ public class DarkenDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2126,7 +2366,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenDestAtop" composition equation.
+ ///
+ public class LightenDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2161,7 +2405,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlayDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlayDestAtop" composition equation.
+ ///
+ public class OverlayDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2196,7 +2444,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightDestAtop : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightDestAtop" composition equation.
+ ///
+ public class HardLightDestAtop : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2231,7 +2483,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalDestOver" composition equation.
+ ///
+ public class NormalDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2266,7 +2522,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplyDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplyDestOver" composition equation.
+ ///
+ public class MultiplyDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2301,7 +2561,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddDestOver" composition equation.
+ ///
+ public class AddDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2336,7 +2600,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractDestOver" composition equation.
+ ///
+ public class SubtractDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2371,7 +2639,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenDestOver" composition equation.
+ ///
+ public class ScreenDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2406,7 +2678,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenDestOver" composition equation.
+ ///
+ public class DarkenDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2441,7 +2717,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenDestOver" composition equation.
+ ///
+ public class LightenDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2476,7 +2756,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlayDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlayDestOver" composition equation.
+ ///
+ public class OverlayDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2511,7 +2795,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class HardLightDestOver : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "HardLightDestOver" composition equation.
+ ///
+ public class HardLightDestOver : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2546,7 +2834,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class NormalDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "NormalDestIn" composition equation.
+ ///
+ public class NormalDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2581,7 +2873,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class MultiplyDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "MultiplyDestIn" composition equation.
+ ///
+ public class MultiplyDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2616,7 +2912,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class AddDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "AddDestIn" composition equation.
+ ///
+ public class AddDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2651,7 +2951,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class SubtractDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "SubtractDestIn" composition equation.
+ ///
+ public class SubtractDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2686,7 +2990,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class ScreenDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "ScreenDestIn" composition equation.
+ ///
+ public class ScreenDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2721,7 +3029,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class DarkenDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "DarkenDestIn" composition equation.
+ ///
+ public class DarkenDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2756,7 +3068,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class LightenDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "LightenDestIn" composition equation.
+ ///
+ public class LightenDestIn : PixelBlender
{
///
/// Gets the static instance of this blender.
@@ -2791,7 +3107,11 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
}
}
- internal class OverlayDestIn : PixelBlender
+
+ ///
+ /// A pixel blender that implements the "OverlayDestIn" composition equation.
+ ///
+ public class OverlayDestIn : PixelBlender
{
///