FFMpegCore/FFMpegCore/FFMpeg/Arguments/ScaleArgument.cs
Malte Rosenbjerg bc533df330 Fix tests
Former-commit-id: f50ab577ae
2020-05-08 13:01:59 +02:00

26 lines
732 B
C#

using System.Drawing;
using FFMpegCore.FFMPEG.Enums;
namespace FFMpegCore.FFMPEG.Argument
{
/// <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;
}
}