diff --git a/src/ImageSharp/Advanced/IConfigurableExtensions.cs b/src/ImageSharp/Advanced/IConfigurableExtensions.cs deleted file mode 100644 index e4257ccc2..000000000 --- a/src/ImageSharp/Advanced/IConfigurableExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -namespace SixLabors.ImageSharp.Advanced -{ - /// - /// Extension methods over - /// - internal static partial class IConfigurableExtensions - { - /// - /// Gets the configuration. - /// - /// The configurable - /// Returns the configuration. - public static Configuration GetConfiguration(this IConfigurable self) - => self?.Configuration ?? Configuration.Default; - } -} \ No newline at end of file diff --git a/src/ImageSharp/Advanced/ImageExtensions.cs b/src/ImageSharp/Advanced/ImageExtensions.cs index ea7bb5349..727c73e83 100644 --- a/src/ImageSharp/Advanced/ImageExtensions.cs +++ b/src/ImageSharp/Advanced/ImageExtensions.cs @@ -38,6 +38,16 @@ namespace SixLabors.ImageSharp.Advanced where TPixel : struct, IPixel => GetSpan(source, row); + /// + /// Gets the configuration. + /// + /// The Pixel format. + /// The source image + /// Returns the configuration. + public static Configuration GetConfiguration(this Image source) + where TPixel : struct, IPixel + => GetConfiguration(source); + /// /// Gets the span. /// @@ -73,5 +83,13 @@ namespace SixLabors.ImageSharp.Advanced private static Span GetSpan(Buffer2D source, int row) where TPixel : struct, IPixel => source.Span.Slice(row * source.Width, source.Width); + + /// + /// Gets the configuration. + /// + /// The source image + /// Returns the bounds of the image + private static Configuration GetConfiguration(IConfigurable source) + => source?.Configuration ?? Configuration.Default; } }