2020-02-04 00:49:27 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
#pragma warning disable SA1600
|
|
|
|
|
2020-01-21 19:26:30 +00:00
|
|
|
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>
|
2020-01-21 19:26:30 +00:00
|
|
|
public readonly struct ImageDimensions
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
2020-01-21 19:26:30 +00:00
|
|
|
public ImageDimensions(int width, int height)
|
|
|
|
{
|
|
|
|
Width = width;
|
|
|
|
Height = height;
|
|
|
|
}
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
2020-01-21 19:26:30 +00:00
|
|
|
/// Gets the height.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The height.</value>
|
2020-01-21 19:26:30 +00:00
|
|
|
public int Height { get; }
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-01-21 19:26:30 +00:00
|
|
|
/// Gets the width.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The width.</value>
|
2020-01-21 19:26:30 +00:00
|
|
|
public int Width { get; }
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2019-01-26 12:16:47 +00:00
|
|
|
public bool Equals(ImageDimensions size)
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
|
|
|
return Width.Equals(size.Width) && Height.Equals(size.Height);
|
|
|
|
}
|
|
|
|
|
2020-01-21 19:26:30 +00:00
|
|
|
/// <inheritdoc />
|
2018-12-27 23:27:57 +00:00
|
|
|
public override string ToString()
|
|
|
|
{
|
2020-01-21 19:26:30 +00:00
|
|
|
return string.Format(
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
"{0}-{1}",
|
|
|
|
Width,
|
|
|
|
Height);
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|
2019-01-13 19:31:15 +00:00
|
|
|
}
|