namespace FileFlows.ImageNodes.Images;
///
/// Flow element that rotates an image
///
public class ImageRotate: ImageNode
{
///
public override int Inputs => 1;
///
public override int Outputs => 1;
///
public override FlowElementType Type => FlowElementType.Process;
///
public override string Icon => "fas fa-undo";
///
public override string HelpUrl => "https://fileflows.com/docs/plugins/image-nodes/image-rotate";
///
/// Gets or sets angle to rotate the image
///
[Select(nameof(AngleOptions), 2)]
public int Angle { get; set; }
private static List? _AngleOptions;
///
/// Gest the Angle Options
///
public static List AngleOptions
{
get
{
if (_AngleOptions == null)
{
_AngleOptions = new List
{
new () { Value = 90, Label = "90"},
new () { Value = 180, Label = "180"},
new () { Value = 270, Label = "270"}
};
}
return _AngleOptions;
}
}
///
protected override Result PerformAction(NodeParameters args, string localFile, string destination)
=> args.ImageHelper.Rotate(localFile, destination, Angle, GetImageTypeFromFormat(), Quality);
}