Skip to content

Commit a971082

Browse files
Sketch out Bmp implementation
1 parent eda85d2 commit a971082

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

src/ImageSharp/Formats/Bmp/BmpMetadata.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// Copyright (c) Six Labors.
1+
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

44
namespace SixLabors.ImageSharp.Formats.Bmp;
55

66
/// <summary>
77
/// Provides Bmp specific metadata information for the image.
88
/// </summary>
9-
public class BmpMetadata : IDeepCloneable
9+
public class BmpMetadata : IFormatMetadata<BmpMetadata>, IFormatFrameMetadata<BmpMetadata>
1010
{
1111
/// <summary>
1212
/// Initializes a new instance of the <see cref="BmpMetadata"/> class.
@@ -36,7 +36,26 @@ private BmpMetadata(BmpMetadata other)
3636
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
3737

3838
/// <inheritdoc/>
39-
public IDeepCloneable DeepClone() => new BmpMetadata(this);
39+
public static BmpMetadata FromFormatConnectingMetadata(FormatConnectingMetadata metadata)
40+
=> throw new NotImplementedException();
41+
42+
/// <inheritdoc/>
43+
public static BmpMetadata FromFormatConnectingFrameMetadata(FormatConnectingFrameMetadata metadata)
44+
=> throw new NotImplementedException();
45+
46+
/// <inheritdoc/>
47+
public FormatConnectingMetadata ToFormatConnectingMetadata()
48+
=> throw new NotImplementedException();
49+
50+
/// <inheritdoc/>
51+
public FormatConnectingFrameMetadata ToFormatConnectingFrameMetadata()
52+
=> throw new NotImplementedException();
53+
54+
/// <inheritdoc/>
55+
public IDeepCloneable DeepClone() => ((IDeepCloneable<BmpMetadata>)this).DeepClone();
56+
57+
/// <inheritdoc/>
58+
BmpMetadata IDeepCloneable<BmpMetadata>.DeepClone() => new(this);
4059

4160
// TODO: Colors used once we support encoding palette bmps.
4261
}

src/ImageSharp/Formats/IFormatFrameMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IFormatFrameMetadata : IDeepCloneable
1919
/// An interface that provides metadata for a specific image format frames.
2020
/// </summary>
2121
/// <typeparam name="TSelf">The metadata type implementing this interface.</typeparam>
22-
public interface IFormatFrameMetadata<TSelf> : IFormatMetadata, IDeepCloneable<TSelf>
22+
public interface IFormatFrameMetadata<TSelf> : IFormatFrameMetadata, IDeepCloneable<TSelf>
2323
where TSelf : class, IFormatFrameMetadata, new()
2424
{
2525
/// <summary>

0 commit comments

Comments
 (0)