jellyfin/MediaBrowser.Model/Drawing/ImageDimensions.cs

46 lines
1.0 KiB
C#
Raw Normal View History

2020-02-03 17:49:27 -07:00
#pragma warning disable CS1591
using System.Globalization;
2018-12-27 16:27:57 -07:00
namespace MediaBrowser.Model.Drawing
{
/// <summary>
2020-02-03 17:49:27 -07:00
/// Struct ImageDimensions.
2018-12-27 16:27:57 -07:00
/// </summary>
public readonly struct ImageDimensions
2018-12-27 16:27:57 -07:00
{
public ImageDimensions(int width, int height)
{
Width = width;
Height = height;
}
2018-12-27 16:27:57 -07:00
/// <summary>
/// Gets the height.
2018-12-27 16:27:57 -07:00
/// </summary>
/// <value>The height.</value>
public int Height { get; }
2018-12-27 16:27:57 -07:00
/// <summary>
/// Gets the width.
2018-12-27 16:27:57 -07:00
/// </summary>
/// <value>The width.</value>
public int Width { get; }
2018-12-27 16:27:57 -07:00
public bool Equals(ImageDimensions size)
2018-12-27 16:27:57 -07:00
{
return Width.Equals(size.Width) && Height.Equals(size.Height);
}
/// <inheritdoc />
2018-12-27 16:27:57 -07:00
public override string ToString()
{
return string.Format(
CultureInfo.InvariantCulture,
"{0}-{1}",
Width,
Height);
2018-12-27 16:27:57 -07:00
}
}
}