Browse Source

fix dithering namespaces

af/merge-core
Scott Williams 9 years ago
parent
commit
921cbab791
  1. 3
      src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs
  2. 3
      src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs
  3. 8
      src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs
  4. 3
      src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs
  5. 3
      src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs
  6. 3
      src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs
  7. 3
      src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs
  8. 3
      src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs
  9. 3
      src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs
  10. 5
      src/ImageSharp/Dithering/Ordered/BayerDither.cs
  11. 5
      src/ImageSharp/Dithering/Ordered/OrderedDither.cs
  12. 8
      src/ImageSharp/Dithering/Ordered/OrderedDitherBase.cs
  13. 1
      tests/ImageSharp.Tests/Processing/Binarization/DitherTests.cs
  14. 3
      tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs

3
src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class AtkinsonDiffuser : ErrorDiffuser
public sealed class AtkinsonDiffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

3
src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class BurksDiffuser : ErrorDiffuser
public sealed class BurksDiffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

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

@ -7,12 +7,12 @@ using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Dithering
namespace SixLabors.ImageSharp.Dithering.Base
{
/// <summary>
/// The base class for performing error diffusion based dithering.
/// </summary>
public abstract class ErrorDiffuser : IErrorDiffuser
public abstract class ErrorDiffuserBase : IErrorDiffuser
{
/// <summary>
/// The vector to perform division.
@ -40,11 +40,11 @@ namespace SixLabors.ImageSharp.Dithering
private readonly Fast2DArray<float> matrix;
/// <summary>
/// Initializes a new instance of the <see cref="ErrorDiffuser"/> class.
/// Initializes a new instance of the <see cref="ErrorDiffuserBase"/> class.
/// </summary>
/// <param name="matrix">The dithering matrix.</param>
/// <param name="divisor">The divisor.</param>
internal ErrorDiffuser(Fast2DArray<float> matrix, byte divisor)
internal ErrorDiffuserBase(Fast2DArray<float> matrix, byte divisor)
{
Guard.NotNull(matrix, nameof(matrix));
Guard.MustBeGreaterThan(divisor, 0, nameof(divisor));

3
src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class FloydSteinbergDiffuser : ErrorDiffuser
public sealed class FloydSteinbergDiffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

3
src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class JarvisJudiceNinkeDiffuser : ErrorDiffuser
public sealed class JarvisJudiceNinkeDiffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

3
src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class Sierra2Diffuser : ErrorDiffuser
public sealed class Sierra2Diffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

3
src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class Sierra3Diffuser : ErrorDiffuser
public sealed class Sierra3Diffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

3
src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class SierraLiteDiffuser : ErrorDiffuser
public sealed class SierraLiteDiffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

3
src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering
@ -9,7 +10,7 @@ namespace SixLabors.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 sealed class StuckiDiffuser : ErrorDiffuser
public sealed class StuckiDiffuser : ErrorDiffuserBase
{
/// <summary>
/// The diffusion matrix

5
src/ImageSharp/Dithering/Ordered/BayerDither.cs

@ -1,15 +1,16 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering.Ordered
namespace SixLabors.ImageSharp.Dithering
{
/// <summary>
/// Applies error diffusion based dithering using the 4x4 Bayer dithering matrix.
/// <see href="http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT"/>
/// </summary>
public sealed class BayerDither : OrderedDither4x4
public sealed class BayerDither : OrderedDitherBase
{
/// <summary>
/// The threshold matrix.

5
src/ImageSharp/Dithering/Ordered/OrderedDither.cs

@ -1,15 +1,16 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering.Base;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Dithering.Ordered
namespace SixLabors.ImageSharp.Dithering
{
/// <summary>
/// Applies error diffusion based dithering using the 4x4 ordered dithering matrix.
/// <see href="https://en.wikipedia.org/wiki/Ordered_dithering"/>
/// </summary>
public sealed class OrderedDither : OrderedDither4x4
public sealed class OrderedDither : OrderedDitherBase
{
/// <summary>
/// The threshold matrix.

8
src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs → src/ImageSharp/Dithering/Ordered/OrderedDitherBase.cs

@ -4,12 +4,12 @@
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Dithering.Ordered
namespace SixLabors.ImageSharp.Dithering.Base
{
/// <summary>
/// The base class for performing ordered ditheroing using a 4x4 matrix.
/// </summary>
public abstract class OrderedDither4x4 : IOrderedDither
public abstract class OrderedDitherBase : IOrderedDither
{
/// <summary>
/// The dithering matrix
@ -17,10 +17,10 @@ namespace SixLabors.ImageSharp.Dithering.Ordered
private Fast2DArray<byte> matrix;
/// <summary>
/// Initializes a new instance of the <see cref="OrderedDither4x4"/> class.
/// Initializes a new instance of the <see cref="OrderedDitherBase"/> class.
/// </summary>
/// <param name="matrix">The thresholding matrix. </param>
internal OrderedDither4x4(Fast2DArray<byte> matrix)
internal OrderedDitherBase(Fast2DArray<byte> matrix)
{
this.matrix = matrix;
}

1
tests/ImageSharp.Tests/Processing/Binarization/DitherTests.cs

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering;
using SixLabors.ImageSharp.Dithering.Ordered;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors;
using Moq;

3
tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs

@ -1,8 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Dithering;
using SixLabors.ImageSharp.Dithering.Ordered;
using SixLabors.ImageSharp.Dithering;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;

Loading…
Cancel
Save