Browse Source

Rename IConfigurable

af/octree-no-pixelmap
James Jackson-South 6 years ago
parent
commit
158d610b51
  1. 8
      src/ImageSharp/Advanced/AdvancedImageExtensions.cs
  2. 4
      src/ImageSharp/Advanced/IConfigurationProvider.cs
  3. 4
      src/ImageSharp/Image.cs
  4. 4
      src/ImageSharp/ImageFrame.cs

8
src/ImageSharp/Advanced/AdvancedImageExtensions.cs

@ -29,7 +29,7 @@ namespace SixLabors.ImageSharp.Advanced
/// <param name="source">The source image.</param> /// <param name="source">The source image.</param>
/// <returns>Returns the configuration.</returns> /// <returns>Returns the configuration.</returns>
public static Configuration GetConfiguration(this Image source) public static Configuration GetConfiguration(this Image source)
=> GetConfiguration((IConfigurable)source); => GetConfiguration((IConfigurationProvider)source);
/// <summary> /// <summary>
/// Gets the configuration for the image frame. /// Gets the configuration for the image frame.
@ -37,14 +37,14 @@ namespace SixLabors.ImageSharp.Advanced
/// <param name="source">The source image.</param> /// <param name="source">The source image.</param>
/// <returns>Returns the configuration.</returns> /// <returns>Returns the configuration.</returns>
public static Configuration GetConfiguration(this ImageFrame source) public static Configuration GetConfiguration(this ImageFrame source)
=> GetConfiguration((IConfigurable)source); => GetConfiguration((IConfigurationProvider)source);
/// <summary> /// <summary>
/// Gets the configuration . /// Gets the configuration .
/// </summary> /// </summary>
/// <param name="source">The source image</param> /// <param name="source">The source image</param>
/// <returns>Returns the bounds of the image</returns> /// <returns>Returns the bounds of the image</returns>
private static Configuration GetConfiguration(IConfigurable source) private static Configuration GetConfiguration(IConfigurationProvider source)
=> source?.Configuration ?? Configuration.Default; => source?.Configuration ?? Configuration.Default;
/// <summary> /// <summary>
@ -174,7 +174,7 @@ namespace SixLabors.ImageSharp.Advanced
/// </summary> /// </summary>
/// <param name="source">The source image.</param> /// <param name="source">The source image.</param>
/// <returns>Returns the configuration.</returns> /// <returns>Returns the configuration.</returns>
internal static MemoryAllocator GetMemoryAllocator(this IConfigurable source) internal static MemoryAllocator GetMemoryAllocator(this IConfigurationProvider source)
=> GetConfiguration(source).MemoryAllocator; => GetConfiguration(source).MemoryAllocator;
/// <summary> /// <summary>

4
src/ImageSharp/Advanced/IConfigurable.cs → src/ImageSharp/Advanced/IConfigurationProvider.cs

@ -4,9 +4,9 @@
namespace SixLabors.ImageSharp.Advanced namespace SixLabors.ImageSharp.Advanced
{ {
/// <summary> /// <summary>
/// Encapsulates the properties for configuration. /// Defines the contract for objects that can provide access to configuration.
/// </summary> /// </summary>
internal interface IConfigurable internal interface IConfigurationProvider
{ {
/// <summary> /// <summary>
/// Gets the configuration which allows altering default behaviour or extending the library. /// Gets the configuration which allows altering default behaviour or extending the library.

4
src/ImageSharp/Image.cs

@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp
/// For the non-generic <see cref="Image"/> type, the pixel type is only known at runtime. /// For the non-generic <see cref="Image"/> type, the pixel type is only known at runtime.
/// <see cref="Image"/> is always implemented by a pixel-specific <see cref="Image{TPixel}"/> instance. /// <see cref="Image"/> is always implemented by a pixel-specific <see cref="Image{TPixel}"/> instance.
/// </summary> /// </summary>
public abstract partial class Image : IImage, IConfigurable public abstract partial class Image : IImage, IConfigurationProvider
{ {
private Size size; private Size size;
private readonly Configuration configuration; private readonly Configuration configuration;
@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp
public ImageFrameCollection Frames => this.NonGenericFrameCollection; public ImageFrameCollection Frames => this.NonGenericFrameCollection;
/// <inheritdoc/> /// <inheritdoc/>
Configuration IConfigurable.Configuration => this.configuration; Configuration IConfigurationProvider.Configuration => this.configuration;
/// <inheritdoc /> /// <inheritdoc />
public void Dispose() public void Dispose()

4
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 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. /// In all other cases it is the only frame of the image.
/// </summary> /// </summary>
public abstract partial class ImageFrame : IConfigurable, IDisposable public abstract partial class ImageFrame : IConfigurationProvider, IDisposable
{ {
private readonly Configuration configuration; private readonly Configuration configuration;
@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp
public ImageFrameMetadata Metadata { get; } public ImageFrameMetadata Metadata { get; }
/// <inheritdoc/> /// <inheritdoc/>
Configuration IConfigurable.Configuration => this.configuration; Configuration IConfigurationProvider.Configuration => this.configuration;
/// <summary> /// <summary>
/// Gets the size of the frame. /// Gets the size of the frame.

Loading…
Cancel
Save