From 46cf55094c8a030c3590f27dc782c4e6a9c6926f Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Wed, 6 Sep 2017 23:03:06 +0200 Subject: [PATCH] Move extension method back to Image to keep it public. --- .../Advanced/IConfigurableExtensions.cs | 19 ------------------- src/ImageSharp/Advanced/ImageExtensions.cs | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 src/ImageSharp/Advanced/IConfigurableExtensions.cs 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; } }