mirror of https://github.com/SixLabors/ImageSharp
6 changed files with 62 additions and 1 deletions
@ -0,0 +1,40 @@ |
|||
// Copyright (c) Six Labors and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.Formats; |
|||
using SixLabors.ImageSharp.Metadata; |
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
|
|||
namespace SixLabors.ImageSharp |
|||
{ |
|||
internal interface IImageVisitor |
|||
{ |
|||
void Visit<TPixel>(Image<TPixel> image) |
|||
where TPixel : struct, IPixel<TPixel>; |
|||
} |
|||
|
|||
public abstract partial class Image : IImage |
|||
{ |
|||
/// <inheritdoc/>
|
|||
public PixelTypeInfo PixelType { get; } |
|||
|
|||
/// <inheritdoc />
|
|||
public abstract int Width { get; } |
|||
|
|||
/// <inheritdoc />
|
|||
public abstract int Height { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public ImageMetadata Metadata { get; } |
|||
|
|||
protected Image(PixelTypeInfo pixelType, ImageMetadata metadata) |
|||
{ |
|||
this.PixelType = pixelType; |
|||
this.Metadata = metadata ?? new ImageMetadata(); |
|||
} |
|||
|
|||
public abstract void Dispose(); |
|||
|
|||
internal abstract void ApplyVisitor(IImageVisitor visitor); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue