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