FFMpegCore/FFMpegCore/FFMpeg/Arguments/CropArgument.cs
Malte Rosenbjerg 5d654af5f8 dotnet format
2024-12-04 21:51:43 +02:00

22 lines
615 B
C#

using System.Drawing;
namespace FFMpegCore.Arguments
{
public class CropArgument : IArgument
{
public readonly Size? Size;
public readonly int Top;
public readonly int Left;
public CropArgument(Size? size, int top, int left)
{
Size = size;
Top = top;
Left = left;
}
public CropArgument(int width, int height, int top, int left) : this(new Size(width, height), top, left) { }
public string Text => Size == null ? string.Empty : $"-vf crop={Size.Value.Width}:{Size.Value.Height}:{Left}:{Top}";
}
}