|
|
|
@ -19,17 +19,18 @@ namespace SixLabors.ImageSharp |
|
|
|
public abstract partial class Image : IImage, IConfigurable |
|
|
|
{ |
|
|
|
private Size size; |
|
|
|
private readonly Configuration configuration; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="Image"/> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">The <see cref="Configuration"/>.</param>
|
|
|
|
/// <param name="configuration">The <see cref="IConfigurable.Configuration"/>.</param>
|
|
|
|
/// <param name="pixelType">The <see cref="PixelTypeInfo"/>.</param>
|
|
|
|
/// <param name="metadata">The <see cref="ImageMetadata"/>.</param>
|
|
|
|
/// <param name="size">The <see cref="size"/>.</param>
|
|
|
|
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 +49,6 @@ namespace SixLabors.ImageSharp |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the <see cref="Configuration"/>.
|
|
|
|
/// </summary>
|
|
|
|
protected Configuration Configuration { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the <see cref="ImageFrameCollection"/> implementing the public <see cref="Frames"/> property.
|
|
|
|
/// </summary>
|
|
|
|
@ -75,10 +71,8 @@ namespace SixLabors.ImageSharp |
|
|
|
/// </summary>
|
|
|
|
public ImageFrameCollection Frames => this.NonGenericFrameCollection; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the pixel buffer.
|
|
|
|
/// </summary>
|
|
|
|
Configuration IConfigurable.Configuration => this.Configuration; |
|
|
|
/// <inheritdoc/>
|
|
|
|
Configuration IConfigurable.Configuration => this.configuration; |
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public void Dispose() |
|
|
|
@ -108,7 +102,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <typeparam name="TPixel2">The pixel format.</typeparam>
|
|
|
|
/// <returns>The <see cref="Image{TPixel2}"/></returns>
|
|
|
|
public Image<TPixel2> CloneAs<TPixel2>() |
|
|
|
where TPixel2 : struct, IPixel<TPixel2> => this.CloneAs<TPixel2>(this.Configuration); |
|
|
|
where TPixel2 : struct, IPixel<TPixel2> => this.CloneAs<TPixel2>(this.GetConfiguration()); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns a copy of the image in the given pixel format.
|
|
|
|
|