using FrameProcessor.Domain;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Dithering;

namespace FrameProcessor.ImagePipeline;

/// <summary>
/// Maps each <see cref="DitherAlgorithm"/> to the corresponding ImageSharp <see cref="IDither"/>
/// instance from <see cref="KnownDitherings"/>.
/// </summary>
public static class DitheringRegistry
{
    public static IReadOnlyDictionary<DitherAlgorithm, IDither> All { get; } =
        new Dictionary<DitherAlgorithm, IDither>
        {
            [DitherAlgorithm.FloydSteinberg] = KnownDitherings.FloydSteinberg,
            [DitherAlgorithm.Atkinson] = KnownDitherings.Atkinson,
            [DitherAlgorithm.Stucki] = KnownDitherings.Stucki,
            [DitherAlgorithm.Jarvis] = KnownDitherings.JarvisJudiceNinke,
        };
}
