Browse Source

remove IFrameMetaData and frame properties from ImageMataData

pull/343/head
Scott Williams 9 years ago
parent
commit
4a0f95635e
  1. 2
      src/ImageSharp/Formats/Gif/GifEncoderCore.cs
  2. 29
      src/ImageSharp/MetaData/IFrameMetaData.cs
  3. 15
      src/ImageSharp/MetaData/ImageFrameMetaData.cs
  4. 10
      src/ImageSharp/MetaData/ImageMetaData.cs

2
src/ImageSharp/Formats/Gif/GifEncoderCore.cs

@ -287,7 +287,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <param name="metaData">The metadata of the image or frame.</param>
/// <param name="writer">The stream to write to.</param>
/// <param name="transparencyIndex">The index of the color in the color palette to make transparent.</param>
private void WriteGraphicalControlExtension(IFrameMetaData metaData, EndianBinaryWriter writer, int transparencyIndex)
private void WriteGraphicalControlExtension(ImageFrameMetaData metaData, EndianBinaryWriter writer, int transparencyIndex)
{
var extension = new GifGraphicsControlExtension
{

29
src/ImageSharp/MetaData/IFrameMetaData.cs

@ -1,29 +0,0 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Gif;
namespace SixLabors.ImageSharp.MetaData
{
/// <summary>
/// Encapsulates the metadata of an image frame.
/// </summary>
internal interface IFrameMetaData
{
/// <summary>
/// Gets or sets the frame delay for animated images.
/// If not 0, when utilized in Gif animation, this field specifies the number of hundredths (1/100) of a second to
/// wait before continuing with the processing of the Data Stream.
/// The clock starts ticking immediately after the graphic is rendered.
/// </summary>
int FrameDelay { get; set; }
/// <summary>
/// Gets or sets the disposal method for animated images.
/// Primarily used in Gif animation, this field indicates the way in which the graphic is to
/// be treated after being displayed.
/// </summary>
DisposalMethod DisposalMethod { get; set; }
}
}

15
src/ImageSharp/MetaData/ImageFrameMetaData.cs

@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.MetaData
/// <summary>
/// Encapsulates the metadata of an image frame.
/// </summary>
public sealed class ImageFrameMetaData : IFrameMetaData
public sealed class ImageFrameMetaData
{
/// <summary>
/// Initializes a new instance of the <see cref="ImageFrameMetaData"/> class.
@ -33,10 +33,19 @@ namespace SixLabors.ImageSharp.MetaData
this.DisposalMethod = other.DisposalMethod;
}
/// <inheritdoc/>
/// <summary>
/// Gets or sets the frame delay for animated images.
/// If not 0, when utilized in Gif animation, this field specifies the number of hundredths (1/100) of a second to
/// wait before continuing with the processing of the Data Stream.
/// The clock starts ticking immediately after the graphic is rendered.
/// </summary>
public int FrameDelay { get; set; }
/// <inheritdoc/>
/// <summary>
/// Gets or sets the disposal method for animated images.
/// Primarily used in Gif animation, this field indicates the way in which the graphic is to
/// be treated after being displayed.
/// </summary>
public DisposalMethod DisposalMethod { get; set; }
/// <summary>

10
src/ImageSharp/MetaData/ImageMetaData.cs

@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.MetaData
/// <summary>
/// Encapsulates the metadata of an image.
/// </summary>
public sealed class ImageMetaData : IFrameMetaData
public sealed class ImageMetaData
{
/// <summary>
/// The default horizontal resolution value (dots per inch) in x direction.
@ -51,8 +51,6 @@ namespace SixLabors.ImageSharp.MetaData
this.HorizontalResolution = other.HorizontalResolution;
this.VerticalResolution = other.VerticalResolution;
this.FrameDelay = other.FrameDelay;
this.DisposalMethod = other.DisposalMethod;
this.RepeatCount = other.RepeatCount;
foreach (ImageProperty property in other.Properties)
@ -115,12 +113,6 @@ namespace SixLabors.ImageSharp.MetaData
/// </summary>
public IccProfile IccProfile { get; set; }
/// <inheritdoc/>
public int FrameDelay { get; set; }
/// <inheritdoc/>
public DisposalMethod DisposalMethod { get; set; }
/// <summary>
/// Gets the list of properties for storing meta information about this image.
/// </summary>

Loading…
Cancel
Save