diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs b/src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs similarity index 88% rename from src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs index dc15cdcd3..ae3b653e1 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Atkinson image dithering algorithm. /// /// - public sealed class Atkinson : ErrorDiffuser + public sealed class AtkinsonDiffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -23,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Atkinson() + public AtkinsonDiffuser() : base(AtkinsonMatrix, 8) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs b/src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs similarity index 82% rename from src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs index 66697aab7..24854da45 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Burks image dithering algorithm. /// /// - public sealed class Burks : ErrorDiffuser + public sealed class BurksDiffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -22,9 +22,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Burks() + public BurksDiffuser() : base(BurksMatrix, 32) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs b/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs similarity index 86% rename from src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs index 5422d83bb..fdff5ec13 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm. /// /// - public sealed class FloydSteinberg : ErrorDiffuser + public sealed class FloydSteinbergDiffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -22,9 +22,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public FloydSteinberg() + public FloydSteinbergDiffuser() : base(FloydSteinbergMatrix, 16) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs b/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs similarity index 86% rename from src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs index 637240a12..e9c129efc 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the JarvisJudiceNinke image dithering algorithm. /// /// - public sealed class JarvisJudiceNinke : ErrorDiffuser + public sealed class JarvisJudiceNinkeDiffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -23,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public JarvisJudiceNinke() + public JarvisJudiceNinkeDiffuser() : base(JarvisJudiceNinkeMatrix, 48) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs similarity index 88% rename from src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs index db37b45af..ab1e58f6d 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Sierra2 image dithering algorithm. /// /// - public sealed class Sierra2 : ErrorDiffuser + public sealed class Sierra2Diffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -22,9 +22,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Sierra2() + public Sierra2Diffuser() : base(Sierra2Matrix, 16) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs similarity index 88% rename from src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs index f812fcdc3..231170b38 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Sierra3 image dithering algorithm. /// /// - public sealed class Sierra3 : ErrorDiffuser + public sealed class Sierra3Diffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -23,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Sierra3() + public Sierra3Diffuser() : base(Sierra3Matrix, 32) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs b/src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs similarity index 87% rename from src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs index 98af7b432..f516902d9 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the SierraLite image dithering algorithm. /// /// - public sealed class SierraLite : ErrorDiffuser + public sealed class SierraLiteDiffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -22,9 +22,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public SierraLite() + public SierraLiteDiffuser() : base(SierraLiteMatrix, 4) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs b/src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs similarity index 82% rename from src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs index 2f94639be..b1adec431 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Stucki image dithering algorithm. /// /// - public sealed class Stucki : ErrorDiffuser + public sealed class StuckiDiffuser : ErrorDiffuser { /// /// The diffusion matrix @@ -23,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Stucki() + public StuckiDiffuser() : base(StuckiMatrix, 42) { } diff --git a/src/ImageSharp/Dithering/Ordered/Bayer.cs b/src/ImageSharp/Dithering/Ordered/BayerDither.cs similarity index 85% rename from src/ImageSharp/Dithering/Ordered/Bayer.cs rename to src/ImageSharp/Dithering/Ordered/BayerDither.cs index cfbdb0888..236992a0c 100644 --- a/src/ImageSharp/Dithering/Ordered/Bayer.cs +++ b/src/ImageSharp/Dithering/Ordered/BayerDither.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering.Ordered /// Applies error diffusion based dithering using the 4x4 Bayer dithering matrix. /// /// - public sealed class Bayer : OrderedDither4x4 + public sealed class BayerDither : OrderedDither4x4 { /// /// The threshold matrix. @@ -25,9 +25,9 @@ namespace SixLabors.ImageSharp.Dithering.Ordered }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Bayer() + public BayerDither() : base(ThresholdMatrix) { } diff --git a/src/ImageSharp/Dithering/Ordered/Ordered.cs b/src/ImageSharp/Dithering/Ordered/OrderedDither.cs similarity index 90% rename from src/ImageSharp/Dithering/Ordered/Ordered.cs rename to src/ImageSharp/Dithering/Ordered/OrderedDither.cs index 4b559c4e1..6a27f4c99 100644 --- a/src/ImageSharp/Dithering/Ordered/Ordered.cs +++ b/src/ImageSharp/Dithering/Ordered/OrderedDither.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Dithering.Ordered /// Applies error diffusion based dithering using the 4x4 ordered dithering matrix. /// /// - public sealed class Ordered : OrderedDither4x4 + public sealed class OrderedDither : OrderedDither4x4 { /// /// The threshold matrix. @@ -25,9 +25,9 @@ namespace SixLabors.ImageSharp.Dithering.Ordered }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Ordered() + public OrderedDither() : base(ThresholdMatrix) { } diff --git a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs b/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs index c65891775..553fc9aef 100644 --- a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs @@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Quantizers public bool Dither { get; set; } = true; /// - public IErrorDiffuser DitherType { get; set; } = new SierraLite(); + public IErrorDiffuser DitherType { get; set; } = new SierraLiteDiffuser(); /// public virtual QuantizedImage Quantize(ImageBase image, int maxColors) diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs index 0bb45253e..e1749e6c1 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs @@ -23,26 +23,26 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization public static readonly TheoryData Ditherers = new TheoryData { - { "Ordered", new Ordered() }, - { "Bayer", new Bayer() } + { "Ordered", new OrderedDither() }, + { "Bayer", new BayerDither() } }; public static readonly TheoryData ErrorDiffusers = new TheoryData { - { "Atkinson", new Atkinson() }, - { "Burks", new Burks() }, - { "FloydSteinberg", new FloydSteinberg() }, - { "JarvisJudiceNinke", new JarvisJudiceNinke() }, - { "Sierra2", new Sierra2() }, - { "Sierra3", new Sierra3() }, - { "SierraLite", new SierraLite() }, - { "Stucki", new Stucki() }, + { "Atkinson", new AtkinsonDiffuser() }, + { "Burks", new BurksDiffuser() }, + { "FloydSteinberg", new FloydSteinbergDiffuser() }, + { "JarvisJudiceNinke", new JarvisJudiceNinkeDiffuser() }, + { "Sierra2", new Sierra2Diffuser() }, + { "Sierra3", new Sierra3Diffuser() }, + { "SierraLite", new SierraLiteDiffuser() }, + { "Stucki", new StuckiDiffuser() }, }; - private static IOrderedDither DefaultDitherer => new Ordered(); + private static IOrderedDither DefaultDitherer => new OrderedDither(); - private static IErrorDiffuser DefaultErrorDiffuser => new Atkinson(); + private static IErrorDiffuser DefaultErrorDiffuser => new AtkinsonDiffuser(); [Theory] [WithFileCollection(nameof(CommonTestImages), nameof(Ditherers), DefaultPixelType)]