diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs
index d3d1efe7fd..0125d2703b 100644
--- a/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs
+++ b/src/ImageSharp/Formats/Jpeg/GolangPort/OrigJpegDecoderCore.cs
@@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.IO;
-
using SixLabors.ImageSharp.Formats.Jpeg.Common;
using SixLabors.ImageSharp.Formats.Jpeg.Common.Decoder;
using SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder;
@@ -11,6 +10,7 @@ using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
using SixLabors.Primitives;
namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort
diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs
index 54e2833b11..a600658b02 100644
--- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs
+++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs
@@ -12,6 +12,7 @@ using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
{
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs
index f72753cc27..7cd2d002d7 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs
+++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
{
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs
index e247527a6e..8a7b1f7d7e 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs
+++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs
@@ -1,10 +1,12 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
+
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
+using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
{
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs
index 7ffe9d48fe..3c2b23f37f 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs
+++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs
@@ -4,6 +4,7 @@
using System;
using System.Globalization;
using System.Text;
+using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
{
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs
index 7f4123225e..a4cfc7e13e 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs
+++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
+using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
{
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/LongRational.cs b/src/ImageSharp/Primitives/LongRational.cs
similarity index 99%
rename from src/ImageSharp/MetaData/Profiles/Exif/LongRational.cs
rename to src/ImageSharp/Primitives/LongRational.cs
index f9c16d57d4..641a1e5e53 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/LongRational.cs
+++ b/src/ImageSharp/Primitives/LongRational.cs
@@ -5,7 +5,7 @@ using System;
using System.Globalization;
using System.Text;
-namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
+namespace SixLabors.ImageSharp.Primitives
{
///
/// Represents a number that can be expressed as a fraction
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/Rational.cs b/src/ImageSharp/Primitives/Rational.cs
similarity index 99%
rename from src/ImageSharp/MetaData/Profiles/Exif/Rational.cs
rename to src/ImageSharp/Primitives/Rational.cs
index 0f47870d24..6678eb9540 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/Rational.cs
+++ b/src/ImageSharp/Primitives/Rational.cs
@@ -4,7 +4,7 @@
using System;
using System.Globalization;
-namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
+namespace SixLabors.ImageSharp.Primitives
{
///
/// Represents a number that can be expressed as a fraction.
diff --git a/src/ImageSharp/MetaData/Profiles/Exif/SignedRational.cs b/src/ImageSharp/Primitives/SignedRational.cs
similarity index 99%
rename from src/ImageSharp/MetaData/Profiles/Exif/SignedRational.cs
rename to src/ImageSharp/Primitives/SignedRational.cs
index 17f1b568b3..c2a7b3e234 100644
--- a/src/ImageSharp/MetaData/Profiles/Exif/SignedRational.cs
+++ b/src/ImageSharp/Primitives/SignedRational.cs
@@ -4,7 +4,7 @@
using System;
using System.Globalization;
-namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
+namespace SixLabors.ImageSharp.Primitives
{
///
/// Represents a number that can be expressed as a fraction.
diff --git a/src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs b/src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs
index 7ae8ec01ef..adb678ee49 100644
--- a/src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs
+++ b/src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Dithering
/// The .
public static IImageProcessingContext Diffuse(this IImageProcessingContext source)
where TPixel : struct, IPixel
- => Diffuse(source, DiffuseMode.FloydSteinberg, .5F);
+ => Diffuse(source, KnownDiffusers.FloydSteinberg, .5F);
///
/// Dithers the image reducing it to a web-safe palette using error diffusion.
@@ -32,7 +32,7 @@ namespace SixLabors.ImageSharp.Processing.Dithering
/// The .
public static IImageProcessingContext Diffuse(this IImageProcessingContext source, float threshold)
where TPixel : struct, IPixel
- => Diffuse(source, DiffuseMode.FloydSteinberg, threshold);
+ => Diffuse(source, KnownDiffusers.FloydSteinberg, threshold);
///
/// Dithers the image reducing it to a web-safe palette using error diffusion.
diff --git a/src/ImageSharp/Processing/Dithering/DitherExtensions.cs b/src/ImageSharp/Processing/Dithering/DitherExtensions.cs
index 31ef12a0ac..9058138550 100644
--- a/src/ImageSharp/Processing/Dithering/DitherExtensions.cs
+++ b/src/ImageSharp/Processing/Dithering/DitherExtensions.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Dithering
/// The .
public static IImageProcessingContext Dither(this IImageProcessingContext source)
where TPixel : struct, IPixel
- => Dither(source, DitherMode.BayerDither4x4);
+ => Dither(source, KnownDitherMatrices.BayerDither4x4);
///
/// Dithers the image reducing it to a web-safe palette using ordered dithering.
diff --git a/src/ImageSharp/Processing/Dithering/DiffuseMode.cs b/src/ImageSharp/Processing/Dithering/KnownDiffusers.cs
similarity index 98%
rename from src/ImageSharp/Processing/Dithering/DiffuseMode.cs
rename to src/ImageSharp/Processing/Dithering/KnownDiffusers.cs
index cc74f1230f..250a543ec9 100644
--- a/src/ImageSharp/Processing/Dithering/DiffuseMode.cs
+++ b/src/ImageSharp/Processing/Dithering/KnownDiffusers.cs
@@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Processing.Dithering
///
/// Contains reusable static instances of known error diffusion algorithms
///
- public static class DiffuseMode
+ public static class KnownDiffusers
{
///
/// Gets the error diffuser that implements the Atkinson algorithm.
diff --git a/src/ImageSharp/Processing/Dithering/DitherMode.cs b/src/ImageSharp/Processing/Dithering/KnownDitherMatrices.cs
similarity index 96%
rename from src/ImageSharp/Processing/Dithering/DitherMode.cs
rename to src/ImageSharp/Processing/Dithering/KnownDitherMatrices.cs
index f5122608c1..8e32584798 100644
--- a/src/ImageSharp/Processing/Dithering/DitherMode.cs
+++ b/src/ImageSharp/Processing/Dithering/KnownDitherMatrices.cs
@@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Processing.Dithering
///
/// Contains reusable static instances of known ordered dither matrices
///
- public class DitherMode
+ public class KnownDitherMatrices
{
///
/// Gets the order ditherer using the 2x2 Bayer dithering matrix
diff --git a/src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs b/src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs
index b7dc871503..d70064097d 100644
--- a/src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs
+++ b/src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs
@@ -20,7 +20,7 @@ namespace SixLabors.ImageSharp.Processing.Filters
/// The image this method extends.
/// The type of color blindness simulator to apply.
/// The .
- public static IImageProcessingContext ColorBlindness(this IImageProcessingContext source, ColorBlindness colorBlindness)
+ public static IImageProcessingContext ColorBlindness(this IImageProcessingContext source, ColorBlindnessMode colorBlindness)
where TPixel : struct, IPixel
=> source.ApplyProcessor(GetProcessor(colorBlindness));
@@ -29,33 +29,33 @@ namespace SixLabors.ImageSharp.Processing.Filters
///
/// The pixel format.
/// The image this method extends.
- /// The type of color blindness simulator to apply.
+ /// The type of color blindness simulator to apply.
///
/// The structure that specifies the portion of the image object to alter.
///
/// The .
- public static IImageProcessingContext ColorBlindness(this IImageProcessingContext source, ColorBlindness colorBlindness, Rectangle rectangle)
+ public static IImageProcessingContext ColorBlindness(this IImageProcessingContext source, ColorBlindnessMode colorBlindnessMode, Rectangle rectangle)
where TPixel : struct, IPixel
- => source.ApplyProcessor(GetProcessor(colorBlindness), rectangle);
+ => source.ApplyProcessor(GetProcessor(colorBlindnessMode), rectangle);
- private static IImageProcessor GetProcessor(ColorBlindness colorBlindness)
+ private static IImageProcessor GetProcessor(ColorBlindnessMode colorBlindness)
where TPixel : struct, IPixel
{
switch (colorBlindness)
{
- case Filters.ColorBlindness.Achromatomaly:
+ case ColorBlindnessMode.Achromatomaly:
return new AchromatomalyProcessor();
- case Filters.ColorBlindness.Achromatopsia:
+ case ColorBlindnessMode.Achromatopsia:
return new AchromatopsiaProcessor();
- case Filters.ColorBlindness.Deuteranomaly:
+ case ColorBlindnessMode.Deuteranomaly:
return new DeuteranomalyProcessor();
- case Filters.ColorBlindness.Deuteranopia:
+ case ColorBlindnessMode.Deuteranopia:
return new DeuteranopiaProcessor();
- case Filters.ColorBlindness.Protanomaly:
+ case ColorBlindnessMode.Protanomaly:
return new ProtanomalyProcessor();
- case Filters.ColorBlindness.Protanopia:
+ case ColorBlindnessMode.Protanopia:
return new ProtanopiaProcessor();
- case Filters.ColorBlindness.Tritanomaly:
+ case ColorBlindnessMode.Tritanomaly:
return new TritanomalyProcessor();
default:
return new TritanopiaProcessor();
diff --git a/src/ImageSharp/Processing/Filters/ColorBlindness.cs b/src/ImageSharp/Processing/Filters/ColorBlindnessMode.cs
similarity index 96%
rename from src/ImageSharp/Processing/Filters/ColorBlindness.cs
rename to src/ImageSharp/Processing/Filters/ColorBlindnessMode.cs
index 41d468f340..584c9fa08a 100644
--- a/src/ImageSharp/Processing/Filters/ColorBlindness.cs
+++ b/src/ImageSharp/Processing/Filters/ColorBlindnessMode.cs
@@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Processing.Filters
///
/// Enumerates the various types of defined color blindness filters.
///
- public enum ColorBlindness
+ public enum ColorBlindnessMode
{
///
/// Partial color desensitivity.
diff --git a/src/ImageSharp/Processing/Filters/MatrixFilters.cs b/src/ImageSharp/Processing/Filters/KnownMatrixFilters.cs
similarity index 99%
rename from src/ImageSharp/Processing/Filters/MatrixFilters.cs
rename to src/ImageSharp/Processing/Filters/KnownMatrixFilters.cs
index 2f5883fc9c..2b3c0a9a39 100644
--- a/src/ImageSharp/Processing/Filters/MatrixFilters.cs
+++ b/src/ImageSharp/Processing/Filters/KnownMatrixFilters.cs
@@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Processing.Filters
///
/// A collection of known values for composing filters
///
- public static class MatrixFilters
+ public static class KnownMatrixFilters
{
///
/// Gets a filter recreating Achromatomaly (Color desensitivity) color blindness
diff --git a/src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs
index 55c6220308..e1f11c094f 100644
--- a/src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public AchromatomalyProcessor()
- : base(MatrixFilters.AchromatomalyFilter)
+ : base(KnownMatrixFilters.AchromatomalyFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs
index 95f9e893be..e9ff6177c7 100644
--- a/src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public AchromatopsiaProcessor()
- : base(MatrixFilters.AchromatopsiaFilter)
+ : base(KnownMatrixFilters.AchromatopsiaFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs
index f6a420257e..0b1f4dab5c 100644
--- a/src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public BlackWhiteProcessor()
- : base(MatrixFilters.BlackWhiteFilter)
+ : base(KnownMatrixFilters.BlackWhiteFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs
index c6f758634d..d4a51ed04a 100644
--- a/src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be greater than or equal to 0.
public BrightnessProcessor(float amount)
- : base(MatrixFilters.CreateBrightnessFilter(amount))
+ : base(KnownMatrixFilters.CreateBrightnessFilter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs
index 3a8022703c..9c8e717f2f 100644
--- a/src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be greater than or equal to 0.
public ContrastProcessor(float amount)
- : base(MatrixFilters.CreateContrastFilter(amount))
+ : base(KnownMatrixFilters.CreateContrastFilter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs
index 31ea79afe2..afb5bbd531 100644
--- a/src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public DeuteranomalyProcessor()
- : base(MatrixFilters.DeuteranomalyFilter)
+ : base(KnownMatrixFilters.DeuteranomalyFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs
index 5ed7e85408..2cbfcf4674 100644
--- a/src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public DeuteranopiaProcessor()
- : base(MatrixFilters.DeuteranopiaFilter)
+ : base(KnownMatrixFilters.DeuteranopiaFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs b/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs
index fa483752c5..2fe4bf31b6 100644
--- a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs
@@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be between 0 and 1.
public GrayscaleBt601Processor(float amount)
- : base(MatrixFilters.CreateGrayscaleBt601Filter(amount))
+ : base(KnownMatrixFilters.CreateGrayscaleBt601Filter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs b/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs
index 396ad7d903..5e26849984 100644
--- a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs
@@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be between 0 and 1.
public GrayscaleBt709Processor(float amount)
- : base(MatrixFilters.CreateGrayscaleBt709Filter(amount))
+ : base(KnownMatrixFilters.CreateGrayscaleBt709Filter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs
index 31adf21259..8bd7d3278a 100644
--- a/src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The angle of rotation in degrees
public HueProcessor(float degrees)
- : base(MatrixFilters.CreateHueFilter(degrees))
+ : base(KnownMatrixFilters.CreateHueFilter(degrees))
{
this.Degrees = degrees;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs
index e5175ca69b..fc408912d0 100644
--- a/src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs
@@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be between 0 and 1.
public InvertProcessor(float amount)
- : base(MatrixFilters.CreateInvertFilter(amount))
+ : base(KnownMatrixFilters.CreateInvertFilter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs
index 19f55507c4..ea9b86d1b7 100644
--- a/src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public KodachromeProcessor()
- : base(MatrixFilters.KodachromeFilter)
+ : base(KnownMatrixFilters.KodachromeFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs
index 5e3d73fd19..7196bc2dde 100644
--- a/src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs
@@ -20,7 +20,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public LomographProcessor()
- : base(MatrixFilters.LomographFilter)
+ : base(KnownMatrixFilters.LomographFilter)
{
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs
index db9af9546c..9e2e549b2c 100644
--- a/src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs
@@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be between 0 and 1.
public OpacityProcessor(float amount)
- : base(MatrixFilters.CreateOpacityFilter(amount))
+ : base(KnownMatrixFilters.CreateOpacityFilter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs
index 0e90efc7ec..b9c555c9f6 100644
--- a/src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public PolaroidProcessor()
- : base(MatrixFilters.PolaroidFilter)
+ : base(KnownMatrixFilters.PolaroidFilter)
{
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs
index 4801391227..24cdd75c25 100644
--- a/src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public ProtanomalyProcessor()
- : base(MatrixFilters.ProtanomalyFilter)
+ : base(KnownMatrixFilters.ProtanomalyFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs
index 43f1c14ea8..441d083107 100644
--- a/src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public ProtanopiaProcessor()
- : base(MatrixFilters.ProtanopiaFilter)
+ : base(KnownMatrixFilters.ProtanopiaFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs
index 9a48cb2b51..645052eab5 100644
--- a/src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be greater than or equal to 0.
public SaturateProcessor(float amount)
- : base(MatrixFilters.CreateSaturateFilter(amount))
+ : base(KnownMatrixFilters.CreateSaturateFilter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs
index 2b3bf105bf..641540f61a 100644
--- a/src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs
@@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
///
/// The proportion of the conversion. Must be between 0 and 1.
public SepiaProcessor(float amount)
- : base(MatrixFilters.CreateSepiaFilter(amount))
+ : base(KnownMatrixFilters.CreateSepiaFilter(amount))
{
this.Amount = amount;
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs
index cd2e382178..2da3fd5fbd 100644
--- a/src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public TritanomalyProcessor()
- : base(MatrixFilters.TritanomalyFilter)
+ : base(KnownMatrixFilters.TritanomalyFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs b/src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs
index ce4a079a27..a496f6f62c 100644
--- a/src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs
+++ b/src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs
@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Filters.Processors
/// Initializes a new instance of the class.
///
public TritanopiaProcessor()
- : base(MatrixFilters.TritanopiaFilter)
+ : base(KnownMatrixFilters.TritanopiaFilter)
{
}
}
diff --git a/src/ImageSharp/Processing/Quantization/QuantizationMode.cs b/src/ImageSharp/Processing/Quantization/KnownQuantizers.cs
similarity index 96%
rename from src/ImageSharp/Processing/Quantization/QuantizationMode.cs
rename to src/ImageSharp/Processing/Quantization/KnownQuantizers.cs
index 45a085c01f..357cd5676a 100644
--- a/src/ImageSharp/Processing/Quantization/QuantizationMode.cs
+++ b/src/ImageSharp/Processing/Quantization/KnownQuantizers.cs
@@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Processing.Quantization
///
/// Contains reusable static instances of known quantizing algorithms
///
- public static class QuantizationMode
+ public static class KnownQuantizers
{
///
/// Gets the adaptive Octree quantizer. Fast with good quality.
diff --git a/src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs b/src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs
index 9d27970b14..89fa7a90ec 100644
--- a/src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs
+++ b/src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs
@@ -75,6 +75,6 @@ namespace SixLabors.ImageSharp.Processing.Quantization
where TPixel : struct, IPixel
=> new OctreeFrameQuantizer(this);
- private static IErrorDiffuser GetDiffuser(bool dither) => dither ? DiffuseMode.FloydSteinberg : null;
+ private static IErrorDiffuser GetDiffuser(bool dither) => dither ? KnownDiffusers.FloydSteinberg : null;
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs b/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs
index f25b6537a7..06c5a99183 100644
--- a/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs
+++ b/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs
@@ -58,6 +58,6 @@ namespace SixLabors.ImageSharp.Processing.Quantization
where TPixel : struct, IPixel
=> new PaletteFrameQuantizer(this);
- private static IErrorDiffuser GetDiffuser(bool dither) => dither ? DiffuseMode.FloydSteinberg : null;
+ private static IErrorDiffuser GetDiffuser(bool dither) => dither ? KnownDiffusers.FloydSteinberg : null;
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs b/src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs
index 0583c176b0..bf49c765ac 100644
--- a/src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs
+++ b/src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs
@@ -19,7 +19,7 @@ namespace SixLabors.ImageSharp.Processing.Quantization
/// The .
public static IImageProcessingContext Quantize(this IImageProcessingContext source)
where TPixel : struct, IPixel
- => Quantize(source, QuantizationMode.Octree);
+ => Quantize(source, KnownQuantizers.Octree);
///
/// Applies quantization to the image.
diff --git a/src/ImageSharp/Processing/Quantization/WuQuantizer.cs b/src/ImageSharp/Processing/Quantization/WuQuantizer.cs
index 9cfb554126..6b1287b465 100644
--- a/src/ImageSharp/Processing/Quantization/WuQuantizer.cs
+++ b/src/ImageSharp/Processing/Quantization/WuQuantizer.cs
@@ -75,6 +75,6 @@ namespace SixLabors.ImageSharp.Processing.Quantization
where TPixel : struct, IPixel
=> new WuFrameQuantizer(this);
- private static IErrorDiffuser GetDiffuser(bool dither) => dither ? DiffuseMode.FloydSteinberg : null;
+ private static IErrorDiffuser GetDiffuser(bool dither) => dither ? KnownDiffusers.FloydSteinberg : null;
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Processing/Transforms/AnchorPosition.cs b/src/ImageSharp/Processing/Transforms/AnchorPositionMode.cs
similarity index 97%
rename from src/ImageSharp/Processing/Transforms/AnchorPosition.cs
rename to src/ImageSharp/Processing/Transforms/AnchorPositionMode.cs
index 4519f90f94..793fc0dfca 100644
--- a/src/ImageSharp/Processing/Transforms/AnchorPosition.cs
+++ b/src/ImageSharp/Processing/Transforms/AnchorPositionMode.cs
@@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Enumerated anchor positions to apply to resized images.
///
- public enum AnchorPosition
+ public enum AnchorPositionMode
{
///
/// Anchors the position of the image to the center of it's bounding container.
diff --git a/src/ImageSharp/Processing/Transforms/FlipExtensions.cs b/src/ImageSharp/Processing/Transforms/FlipExtensions.cs
index e88074c137..0cbbdd95f5 100644
--- a/src/ImageSharp/Processing/Transforms/FlipExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/FlipExtensions.cs
@@ -16,10 +16,10 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// The pixel format.
/// The image to rotate, flip, or both.
- /// The to perform the flip.
+ /// The to perform the flip.
/// The
- public static IImageProcessingContext Flip(this IImageProcessingContext source, FlipType flipType)
+ public static IImageProcessingContext Flip(this IImageProcessingContext source, FlipMode flipMode)
where TPixel : struct, IPixel
- => source.ApplyProcessor(new FlipProcessor(flipType));
+ => source.ApplyProcessor(new FlipProcessor(flipMode));
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Processing/Transforms/FlipType.cs b/src/ImageSharp/Processing/Transforms/FlipMode.cs
similarity index 95%
rename from src/ImageSharp/Processing/Transforms/FlipType.cs
rename to src/ImageSharp/Processing/Transforms/FlipMode.cs
index 71a4e6fc8f..32c910c803 100644
--- a/src/ImageSharp/Processing/Transforms/FlipType.cs
+++ b/src/ImageSharp/Processing/Transforms/FlipMode.cs
@@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Provides enumeration over how a image should be flipped.
///
- public enum FlipType
+ public enum FlipMode
{
///
/// Don't flip the image.
diff --git a/src/ImageSharp/Processing/Transforms/ResampleMode.cs b/src/ImageSharp/Processing/Transforms/KnownResamplers.cs
similarity index 99%
rename from src/ImageSharp/Processing/Transforms/ResampleMode.cs
rename to src/ImageSharp/Processing/Transforms/KnownResamplers.cs
index bbbdc3b265..2b589d4612 100644
--- a/src/ImageSharp/Processing/Transforms/ResampleMode.cs
+++ b/src/ImageSharp/Processing/Transforms/KnownResamplers.cs
@@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Contains reusable static instances of known resampling algorithms
///
- public static class ResampleMode
+ public static class KnownResamplers
{
///
/// Gets the Bicubic sampler that implements the bicubic kernel algorithm W(x)
diff --git a/src/ImageSharp/Processing/Transforms/OrientationType.cs b/src/ImageSharp/Processing/Transforms/OrientationMode.cs
similarity index 97%
rename from src/ImageSharp/Processing/Transforms/OrientationType.cs
rename to src/ImageSharp/Processing/Transforms/OrientationMode.cs
index 752ac9fe68..c6f05380bd 100644
--- a/src/ImageSharp/Processing/Transforms/OrientationType.cs
+++ b/src/ImageSharp/Processing/Transforms/OrientationMode.cs
@@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Enumerates the available orientation values supplied by EXIF metadata.
///
- internal enum OrientationType : ushort
+ internal enum OrientationMode : ushort
{
///
/// Unknown rotation.
diff --git a/src/ImageSharp/Processing/Transforms/PadExtensions.cs b/src/ImageSharp/Processing/Transforms/PadExtensions.cs
index 23e9d5d27e..a231088dd7 100644
--- a/src/ImageSharp/Processing/Transforms/PadExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/PadExtensions.cs
@@ -26,7 +26,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
{
Size = new Size(width, height),
Mode = ResizeMode.BoxPad,
- Sampler = ResampleMode.NearestNeighbor
+ Sampler = KnownResamplers.NearestNeighbor
};
return source.Resize(options);
diff --git a/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs
index fdb58918af..68dc7f0ad3 100644
--- a/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs
+++ b/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs
@@ -19,42 +19,42 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors
///
protected override void BeforeImageApply(Image source, Rectangle sourceRectangle)
{
- OrientationType orientation = GetExifOrientation(source);
+ OrientationMode orientation = GetExifOrientation(source);
Size size = sourceRectangle.Size;
switch (orientation)
{
- case OrientationType.TopRight:
- new FlipProcessor(FlipType.Horizontal).Apply(source, sourceRectangle);
+ case OrientationMode.TopRight:
+ new FlipProcessor(FlipMode.Horizontal).Apply(source, sourceRectangle);
break;
- case OrientationType.BottomRight:
- new RotateProcessor((int)RotateType.Rotate180, size).Apply(source, sourceRectangle);
+ case OrientationMode.BottomRight:
+ new RotateProcessor((int)RotateMode.Rotate180, size).Apply(source, sourceRectangle);
break;
- case OrientationType.BottomLeft:
- new FlipProcessor(FlipType.Vertical).Apply(source, sourceRectangle);
+ case OrientationMode.BottomLeft:
+ new FlipProcessor(FlipMode.Vertical).Apply(source, sourceRectangle);
break;
- case OrientationType.LeftTop:
- new RotateProcessor((int)RotateType.Rotate90, size).Apply(source, sourceRectangle);
- new FlipProcessor(FlipType.Horizontal).Apply(source, sourceRectangle);
+ case OrientationMode.LeftTop:
+ new RotateProcessor((int)RotateMode.Rotate90, size).Apply(source, sourceRectangle);
+ new FlipProcessor(FlipMode.Horizontal).Apply(source, sourceRectangle);
break;
- case OrientationType.RightTop:
- new RotateProcessor((int)RotateType.Rotate90, size).Apply(source, sourceRectangle);
+ case OrientationMode.RightTop:
+ new RotateProcessor((int)RotateMode.Rotate90, size).Apply(source, sourceRectangle);
break;
- case OrientationType.RightBottom:
- new FlipProcessor(FlipType.Vertical).Apply(source, sourceRectangle);
- new RotateProcessor((int)RotateType.Rotate270, size).Apply(source, sourceRectangle);
+ case OrientationMode.RightBottom:
+ new FlipProcessor(FlipMode.Vertical).Apply(source, sourceRectangle);
+ new RotateProcessor((int)RotateMode.Rotate270, size).Apply(source, sourceRectangle);
break;
- case OrientationType.LeftBottom:
- new RotateProcessor((int)RotateType.Rotate270, size).Apply(source, sourceRectangle);
+ case OrientationMode.LeftBottom:
+ new RotateProcessor((int)RotateMode.Rotate270, size).Apply(source, sourceRectangle);
break;
- case OrientationType.Unknown:
- case OrientationType.TopLeft:
+ case OrientationMode.Unknown:
+ case OrientationMode.TopLeft:
default:
break;
}
@@ -70,32 +70,32 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors
/// Returns the current EXIF orientation
///
/// The image to auto rotate.
- /// The
- private static OrientationType GetExifOrientation(Image source)
+ /// The
+ private static OrientationMode GetExifOrientation(Image source)
{
if (source.MetaData.ExifProfile == null)
{
- return OrientationType.Unknown;
+ return OrientationMode.Unknown;
}
ExifValue value = source.MetaData.ExifProfile.GetValue(ExifTag.Orientation);
if (value == null)
{
- return OrientationType.Unknown;
+ return OrientationMode.Unknown;
}
- OrientationType orientation;
+ OrientationMode orientation;
if (value.DataType == ExifDataType.Short)
{
- orientation = (OrientationType)value.Value;
+ orientation = (OrientationMode)value.Value;
}
else
{
- orientation = (OrientationType)Convert.ToUInt16(value.Value);
+ orientation = (OrientationMode)Convert.ToUInt16(value.Value);
source.MetaData.ExifProfile.RemoveValue(ExifTag.Orientation);
}
- source.MetaData.ExifProfile.SetValue(ExifTag.Orientation, (ushort)OrientationType.TopLeft);
+ source.MetaData.ExifProfile.SetValue(ExifTag.Orientation, (ushort)OrientationMode.TopLeft);
return orientation;
}
diff --git a/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs
index 4c6cb166bf..cf5ebf418a 100644
--- a/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs
+++ b/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs
@@ -21,27 +21,27 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors
///
/// Initializes a new instance of the class.
///
- /// The used to perform flipping.
- public FlipProcessor(FlipType flipType)
+ /// The used to perform flipping.
+ public FlipProcessor(FlipMode flipMode)
{
- this.FlipType = flipType;
+ this.FlipMode = flipMode;
}
///
- /// Gets the used to perform flipping.
+ /// Gets the used to perform flipping.
///
- public FlipType FlipType { get; }
+ public FlipMode FlipMode { get; }
///
protected override void OnFrameApply(ImageFrame source, Rectangle sourceRectangle, Configuration configuration)
{
- switch (this.FlipType)
+ switch (this.FlipMode)
{
// No default needed as we have already set the pixels.
- case FlipType.Vertical:
+ case FlipMode.Vertical:
this.FlipX(source, configuration);
break;
- case FlipType.Horizontal:
+ case FlipMode.Horizontal:
this.FlipY(source, configuration);
break;
}
diff --git a/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs
index 0cf42cbb72..62c3e476b5 100644
--- a/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs
+++ b/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs
@@ -24,7 +24,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors
/// The angle of rotation in degrees.
/// The source image size
public RotateProcessor(float degrees, Size sourceSize)
- : this(degrees, ResampleMode.Bicubic, sourceSize)
+ : this(degrees, KnownResamplers.Bicubic, sourceSize)
{
}
diff --git a/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs
index cc3d901d6c..61e8b12686 100644
--- a/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs
+++ b/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors
/// The angle in degrees to perform the skew along the y-axis.
/// The source image size
public SkewProcessor(float degreesX, float degreesY, Size sourceSize)
- : this(degreesX, degreesY, ResampleMode.Bicubic, sourceSize)
+ : this(degreesX, degreesY, KnownResamplers.Bicubic, sourceSize)
{
}
diff --git a/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs b/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs
index 4101d3cff4..4317c1fc1f 100644
--- a/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs
@@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image
public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size)
where TPixel : struct, IPixel
- => Resize(source, size.Width, size.Height, ResampleMode.Bicubic, false);
+ => Resize(source, size.Width, size.Height, KnownResamplers.Bicubic, false);
///
/// Resizes an image to the given .
@@ -48,7 +48,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image
public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size, bool compand)
where TPixel : struct, IPixel
- => Resize(source, size.Width, size.Height, ResampleMode.Bicubic, compand);
+ => Resize(source, size.Width, size.Height, KnownResamplers.Bicubic, compand);
///
/// Resizes an image to the given width and height.
@@ -61,7 +61,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height)
where TPixel : struct, IPixel
- => Resize(source, width, height, ResampleMode.Bicubic, false);
+ => Resize(source, width, height, KnownResamplers.Bicubic, false);
///
/// Resizes an image to the given width and height.
@@ -75,7 +75,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image
public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, bool compand)
where TPixel : struct, IPixel
- => Resize(source, width, height, ResampleMode.Bicubic, compand);
+ => Resize(source, width, height, KnownResamplers.Bicubic, compand);
///
/// Resizes an image to the given width and height with the given sampler.
diff --git a/src/ImageSharp/Processing/Transforms/ResizeHelper.cs b/src/ImageSharp/Processing/Transforms/ResizeHelper.cs
index 0d500b1bce..aca9d97d3f 100644
--- a/src/ImageSharp/Processing/Transforms/ResizeHelper.cs
+++ b/src/ImageSharp/Processing/Transforms/ResizeHelper.cs
@@ -87,14 +87,14 @@ namespace SixLabors.ImageSharp.Processing.Transforms
{
switch (options.Position)
{
- case AnchorPosition.Top:
- case AnchorPosition.TopLeft:
- case AnchorPosition.TopRight:
+ case AnchorPositionMode.Top:
+ case AnchorPositionMode.TopLeft:
+ case AnchorPositionMode.TopRight:
destinationY = 0;
break;
- case AnchorPosition.Bottom:
- case AnchorPosition.BottomLeft:
- case AnchorPosition.BottomRight:
+ case AnchorPositionMode.Bottom:
+ case AnchorPositionMode.BottomLeft:
+ case AnchorPositionMode.BottomRight:
destinationY = (int)MathF.Round(height - (sourceHeight * ratio));
break;
default:
@@ -128,14 +128,14 @@ namespace SixLabors.ImageSharp.Processing.Transforms
{
switch (options.Position)
{
- case AnchorPosition.Left:
- case AnchorPosition.TopLeft:
- case AnchorPosition.BottomLeft:
+ case AnchorPositionMode.Left:
+ case AnchorPositionMode.TopLeft:
+ case AnchorPositionMode.BottomLeft:
destinationX = 0;
break;
- case AnchorPosition.Right:
- case AnchorPosition.TopRight:
- case AnchorPosition.BottomRight:
+ case AnchorPositionMode.Right:
+ case AnchorPositionMode.TopRight:
+ case AnchorPositionMode.BottomRight:
destinationX = (int)MathF.Round(width - (sourceWidth * ratio));
break;
default:
@@ -177,14 +177,14 @@ namespace SixLabors.ImageSharp.Processing.Transforms
switch (options.Position)
{
- case AnchorPosition.Left:
- case AnchorPosition.TopLeft:
- case AnchorPosition.BottomLeft:
+ case AnchorPositionMode.Left:
+ case AnchorPositionMode.TopLeft:
+ case AnchorPositionMode.BottomLeft:
destinationX = 0;
break;
- case AnchorPosition.Right:
- case AnchorPosition.TopRight:
- case AnchorPosition.BottomRight:
+ case AnchorPositionMode.Right:
+ case AnchorPositionMode.TopRight:
+ case AnchorPositionMode.BottomRight:
destinationX = (int)MathF.Round(width - (sourceWidth * ratio));
break;
default:
@@ -199,14 +199,14 @@ namespace SixLabors.ImageSharp.Processing.Transforms
switch (options.Position)
{
- case AnchorPosition.Top:
- case AnchorPosition.TopLeft:
- case AnchorPosition.TopRight:
+ case AnchorPositionMode.Top:
+ case AnchorPositionMode.TopLeft:
+ case AnchorPositionMode.TopRight:
destinationY = 0;
break;
- case AnchorPosition.Bottom:
- case AnchorPosition.BottomLeft:
- case AnchorPosition.BottomRight:
+ case AnchorPositionMode.Bottom:
+ case AnchorPositionMode.BottomLeft:
+ case AnchorPositionMode.BottomRight:
destinationY = (int)MathF.Round(height - (sourceHeight * ratio));
break;
default:
@@ -247,35 +247,35 @@ namespace SixLabors.ImageSharp.Processing.Transforms
switch (options.Position)
{
- case AnchorPosition.Left:
+ case AnchorPositionMode.Left:
destinationY = (height - sourceHeight) / 2;
destinationX = 0;
break;
- case AnchorPosition.Right:
+ case AnchorPositionMode.Right:
destinationY = (height - sourceHeight) / 2;
destinationX = width - sourceWidth;
break;
- case AnchorPosition.TopRight:
+ case AnchorPositionMode.TopRight:
destinationY = 0;
destinationX = width - sourceWidth;
break;
- case AnchorPosition.Top:
+ case AnchorPositionMode.Top:
destinationY = 0;
destinationX = (width - sourceWidth) / 2;
break;
- case AnchorPosition.TopLeft:
+ case AnchorPositionMode.TopLeft:
destinationY = 0;
destinationX = 0;
break;
- case AnchorPosition.BottomRight:
+ case AnchorPositionMode.BottomRight:
destinationY = height - sourceHeight;
destinationX = width - sourceWidth;
break;
- case AnchorPosition.Bottom:
+ case AnchorPositionMode.Bottom:
destinationY = height - sourceHeight;
destinationX = (width - sourceWidth) / 2;
break;
- case AnchorPosition.BottomLeft:
+ case AnchorPositionMode.BottomLeft:
destinationY = height - sourceHeight;
destinationX = 0;
break;
diff --git a/src/ImageSharp/Processing/Transforms/ResizeMode.cs b/src/ImageSharp/Processing/Transforms/ResizeMode.cs
index d81691cd37..2707b11b3d 100644
--- a/src/ImageSharp/Processing/Transforms/ResizeMode.cs
+++ b/src/ImageSharp/Processing/Transforms/ResizeMode.cs
@@ -4,7 +4,7 @@
namespace SixLabors.ImageSharp.Processing.Transforms
{
///
- /// Enumerated resize modes to apply to images.
+ /// Provides enumeration over how the image should be resized.
///
public enum ResizeMode
{
diff --git a/src/ImageSharp/Processing/Transforms/ResizeOptions.cs b/src/ImageSharp/Processing/Transforms/ResizeOptions.cs
index 8d63847485..c14abe2a87 100644
--- a/src/ImageSharp/Processing/Transforms/ResizeOptions.cs
+++ b/src/ImageSharp/Processing/Transforms/ResizeOptions.cs
@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Gets or sets the anchor position.
///
- public AnchorPosition Position { get; set; } = AnchorPosition.Center;
+ public AnchorPositionMode Position { get; set; } = AnchorPositionMode.Center;
///
/// Gets or sets the center coordinates.
@@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Gets or sets the sampler to perform the resize operation.
///
- public IResampler Sampler { get; set; } = ResampleMode.Bicubic;
+ public IResampler Sampler { get; set; } = KnownResamplers.Bicubic;
///
/// Gets or sets a value indicating whether to compress
diff --git a/src/ImageSharp/Processing/Transforms/RotateExtensions.cs b/src/ImageSharp/Processing/Transforms/RotateExtensions.cs
index e4a233ba45..28819099e9 100644
--- a/src/ImageSharp/Processing/Transforms/RotateExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/RotateExtensions.cs
@@ -17,11 +17,11 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// The pixel format.
/// The image to rotate.
- /// The to perform the rotation.
+ /// The to perform the rotation.
/// The
- public static IImageProcessingContext Rotate(this IImageProcessingContext source, RotateType rotateType)
+ public static IImageProcessingContext Rotate(this IImageProcessingContext source, RotateMode rotateMode)
where TPixel : struct, IPixel
- => Rotate(source, (float)rotateType);
+ => Rotate(source, (float)rotateMode);
///
/// Rotates an image by the given angle in degrees.
@@ -32,7 +32,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// The
public static IImageProcessingContext Rotate(this IImageProcessingContext source, float degrees)
where TPixel : struct, IPixel
- => Rotate(source, degrees, ResampleMode.Bicubic);
+ => Rotate(source, degrees, KnownResamplers.Bicubic);
///
/// Rotates an image by the given angle in degrees using the specified sampling algorithm.
diff --git a/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs b/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs
index 693c0d8ad7..66bb27b365 100644
--- a/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs
@@ -15,11 +15,11 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// The pixel format.
/// The image to rotate, flip, or both.
- /// The to perform the rotation.
- /// The to perform the flip.
+ /// The to perform the rotation.
+ /// The to perform the flip.
/// The
- public static IImageProcessingContext RotateFlip(this IImageProcessingContext source, RotateType rotateType, FlipType flipType)
+ public static IImageProcessingContext RotateFlip(this IImageProcessingContext source, RotateMode rotateMode, FlipMode flipMode)
where TPixel : struct, IPixel
- => source.Rotate(rotateType).Flip(flipType);
+ => source.Rotate(rotateMode).Flip(flipMode);
}
}
\ No newline at end of file
diff --git a/src/ImageSharp/Processing/Transforms/RotateType.cs b/src/ImageSharp/Processing/Transforms/RotateMode.cs
similarity index 96%
rename from src/ImageSharp/Processing/Transforms/RotateType.cs
rename to src/ImageSharp/Processing/Transforms/RotateMode.cs
index 498ad4149a..6f66d0c09e 100644
--- a/src/ImageSharp/Processing/Transforms/RotateType.cs
+++ b/src/ImageSharp/Processing/Transforms/RotateMode.cs
@@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
///
/// Provides enumeration over how the image should be rotated.
///
- public enum RotateType
+ public enum RotateMode
{
///
/// Do not rotate the image.
diff --git a/src/ImageSharp/Processing/Transforms/SkewExtensions.cs b/src/ImageSharp/Processing/Transforms/SkewExtensions.cs
index 686f2c87c8..cbb4148889 100644
--- a/src/ImageSharp/Processing/Transforms/SkewExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/SkewExtensions.cs
@@ -22,7 +22,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// The
public static IImageProcessingContext Skew(this IImageProcessingContext source, float degreesX, float degreesY)
where TPixel : struct, IPixel
- => Skew(source, degreesX, degreesY, ResampleMode.Bicubic);
+ => Skew(source, degreesX, degreesY, KnownResamplers.Bicubic);
///
/// Skews an image by the given angles in degrees using the specified sampling algorithm.
diff --git a/src/ImageSharp/Processing/Transforms/TransformExtensions.cs b/src/ImageSharp/Processing/Transforms/TransformExtensions.cs
index 865511b26d..585288d8a8 100644
--- a/src/ImageSharp/Processing/Transforms/TransformExtensions.cs
+++ b/src/ImageSharp/Processing/Transforms/TransformExtensions.cs
@@ -23,7 +23,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// The
public static IImageProcessingContext Transform(this IImageProcessingContext source, Matrix3x2 matrix)
where TPixel : struct, IPixel
- => Transform(source, matrix, ResampleMode.Bicubic);
+ => Transform(source, matrix, KnownResamplers.Bicubic);
///
/// Transforms an image by the given matrix using the specified sampling algorithm.
@@ -88,7 +88,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms
/// The
internal static IImageProcessingContext Transform(this IImageProcessingContext source, Matrix4x4 matrix)
where TPixel : struct, IPixel
- => Transform(source, matrix, ResampleMode.Bicubic);
+ => Transform(source, matrix, KnownResamplers.Bicubic);
///
/// Applies a projective transform to the image by the given matrix using the specified sampling algorithm.
diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs
index cf65833ea6..3e7f3648fb 100644
--- a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs
+++ b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs
@@ -66,7 +66,7 @@ namespace SixLabors.ImageSharp.Tests
// We pass a new rectangle here based on the dest bounds since we've offset the matrix
blend.Mutate(x => x.Transform(
centeredMatrix,
- ResampleMode.Bicubic,
+ KnownResamplers.Bicubic,
new Rectangle(0, 0, destBounds.Width, destBounds.Height)));
var position = new Point((image.Width - blend.Width) / 2, (image.Height - blend.Height) / 2);
diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs
index b78a8083e2..26b5dca271 100644
--- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs
+++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs
@@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp.Tests
{
using (FileStream output = File.OpenWrite($"{path}/Octree-{file.FileName}"))
{
- image.Mutate(x => x.Quantize(QuantizationMode.Octree));
+ image.Mutate(x => x.Quantize(KnownQuantizers.Octree));
image.Save(output, mimeType);
}
@@ -84,7 +84,7 @@ namespace SixLabors.ImageSharp.Tests
{
using (FileStream output = File.OpenWrite($"{path}/Wu-{file.FileName}"))
{
- image.Mutate(x => x.Quantize(QuantizationMode.Wu));
+ image.Mutate(x => x.Quantize(KnownQuantizers.Wu));
image.Save(output, mimeType);
}
}
@@ -93,7 +93,7 @@ namespace SixLabors.ImageSharp.Tests
{
using (FileStream output = File.OpenWrite($"{path}/Palette-{file.FileName}"))
{
- image.Mutate(x => x.Quantize(QuantizationMode.Palette));
+ image.Mutate(x => x.Quantize(KnownQuantizers.Palette));
image.Save(output, mimeType);
}
}
diff --git a/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs b/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs
index 1cb35596c5..43c53570a1 100644
--- a/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs
+++ b/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs
@@ -6,6 +6,8 @@ using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
+
using Xunit;
namespace SixLabors.ImageSharp.Tests
diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs
index 5e7e9e3a79..65a469b6f1 100644
--- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs
+++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs
@@ -9,6 +9,8 @@ using System.Text;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
+
using Xunit;
namespace SixLabors.ImageSharp.Tests
diff --git a/tests/ImageSharp.Tests/Numerics/RationalTests.cs b/tests/ImageSharp.Tests/Numerics/RationalTests.cs
index 61eeed01f5..71bf71fa0e 100644
--- a/tests/ImageSharp.Tests/Numerics/RationalTests.cs
+++ b/tests/ImageSharp.Tests/Numerics/RationalTests.cs
@@ -2,6 +2,8 @@
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
+using SixLabors.ImageSharp.Primitives;
+
using Xunit;
namespace SixLabors.ImageSharp.Tests
diff --git a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs
index af5388d1cf..b22e84f3c6 100644
--- a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs
+++ b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs
@@ -2,6 +2,8 @@
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
+using SixLabors.ImageSharp.Primitives;
+
using Xunit;
namespace SixLabors.ImageSharp.Tests
diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs
index a742171b19..d88491638d 100644
--- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs
@@ -20,8 +20,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Binarization
public BinaryDitherTest()
{
- this.orderedDither = DitherMode.BayerDither4x4;
- this.errorDiffuser = DiffuseMode.FloydSteinberg;
+ this.orderedDither = KnownDitherMatrices.BayerDither4x4;
+ this.errorDiffuser = KnownDiffusers.FloydSteinberg;
}
[Fact]
diff --git a/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs
index 69aee9bc81..1526644bbe 100644
--- a/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs
@@ -25,8 +25,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Binarization
public DitherTest()
{
- this.orderedDither = DitherMode.BayerDither4x4;
- this.errorDiffuser = DiffuseMode.FloydSteinberg;
+ this.orderedDither = KnownDitherMatrices.BayerDither4x4;
+ this.errorDiffuser = KnownDiffusers.FloydSteinberg;
}
[Fact]
diff --git a/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs
index 29d18897fb..04b916b6e2 100644
--- a/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs
@@ -17,19 +17,19 @@ namespace SixLabors.ImageSharp.Tests.Processing.Filters
public class ColorBlindnessTest : BaseImageOperationsExtensionTest
{
public static IEnumerable