diff --git a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs index d362405126..d810296d6b 100644 --- a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs +++ b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs @@ -29,7 +29,7 @@ namespace SixLabors.ImageSharp.Advanced /// 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. @@ -37,14 +37,14 @@ namespace SixLabors.ImageSharp.Advanced /// The source image. /// Returns the configuration. public static Configuration GetConfiguration(this ImageFrame source) - => GetConfiguration((IConfigurable)source); + => GetConfiguration((IConfigurationProvider)source); /// /// Gets the configuration . /// /// The source image /// Returns the bounds of the image - private static Configuration GetConfiguration(IConfigurable source) + private static Configuration GetConfiguration(IConfigurationProvider source) => source?.Configuration ?? Configuration.Default; /// @@ -174,7 +174,7 @@ namespace SixLabors.ImageSharp.Advanced /// /// The source image. /// Returns the configuration. - internal static MemoryAllocator GetMemoryAllocator(this IConfigurable source) + internal static MemoryAllocator GetMemoryAllocator(this IConfigurationProvider source) => GetConfiguration(source).MemoryAllocator; /// diff --git a/src/ImageSharp/Advanced/IConfigurable.cs b/src/ImageSharp/Advanced/IConfigurationProvider.cs similarity index 74% rename from src/ImageSharp/Advanced/IConfigurable.cs rename to src/ImageSharp/Advanced/IConfigurationProvider.cs index d36cde0ed8..d3e3a91aa3 100644 --- a/src/ImageSharp/Advanced/IConfigurable.cs +++ b/src/ImageSharp/Advanced/IConfigurationProvider.cs @@ -4,9 +4,9 @@ namespace SixLabors.ImageSharp.Advanced { /// - /// Encapsulates the properties for configuration. + /// Defines the contract for objects that can provide access to configuration. /// - internal interface IConfigurable + internal interface IConfigurationProvider { /// /// Gets the configuration which allows altering default behaviour or extending the library. diff --git a/src/ImageSharp/Image.cs b/src/ImageSharp/Image.cs index c347017e00..574178d39e 100644 --- a/src/ImageSharp/Image.cs +++ b/src/ImageSharp/Image.cs @@ -16,7 +16,7 @@ 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; @@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp public ImageFrameCollection Frames => this.NonGenericFrameCollection; /// - Configuration IConfigurable.Configuration => this.configuration; + Configuration IConfigurationProvider.Configuration => this.configuration; /// public void Dispose() diff --git a/src/ImageSharp/ImageFrame.cs b/src/ImageSharp/ImageFrame.cs index 53f5cd74b3..235840e77b 100644 --- a/src/ImageSharp/ImageFrame.cs +++ b/src/ImageSharp/ImageFrame.cs @@ -13,7 +13,7 @@ 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 : IConfigurable, IDisposable + public abstract partial class ImageFrame : IConfigurationProvider, IDisposable { private readonly Configuration configuration; @@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp public ImageFrameMetadata Metadata { get; } /// - Configuration IConfigurable.Configuration => this.configuration; + Configuration IConfigurationProvider.Configuration => this.configuration; /// /// Gets the size of the frame.