Browse Source

Sketch out Bmp implementation

pull/2751/head
James Jackson-South 2 years ago
parent
commit
a971082a0c
  1. 25
      src/ImageSharp/Formats/Bmp/BmpMetadata.cs
  2. 2
      src/ImageSharp/Formats/IFormatFrameMetadata.cs

25
src/ImageSharp/Formats/Bmp/BmpMetadata.cs

@ -1,4 +1,4 @@
// Copyright (c) Six Labors.
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
namespace SixLabors.ImageSharp.Formats.Bmp;
@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp;
/// <summary>
/// Provides Bmp specific metadata information for the image.
/// </summary>
public class BmpMetadata : IDeepCloneable
public class BmpMetadata : IFormatMetadata<BmpMetadata>, IFormatFrameMetadata<BmpMetadata>
{
/// <summary>
/// Initializes a new instance of the <see cref="BmpMetadata"/> class.
@ -36,7 +36,26 @@ public class BmpMetadata : IDeepCloneable
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
/// <inheritdoc/>
public IDeepCloneable DeepClone() => new BmpMetadata(this);
public static BmpMetadata FromFormatConnectingMetadata(FormatConnectingMetadata metadata)
=> throw new NotImplementedException();
/// <inheritdoc/>
public static BmpMetadata FromFormatConnectingFrameMetadata(FormatConnectingFrameMetadata metadata)
=> throw new NotImplementedException();
/// <inheritdoc/>
public FormatConnectingMetadata ToFormatConnectingMetadata()
=> throw new NotImplementedException();
/// <inheritdoc/>
public FormatConnectingFrameMetadata ToFormatConnectingFrameMetadata()
=> throw new NotImplementedException();
/// <inheritdoc/>
public IDeepCloneable DeepClone() => ((IDeepCloneable<BmpMetadata>)this).DeepClone();
/// <inheritdoc/>
BmpMetadata IDeepCloneable<BmpMetadata>.DeepClone() => new(this);
// TODO: Colors used once we support encoding palette bmps.
}

2
src/ImageSharp/Formats/IFormatFrameMetadata.cs

@ -19,7 +19,7 @@ public interface IFormatFrameMetadata : IDeepCloneable
/// An interface that provides metadata for a specific image format frames.
/// </summary>
/// <typeparam name="TSelf">The metadata type implementing this interface.</typeparam>
public interface IFormatFrameMetadata<TSelf> : IFormatMetadata, IDeepCloneable<TSelf>
public interface IFormatFrameMetadata<TSelf> : IFormatFrameMetadata, IDeepCloneable<TSelf>
where TSelf : class, IFormatFrameMetadata, new()
{
/// <summary>

Loading…
Cancel
Save