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