jellyfin-server/MediaBrowser.Model/Drawing/ImageDimensions.cs

47 lines
1.0 KiB
C#
Raw Normal View History

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