Browse Source

Rename base interface, fix Stucki filter

af/merge-core
James Jackson-South 9 years ago
parent
commit
c7c05c9b1d
  1. 2
      src/ImageSharp/Dithering/Atkinson.cs
  2. 2
      src/ImageSharp/Dithering/Burks.cs
  3. 8
      src/ImageSharp/Dithering/ErrorDiffuser.cs
  4. 2
      src/ImageSharp/Dithering/FloydSteinberg.cs
  5. 4
      src/ImageSharp/Dithering/IErrorDiffuser.cs
  6. 2
      src/ImageSharp/Dithering/JarvisJudiceNinke.cs
  7. 2
      src/ImageSharp/Dithering/Sierra2.cs
  8. 2
      src/ImageSharp/Dithering/Sierra3.cs
  9. 2
      src/ImageSharp/Dithering/SierraLite.cs
  10. 4
      src/ImageSharp/Dithering/Stucki.cs
  11. 2
      src/ImageSharp/Quantizers/IQuantizer.cs
  12. 2
      src/ImageSharp/Quantizers/Octree/Quantizer.cs

2
src/ImageSharp/Dithering/Atkinson.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the Atkinson image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class Atkinson : ErrorDiffusion
public sealed class Atkinson : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

2
src/ImageSharp/Dithering/Burks.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the Burks image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class Burks : ErrorDiffusion
public sealed class Burks : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

8
src/ImageSharp/Dithering/ErrorDiffusion.cs → src/ImageSharp/Dithering/ErrorDiffuser.cs

@ -1,4 +1,4 @@
// <copyright file="ErrorDiffusion.cs" company="James Jackson-South">
// <copyright file="ErrorDiffuser.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
@ -12,7 +12,7 @@ namespace ImageSharp.Dithering
/// <summary>
/// The base class for performing effor diffusion based dithering.
/// </summary>
public abstract class ErrorDiffusion : IErrorDiffusion
public abstract class ErrorDiffuser : IErrorDiffuser
{
/// <summary>
/// The vector to perform division.
@ -35,11 +35,11 @@ namespace ImageSharp.Dithering
private readonly int startingOffset;
/// <summary>
/// Initializes a new instance of the <see cref="ErrorDiffusion"/> class.
/// Initializes a new instance of the <see cref="ErrorDiffuser"/> class.
/// </summary>
/// <param name="matrix">The dithering matrix.</param>
/// <param name="divisor">The divisor.</param>
protected ErrorDiffusion(byte[,] matrix, byte divisor)
protected ErrorDiffuser(byte[,] matrix, byte divisor)
{
Guard.NotNull(matrix, nameof(matrix));
Guard.MustBeGreaterThan(divisor, 0, nameof(divisor));

2
src/ImageSharp/Dithering/FloydSteinberg.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class FloydSteinberg : ErrorDiffusion
public sealed class FloydSteinberg : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

4
src/ImageSharp/Dithering/IErrorDiffusion.cs → src/ImageSharp/Dithering/IErrorDiffuser.cs

@ -1,4 +1,4 @@
// <copyright file="IErrorDiffusion.cs" company="James Jackson-South">
// <copyright file="IErrorDiffuser.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
@ -10,7 +10,7 @@ namespace ImageSharp.Dithering
/// <summary>
/// Encapsulates properties and methods required to perfom diffused error dithering on an image.
/// </summary>
public interface IErrorDiffusion
public interface IErrorDiffuser
{
/// <summary>
/// Gets the dithering matrix

2
src/ImageSharp/Dithering/JarvisJudiceNinke.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the JarvisJudiceNinke image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class JarvisJudiceNinke : ErrorDiffusion
public sealed class JarvisJudiceNinke : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

2
src/ImageSharp/Dithering/Sierra2.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the Sierra2 image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class Sierra2 : ErrorDiffusion
public sealed class Sierra2 : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

2
src/ImageSharp/Dithering/Sierra3.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the Sierra3 image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class Sierra3 : ErrorDiffusion
public sealed class Sierra3 : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

2
src/ImageSharp/Dithering/SierraLite.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the SierraLite image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class SierraLite : ErrorDiffusion
public sealed class SierraLite : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix

4
src/ImageSharp/Dithering/Stucki.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Dithering
/// Applies error diffusion based dithering using the Stucki image dithering algorithm.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public class Stucki : ErrorDiffusion
public sealed class Stucki : ErrorDiffuser
{
/// <summary>
/// The diffusion matrix
@ -25,7 +25,7 @@ namespace ImageSharp.Dithering
/// Initializes a new instance of the <see cref="Stucki"/> class.
/// </summary>
public Stucki()
: base(StuckiMatrix, 4)
: base(StuckiMatrix, 42)
{
}
}

2
src/ImageSharp/Quantizers/IQuantizer.cs

@ -42,7 +42,7 @@ namespace ImageSharp.Quantizers
/// <summary>
/// Gets or sets the dithering algorithm to apply to the output image.
/// </summary>
IErrorDiffusion DitherType { get; set; }
IErrorDiffuser DitherType { get; set; }
}
/// <summary>

2
src/ImageSharp/Quantizers/Octree/Quantizer.cs

@ -48,7 +48,7 @@ namespace ImageSharp.Quantizers
public bool Dither { get; set; } = true;
/// <inheritdoc />
public IErrorDiffusion DitherType { get; set; } = new SierraLite();
public IErrorDiffuser DitherType { get; set; } = new SierraLite();
/// <inheritdoc/>
public virtual QuantizedImage<TColor> Quantize(ImageBase<TColor> image, int maxColors)

Loading…
Cancel
Save