Skip to content

Commit

Permalink
v0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
saucecontrol committed May 11, 2021
1 parent a1d6ef8 commit cf81241
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 255 deletions.
2 changes: 1 addition & 1 deletion src/MagicScaler/Core/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public enum ChromaSubsampleMode
}

/// <summary>Defines the modes that control disposal of image frames in an animation.</summary>
public enum FrameDisposalMethod
internal enum FrameDisposalMethod
{
/// <summary>Disposal is not defined. This has the same behavior as <see cref="Preserve" />.</summary>
Undefined = 0,
Expand Down
19 changes: 12 additions & 7 deletions src/MagicScaler/Core/Interfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public interface IImageContainer
}

/// <summary>A container defining global metadata for a sequence of <see cref="IAnimationFrame" /> instances.</summary>
public interface IAnimationContainer
internal interface IAnimationContainer
{
/// <summary>The width of the animation's logical screen.</summary>
public int ScreenWidth { get; }
Expand All @@ -104,36 +104,41 @@ public interface IAnimationContainer
}

/// <summary>Defines metadata for a single frame within an animated image sequence.</summary>
public interface IAnimationFrame
internal interface IAnimationFrame
{
/// <summary>The origin point (offset) of the frame's content, relative to the logical screen size.</summary>
public Point Origin { get; }

/// <summary>The size of the frame's content to be rendered to the logical screen.</summary>
public Size Size { get; }

/// <summary>The amount of time, in seconds, the frame should be displayed.</summary>
/// <remarks>For animated GIF output, the denominator will be normalized to <c>100</c>.</remarks>
public Rational Duration { get; }

/// <summary>The disposition of the frame.</summary>
public FrameDisposalMethod Disposal { get; }

/// <summary>True to indicate the frame contains transparent pixels, otherwise false.</summary>
public bool HasAlpha { get; }
}

/// <summary>A <a href="https://en.wikipedia.org/wiki/Rational_number">rational number</a>, as defined by an integer numerator and denominator.</summary>
public readonly struct Rational : IEquatable<Rational>
internal readonly struct Rational : IEquatable<Rational>
{
/// <summary>The numerator of the rational number.</summary>
public readonly int Numerator;
/// <summary>The denominator of the rational number.</summary>
public readonly int Denominator;

/// <summary>Constructs a new <see cref="Rational" /> with the specified <see cref="Numerator" /> and <see cref="Denominator" />.</summary>
/// <param name="num">The numerator.</param>
/// <param name="den">The denominator.</param>
public Rational(int num, int den) => (Numerator, Denominator) = (num, den);
/// <param name="numerator">The numerator.</param>
/// <param name="denominator">The denominator.</param>
public Rational(int numerator, int denominator) => (Numerator, Denominator) = (numerator, denominator);

/// <inheritdoc />
public bool Equals(Rational other) => Numerator == other.Numerator && Denominator == other.Denominator;

/// <inheritdoc />
public override bool Equals(object? obj) => obj is Rational other && Equals(other);
/// <inheritdoc />
Expand All @@ -145,6 +150,6 @@ public interface IAnimationFrame
public static bool operator ==(Rational left, Rational right) => left.Equals(right);

/// <inheritdoc cref="double.op_Equality" />
public static bool operator !=(Rational left, Rational right) => !(left==right);
public static bool operator !=(Rational left, Rational right) => !(left == right);
}
}

This file was deleted.

Loading

0 comments on commit cf81241

Please sign in to comment.