mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-15 18:45:44 +00:00
26 lines
719 B
C#
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;
|
|
}
|
|
}
|