diff --git a/README.md b/README.md
index af8d4f73ae..1e52039568 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@ SixLabors.ImageSharp
[](https://github.com/SixLabors/ImageSharp/actions)
+[](https://codecov.io/gh/SixLabors/ImageSharp)
[](https://raw.githubusercontent.com/SixLabors/ImageSharp/master/LICENSE)
[](https://gitter.im/ImageSharp/General?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://twitter.com/intent/tweet?hashtags=imagesharp,dotnet,oss&text=ImageSharp.+A+new+cross-platform+2D+graphics+API+in+C%23&url=https%3a%2f%2fgithub.com%2fSixLabors%2fImageSharp&via=sixlabors)
@@ -46,13 +47,6 @@ The **ImageSharp** library is made up of multiple packages:
- Transform methods like Resize, Crop, Skew, Rotate - anything that alters the dimensions of the image
- Non-transform methods like Gaussian Blur, Pixelate, Edge Detection - anything that maintains the original image dimensions
-
### Questions?
- Do you have questions? We are happy to help! Please [join our gitter channel](https://gitter.im/ImageSharp/General), or ask them on [stackoverflow](https://stackoverflow.com) using the `ImageSharp` tag. **Do not** open issues for questions!
diff --git a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs
index 9bf8943b71..d810296d6b 100644
--- a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs
+++ b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs
@@ -29,7 +29,23 @@ public static void AcceptVisitor(this Image source, IImageVisitor visitor)
///
The source image.
///
Returns the configuration.
public static Configuration GetConfiguration(this Image source)
- => GetConfiguration((IConfigurable)source);
+ => GetConfiguration((IConfigurationProvider)source);
+
+ ///
+ /// Gets the configuration for the image frame.
+ ///
+ ///
The source image.
+ ///
Returns the configuration.
+ public static Configuration GetConfiguration(this ImageFrame source)
+ => GetConfiguration((IConfigurationProvider)source);
+
+ ///
+ /// Gets the configuration .
+ ///
+ ///
The source image
+ ///
Returns the bounds of the image
+ private static Configuration GetConfiguration(IConfigurationProvider source)
+ => source?.Configuration ?? Configuration.Default;
///
/// Gets the representation of the pixels as a of contiguous memory in the source image's pixel format
@@ -158,17 +174,9 @@ internal static Memory GetPixelRowMemory(this Image sour
///
///
The source image.
///
Returns the configuration.
- internal static MemoryAllocator GetMemoryAllocator(this IConfigurable source)
+ internal static MemoryAllocator GetMemoryAllocator(this IConfigurationProvider source)
=> GetConfiguration(source).MemoryAllocator;
- ///
- /// Gets the configuration.
- ///
- ///
The source image
- ///
Returns the bounds of the image
- private static Configuration GetConfiguration(IConfigurable source)
- => source?.Configuration ?? Configuration.Default;
-
///
/// Returns a reference to the 0th element of the Pixel buffer.
/// Such a reference can be used for pinning but must never be dereferenced.
diff --git a/src/ImageSharp/Advanced/AotCompilerTools.cs b/src/ImageSharp/Advanced/AotCompilerTools.cs
index bb4ddb7d0c..142ea3f3e7 100644
--- a/src/ImageSharp/Advanced/AotCompilerTools.cs
+++ b/src/ImageSharp/Advanced/AotCompilerTools.cs
@@ -109,7 +109,7 @@ private static void Seed()
private static void AotCompileOctreeQuantizer()
where TPixel : struct, IPixel
{
- using (var test = new OctreeFrameQuantizer(new OctreeQuantizer(false)))
+ using (var test = new OctreeFrameQuantizer(Configuration.Default, new OctreeQuantizer(false)))
{
test.AotGetPalette();
}
@@ -122,7 +122,7 @@ private static void AotCompileOctreeQuantizer()
private static void AotCompileWuQuantizer()
where TPixel : struct, IPixel
{
- using (var test = new WuFrameQuantizer(Configuration.Default.MemoryAllocator, new WuQuantizer(false)))
+ using (var test = new WuFrameQuantizer(Configuration.Default, new WuQuantizer(false)))
{
test.QuantizeFrame(new ImageFrame(Configuration.Default, 1, 1));
test.AotGetPalette();
diff --git a/src/ImageSharp/Advanced/IConfigurable.cs b/src/ImageSharp/Advanced/IConfigurable.cs
deleted file mode 100644
index 38fc83ae1d..0000000000
--- a/src/ImageSharp/Advanced/IConfigurable.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Six Labors and contributors.
-// Licensed under the Apache License, Version 2.0.
-
-namespace SixLabors.ImageSharp.Advanced
-{
- ///
- /// Encapsulates the properties for configuration.
- ///
- internal interface IConfigurable
- {
- ///
- /// Gets the configuration.
- ///
- Configuration Configuration { get; }
- }
-}
\ No newline at end of file
diff --git a/src/ImageSharp/Advanced/IConfigurationProvider.cs b/src/ImageSharp/Advanced/IConfigurationProvider.cs
new file mode 100644
index 0000000000..d3e3a91aa3
--- /dev/null
+++ b/src/ImageSharp/Advanced/IConfigurationProvider.cs
@@ -0,0 +1,16 @@
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+namespace SixLabors.ImageSharp.Advanced
+{
+ ///
+ /// Defines the contract for objects that can provide access to configuration.
+ ///
+ internal interface IConfigurationProvider
+ {
+ ///
+ /// Gets the configuration which allows altering default behaviour or extending the library.
+ ///
+ Configuration Configuration { get; }
+ }
+}
diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs
index 9f26df300b..619be880a0 100644
--- a/src/ImageSharp/Configuration.cs
+++ b/src/ImageSharp/Configuration.cs
@@ -16,7 +16,7 @@
namespace SixLabors.ImageSharp
{
///
- /// Provides configuration code which allows altering default behaviour or extending the library.
+ /// Provides configuration which allows altering default behaviour or extending the library.
///
public sealed class Configuration
{
diff --git a/src/ImageSharp/Formats/Gif/GifEncoder.cs b/src/ImageSharp/Formats/Gif/GifEncoder.cs
index fef311596e..248915cb70 100644
--- a/src/ImageSharp/Formats/Gif/GifEncoder.cs
+++ b/src/ImageSharp/Formats/Gif/GifEncoder.cs
@@ -28,7 +28,7 @@ public sealed class GifEncoder : IImageEncoder, IGifEncoderOptions
public void Encode(Image image, Stream stream)
where TPixel : struct, IPixel
{
- var encoder = new GifEncoderCore(image.GetConfiguration().MemoryAllocator, this);
+ var encoder = new GifEncoderCore(image.GetConfiguration(), this);
encoder.Encode(image, stream);
}
}
diff --git a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs
index b4aae0744b..a691e527ee 100644
--- a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs
+++ b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs
@@ -53,11 +53,12 @@ internal sealed class GifEncoderCore
///
/// Initializes a new instance of the class.
///
- /// The to use for buffer allocations.
+ /// The configuration which allows altering default behaviour or extending the library.
/// The options for the encoder.
- public GifEncoderCore(MemoryAllocator memoryAllocator, IGifEncoderOptions options)
+ public GifEncoderCore(Configuration configuration, IGifEncoderOptions options)
{
- this.memoryAllocator = memoryAllocator;
+ this.configuration = configuration;
+ this.memoryAllocator = configuration.MemoryAllocator;
this.quantizer = options.Quantizer;
this.colorTableMode = options.ColorTableMode;
}
@@ -74,16 +75,14 @@ public void Encode(Image image, Stream stream)
Guard.NotNull(image, nameof(image));
Guard.NotNull(stream, nameof(stream));
- this.configuration = image.GetConfiguration();
-
ImageMetadata metadata = image.Metadata;
GifMetadata gifMetadata = metadata.GetGifMetadata();
- this.colorTableMode = this.colorTableMode ?? gifMetadata.ColorTableMode;
+ this.colorTableMode ??= gifMetadata.ColorTableMode;
bool useGlobalTable = this.colorTableMode == GifColorTableMode.Global;
// Quantize the image returning a palette.
IQuantizedFrame quantized;
- using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(image.GetConfiguration()))
+ using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(this.configuration))
{
quantized = frameQuantizer.QuantizeFrame(image.Frames.RootFrame);
}
@@ -146,7 +145,7 @@ private void EncodeGlobal(Image image, IQuantizedFrame q
else
{
using (IFrameQuantizer paletteFrameQuantizer =
- new PaletteFrameQuantizer(this.quantizer.Diffuser, quantized.Palette))
+ new PaletteFrameQuantizer(this.configuration, this.quantizer.Diffuser, quantized.Palette))
{
using (IQuantizedFrame paletteQuantized = paletteFrameQuantizer.QuantizeFrame(frame))
{
@@ -172,14 +171,14 @@ private void EncodeLocal(Image image, IQuantizedFrame qu
if (previousFrame != null && previousMeta.ColorTableLength != frameMetadata.ColorTableLength
&& frameMetadata.ColorTableLength > 0)
{
- using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(image.GetConfiguration(), frameMetadata.ColorTableLength))
+ using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(this.configuration, frameMetadata.ColorTableLength))
{
quantized = frameQuantizer.QuantizeFrame(frame);
}
}
else
{
- using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(image.GetConfiguration()))
+ using (IFrameQuantizer frameQuantizer = this.quantizer.CreateFrameQuantizer(this.configuration))
{
quantized = frameQuantizer.QuantizeFrame(frame);
}
@@ -202,9 +201,7 @@ private void EncodeLocal(Image image, IQuantizedFrame qu
///
/// Returns the index of the most transparent color in the palette.
///
- ///
- /// The quantized.
- ///
+ /// The quantized frame.
/// The pixel format.
///
/// The .
diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter{TPixel}.cs
index 883a085b5a..92482de2a6 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter{TPixel}.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter{TPixel}.cs
@@ -1,9 +1,9 @@
-// Copyright (c) Six Labors and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;
-
+using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
@@ -60,7 +60,7 @@ public void Convert(ImageFrame frame, int x, int y)
this.pixelBlock.LoadAndStretchEdges(frame, x, y);
Span rgbSpan = this.rgbBlock.AsSpanUnsafe();
- PixelOperations.Instance.ToRgb24(frame.Configuration, this.pixelBlock.AsSpanUnsafe(), rgbSpan);
+ PixelOperations.Instance.ToRgb24(frame.GetConfiguration(), this.pixelBlock.AsSpanUnsafe(), rgbSpan);
ref float yBlockStart = ref Unsafe.As(ref this.Y);
ref float cbBlockStart = ref Unsafe.As(ref this.Cb);
@@ -81,4 +81,4 @@ ref Unsafe.Add(ref cbBlockStart, i),
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/ImageSharp/Image.cs b/src/ImageSharp/Image.cs
index a62bfed1e2..574178d39e 100644
--- a/src/ImageSharp/Image.cs
+++ b/src/ImageSharp/Image.cs
@@ -16,20 +16,23 @@ namespace SixLabors.ImageSharp
/// For the non-generic type, the pixel type is only known at runtime.
/// is always implemented by a pixel-specific instance.
///
- public abstract partial class Image : IImage, IConfigurable
+ public abstract partial class Image : IImage, IConfigurationProvider
{
private Size size;
+ private readonly Configuration configuration;
///
/// Initializes a new instance of the class.
///
- ///
The
.
+ ///
+ /// The configuration which allows altering default behaviour or extending the library.
+ ///
///
The
.
///
The
.
///
The
.
protected Image(Configuration configuration, PixelTypeInfo pixelType, ImageMetadata metadata, Size size)
{
- this.Configuration = configuration ?? Configuration.Default;
+ this.configuration = configuration ?? Configuration.Default;
this.PixelType = pixelType;
this.size = size;
this.Metadata = metadata ?? new ImageMetadata();
@@ -48,11 +51,6 @@ internal Image(
{
}
- ///
- /// Gets the .
- ///
- protected Configuration Configuration { get; }
-
///
/// Gets the implementing the public property.
///
@@ -75,10 +73,8 @@ internal Image(
///
public ImageFrameCollection Frames => this.NonGenericFrameCollection;
- ///
- /// Gets the pixel buffer.
- ///
- Configuration IConfigurable.Configuration => this.Configuration;
+ ///
+ Configuration IConfigurationProvider.Configuration => this.configuration;
///
public void Dispose()
@@ -108,7 +104,7 @@ public void Save(Stream stream, IImageEncoder encoder)
///
The pixel format.
///
The
public Image
CloneAs()
- where TPixel2 : struct, IPixel => this.CloneAs(this.Configuration);
+ where TPixel2 : struct, IPixel => this.CloneAs(this.GetConfiguration());
///
/// Returns a copy of the image in the given pixel format.
diff --git a/src/ImageSharp/ImageFrame.cs b/src/ImageSharp/ImageFrame.cs
index fe2a2b7626..235840e77b 100644
--- a/src/ImageSharp/ImageFrame.cs
+++ b/src/ImageSharp/ImageFrame.cs
@@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using SixLabors.ImageSharp.Memory;
+using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
@@ -13,37 +13,28 @@ namespace SixLabors.ImageSharp
/// In case of animated formats like gif, it contains the single frame in a animation.
/// In all other cases it is the only frame of the image.
///
- public abstract partial class ImageFrame : IDisposable
+ public abstract partial class ImageFrame : IConfigurationProvider, IDisposable
{
+ private readonly Configuration configuration;
+
///
/// Initializes a new instance of the class.
///
- /// The .
- /// The width.
- /// The height.
+ /// The configuration which allows altering default behaviour or extending the library.
+ /// The frame width.
+ /// The frame height.
/// The .
protected ImageFrame(Configuration configuration, int width, int height, ImageFrameMetadata metadata)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.NotNull(metadata, nameof(metadata));
- this.Configuration = configuration;
- this.MemoryAllocator = configuration.MemoryAllocator;
+ this.configuration = configuration ?? Configuration.Default;
this.Width = width;
this.Height = height;
this.Metadata = metadata;
}
- ///
- /// Gets the to use for buffer allocations.
- ///
- public MemoryAllocator MemoryAllocator { get; }
-
- ///
- /// Gets the instance associated with this .
- ///
- internal Configuration Configuration { get; }
-
///
/// Gets the width.
///
@@ -59,6 +50,9 @@ protected ImageFrame(Configuration configuration, int width, int height, ImageFr
///
public ImageFrameMetadata Metadata { get; }
+ ///
+ Configuration IConfigurationProvider.Configuration => this.configuration;
+
///
/// Gets the size of the frame.
///
diff --git a/src/ImageSharp/ImageFrame{TPixel}.cs b/src/ImageSharp/ImageFrame{TPixel}.cs
index 85454e1508..e1112c0170 100644
--- a/src/ImageSharp/ImageFrame{TPixel}.cs
+++ b/src/ImageSharp/ImageFrame{TPixel}.cs
@@ -59,7 +59,7 @@ internal ImageFrame(Configuration configuration, int width, int height, ImageFra
Guard.MustBeGreaterThan(width, 0, nameof(width));
Guard.MustBeGreaterThan(height, 0, nameof(height));
- this.PixelBuffer = this.MemoryAllocator.Allocate2D(width, height, AllocationOptions.Clean);
+ this.PixelBuffer = this.GetConfiguration().MemoryAllocator.Allocate2D(width, height, AllocationOptions.Clean);
}
///
@@ -88,7 +88,7 @@ internal ImageFrame(Configuration configuration, int width, int height, TPixel b
Guard.MustBeGreaterThan(width, 0, nameof(width));
Guard.MustBeGreaterThan(height, 0, nameof(height));
- this.PixelBuffer = this.MemoryAllocator.Allocate2D(width, height);
+ this.PixelBuffer = this.GetConfiguration().MemoryAllocator.Allocate2D(width, height);
this.Clear(backgroundColor);
}
@@ -132,7 +132,7 @@ internal ImageFrame(Configuration configuration, ImageFrame source)
Guard.NotNull(configuration, nameof(configuration));
Guard.NotNull(source, nameof(source));
- this.PixelBuffer = this.MemoryAllocator.Allocate2D(source.PixelBuffer.Width, source.PixelBuffer.Height);
+ this.PixelBuffer = this.GetConfiguration().MemoryAllocator.Allocate2D(source.PixelBuffer.Width, source.PixelBuffer.Height);
source.PixelBuffer.GetSpan().CopyTo(this.PixelBuffer.GetSpan());
}
@@ -219,7 +219,7 @@ internal override void CopyPixelsTo(Span d
this.PixelBuffer.GetSpan().CopyTo(dest1);
}
- PixelOperations.Instance.To(this.Configuration, this.PixelBuffer.GetSpan(), destination);
+ PixelOperations.Instance.To(this.GetConfiguration(), this.PixelBuffer.GetSpan(), destination);
}
///
@@ -229,7 +229,7 @@ internal override void CopyPixelsTo(Span d
/// Clones the current instance.
///
/// The
- internal ImageFrame Clone() => this.Clone(this.Configuration);
+ internal ImageFrame Clone() => this.Clone(this.GetConfiguration());
///
/// Clones the current instance.
@@ -244,7 +244,7 @@ internal override void CopyPixelsTo(Span d
/// The pixel format.
/// The
internal ImageFrame CloneAs()
- where TPixel2 : struct, IPixel => this.CloneAs(this.Configuration);
+ where TPixel2 : struct, IPixel => this.CloneAs(this.GetConfiguration());
///
/// Returns a copy of the image frame in the given pixel format.
diff --git a/src/ImageSharp/Image{TPixel}.cs b/src/ImageSharp/Image{TPixel}.cs
index b7e63dc253..87bdf90a1b 100644
--- a/src/ImageSharp/Image{TPixel}.cs
+++ b/src/ImageSharp/Image{TPixel}.cs
@@ -154,7 +154,7 @@ internal Image(Configuration configuration, ImageMetadata metadata, IEnumerable<
/// Clones the current image
///
/// Returns a new image with all the same metadata as the original.
- public Image Clone() => this.Clone(this.Configuration);
+ public Image Clone() => this.Clone(this.GetConfiguration());
///
/// Clones the current image with the given configuration.
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs
index 15b90f02d9..83bc46d8ec 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Argb32.PixelOperations.Generated.cs
@@ -11,7 +11,6 @@
using System.Runtime.InteropServices;
-
namespace SixLabors.ImageSharp.PixelFormats
{
///
@@ -25,27 +24,27 @@ public partial struct Argb32
internal class PixelOperations : PixelOperations
{
///
- internal override void FromArgb32(Configuration configuration, ReadOnlySpan source, Span destPixels)
+ public override void FromArgb32(Configuration configuration, ReadOnlySpan source, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels));
- source.CopyTo(destPixels);
+ source.CopyTo(destinationPixels);
}
///
- internal override void ToArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
- sourcePixels.CopyTo(destPixels);
+ sourcePixels.CopyTo(destinationPixels);
}
///
- public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destPixels, PixelConversionModifiers modifiers)
+ public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destinationPixels, PixelConversionModifiers modifiers)
{
- Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale));
+ Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destinationPixels, modifiers.Remove(PixelConversionModifiers.Scale));
}
///
@@ -54,13 +53,13 @@ public override void ToVector4(Configuration configuration, ReadOnlySpan
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale));
}
///
- internal override void ToRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -70,13 +69,13 @@ internal override void ToRgba32(Configuration configuration, ReadOnlySpan
- internal override void FromRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void FromRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -85,13 +84,13 @@ internal override void FromRgba32(Configuration configuration, ReadOnlySpan
- internal override void ToBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -101,13 +100,13 @@ internal override void ToBgra32(Configuration configuration, ReadOnlySpan
- internal override void FromBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void FromBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -117,13 +116,13 @@ internal override void FromBgra32(Configuration configuration, ReadOnlySpan
- internal override void ToBgr24(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgr24(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Bgr24 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Bgr24 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -135,13 +134,13 @@ internal override void ToBgr24(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref L8 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref L8 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -153,13 +152,13 @@ internal override void ToL8(Configuration configuration, ReadOnlySpan so
}
///
- internal override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref L16 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref L16 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -171,13 +170,13 @@ internal override void ToL16(Configuration configuration, ReadOnlySpan s
}
///
- internal override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref La16 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref La16 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -189,13 +188,13 @@ internal override void ToLa16(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref La32 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref La32 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -207,13 +206,13 @@ internal override void ToLa32(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToRgb24(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgb24(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgb24 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgb24 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -225,13 +224,13 @@ internal override void ToRgb24(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToRgb48(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgb48(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgb48 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgb48 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -243,13 +242,13 @@ internal override void ToRgb48(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToRgba64(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgba64(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgba64 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgba64 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -261,13 +260,13 @@ internal override void ToRgba64(Configuration configuration, ReadOnlySpan
- internal override void ToBgra5551(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgra5551(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Argb32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Bgra5551 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Bgra5551 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -278,14 +277,13 @@ internal override void ToBgra5551(Configuration configuration, ReadOnlySpan
- internal override void From(
+ public override void From(
Configuration configuration,
ReadOnlySpan sourcePixels,
Span destinationPixels)
{
PixelOperations.Instance.ToArgb32(configuration, sourcePixels, destinationPixels);
}
-
}
}
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs
index 7eb81764cd..8f21ef2d4e 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgr24.PixelOperations.Generated.cs
@@ -11,7 +11,6 @@
using System.Runtime.InteropServices;
-
namespace SixLabors.ImageSharp.PixelFormats
{
///
@@ -25,27 +24,27 @@ public partial struct Bgr24
internal class PixelOperations : PixelOperations
{
///
- internal override void FromBgr24(Configuration configuration, ReadOnlySpan source, Span destPixels)
+ public override void FromBgr24(Configuration configuration, ReadOnlySpan source, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels));
- source.CopyTo(destPixels);
+ source.CopyTo(destinationPixels);
}
///
- internal override void ToBgr24(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgr24(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
- sourcePixels.CopyTo(destPixels);
+ sourcePixels.CopyTo(destinationPixels);
}
///
- public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destPixels, PixelConversionModifiers modifiers)
+ public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destinationPixels, PixelConversionModifiers modifiers)
{
- Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
+ Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destinationPixels, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}
///
@@ -55,13 +54,13 @@ public override void ToVector4(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Argb32 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Argb32 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -73,13 +72,13 @@ internal override void ToArgb32(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Bgra32 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Bgra32 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -91,13 +90,13 @@ internal override void ToBgra32(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref L8 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref L8 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -109,13 +108,13 @@ internal override void ToL8(Configuration configuration, ReadOnlySpan sou
}
///
- internal override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref L16 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref L16 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -127,13 +126,13 @@ internal override void ToL16(Configuration configuration, ReadOnlySpan so
}
///
- internal override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref La16 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref La16 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -145,13 +144,13 @@ internal override void ToLa16(Configuration configuration, ReadOnlySpan s
}
///
- internal override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref La32 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref La32 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -163,13 +162,13 @@ internal override void ToLa32(Configuration configuration, ReadOnlySpan s
}
///
- internal override void ToRgb24(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgb24(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgb24 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgb24 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -181,13 +180,13 @@ internal override void ToRgb24(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgba32 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgba32 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -199,13 +198,13 @@ internal override void ToRgba32(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToRgb48(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgb48(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgb48 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgb48 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -217,13 +216,13 @@ internal override void ToRgb48(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToRgba64(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgba64(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Rgba64 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Rgba64 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -235,13 +234,13 @@ internal override void ToRgba64(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToBgra5551(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgra5551(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgr24 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Bgra5551 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Bgra5551 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -252,14 +251,13 @@ internal override void ToBgra5551(Configuration configuration, ReadOnlySpan
- internal override void From(
+ public override void From(
Configuration configuration,
ReadOnlySpan sourcePixels,
Span destinationPixels)
{
PixelOperations.Instance.ToBgr24(configuration, sourcePixels, destinationPixels);
}
-
}
}
}
diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs
index 222ba8f6ea..58a68bd031 100644
--- a/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs
+++ b/src/ImageSharp/PixelFormats/PixelImplementations/Generated/Bgra32.PixelOperations.Generated.cs
@@ -11,7 +11,6 @@
using System.Runtime.InteropServices;
-
namespace SixLabors.ImageSharp.PixelFormats
{
///
@@ -25,27 +24,27 @@ public partial struct Bgra32
internal class PixelOperations : PixelOperations
{
///
- internal override void FromBgra32(Configuration configuration, ReadOnlySpan source, Span destPixels)
+ public override void FromBgra32(Configuration configuration, ReadOnlySpan source, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(source, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(source, destinationPixels, nameof(destinationPixels));
- source.CopyTo(destPixels);
+ source.CopyTo(destinationPixels);
}
///
- internal override void ToBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgra32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
- sourcePixels.CopyTo(destPixels);
+ sourcePixels.CopyTo(destinationPixels);
}
///
- public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destPixels, PixelConversionModifiers modifiers)
+ public override void FromVector4Destructive(Configuration configuration, Span sourceVectors, Span destinationPixels, PixelConversionModifiers modifiers)
{
- Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale));
+ Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destinationPixels, modifiers.Remove(PixelConversionModifiers.Scale));
}
///
@@ -54,13 +53,13 @@ public override void ToVector4(Configuration configuration, ReadOnlySpan
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale));
}
///
- internal override void ToRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -70,13 +69,13 @@ internal override void ToRgba32(Configuration configuration, ReadOnlySpan
- internal override void FromRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void FromRgba32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -85,13 +84,13 @@ internal override void FromRgba32(Configuration configuration, ReadOnlySpan
- internal override void ToArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -101,13 +100,13 @@ internal override void ToArgb32(Configuration configuration, ReadOnlySpan
- internal override void FromArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void FromArgb32(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref uint sourceRef = ref Unsafe.As(ref MemoryMarshal.GetReference(sourcePixels));
- ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destPixels));
+ ref uint destRef = ref Unsafe.As(ref MemoryMarshal.GetReference(destinationPixels));
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -117,13 +116,13 @@ internal override void FromArgb32(Configuration configuration, ReadOnlySpan
- internal override void ToBgr24(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToBgr24(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgra32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref Bgr24 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref Bgr24 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -135,13 +134,13 @@ internal override void ToBgr24(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToL8(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgra32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref L8 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref L8 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -153,13 +152,13 @@ internal override void ToL8(Configuration configuration, ReadOnlySpan so
}
///
- internal override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToL16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgra32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref L16 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref L16 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -171,13 +170,13 @@ internal override void ToL16(Configuration configuration, ReadOnlySpan s
}
///
- internal override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToLa16(Configuration configuration, ReadOnlySpan sourcePixels, Span destinationPixels)
{
Guard.NotNull(configuration, nameof(configuration));
- Guard.DestinationShouldNotBeTooShort(sourcePixels, destPixels, nameof(destPixels));
+ Guard.DestinationShouldNotBeTooShort(sourcePixels, destinationPixels, nameof(destinationPixels));
ref Bgra32 sourceRef = ref MemoryMarshal.GetReference(sourcePixels);
- ref La16 destRef = ref MemoryMarshal.GetReference(destPixels);
+ ref La16 destRef = ref MemoryMarshal.GetReference(destinationPixels);
for (int i = 0; i < sourcePixels.Length; i++)
{
@@ -189,13 +188,13 @@ internal override void ToLa16(Configuration configuration, ReadOnlySpan
}
///
- internal override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span destPixels)
+ public override void ToLa32(Configuration configuration, ReadOnlySpan sourcePixels, Span