using NodePipeline.Abstractions.Attributes;
using NodePipeline.Abstractions.Interfaces.Nodes;
using NodePipeline.Abstractions.Models;

namespace NodePipeline.Application.Nodes;

public interface IFileImageProvider
{
    ImageBuffer GetNextImage();
}

public class FileImageSource2Node : INode
{
    private readonly IFileImageProvider _imageProvider;

    public FileImageSource2Node(IFileImageProvider imageProvider)
    {
        _imageProvider = imageProvider;
    }

    [NodeField(FieldDirection.Output)] public NodeField<ImageBuffer> Output { get; set; } = null!;

    public void Execute()
    {
        Output.Value = _imageProvider.GetNextImage();
    }
}