20 lines
464 B
C#
20 lines
464 B
C#
using NodePipeline.Application.Nodes;
|
|
|
|
namespace NodePipeline.Application;
|
|
|
|
public class FileImageProvider : IFileImageProvider
|
|
{
|
|
private readonly Queue<string> _queue = [];
|
|
|
|
public ImageBuffer GetNextImage()
|
|
{
|
|
return _queue.TryDequeue(out var filePath)
|
|
? ImageLoader.Load(filePath)
|
|
: throw new Exception("Nothing to read");
|
|
}
|
|
|
|
public void AddNext(string filePath)
|
|
{
|
|
_queue.Enqueue(filePath);
|
|
}
|
|
} |