FFMpegCore/FFMpegCore/FFMpeg/Arguments/ScaleArgument.cs
Malte Rosenbjerg c3b5cd997e Cleanup
Former-commit-id: 72366d573a
2020-05-09 17:53:03 +02:00

26 lines
719 B
C#

using System.Drawing;
using FFMpegCore.Enums;
namespace FFMpegCore.Arguments
{
/// <summary>
/// Represents scale parameter
/// </summary>
public class ScaleArgument : IArgument
{
public readonly Size? Size;
public ScaleArgument(Size? size)
{
Size = size;
}
public ScaleArgument(int width, int height) : this(new Size(width, height)) { }
public ScaleArgument(VideoSize videosize)
{
Size = videosize == VideoSize.Original ? new Size(-1, -1) : new Size(-1, (int)videosize);
}
public virtual string Text => Size.HasValue ? $"-vf scale={Size.Value.Width}:{Size.Value.Height}" : string.Empty;
}
}