Browse Source

Update TPacked signature

Removes boxing allocation when comparing generic packed value.
af/merge-core
James Jackson-South 9 years ago
parent
commit
9afc73d2b4
  1. 3
      src/ImageSharp/Colors/PackedPixel/IPackedPixel.cs
  2. 3
      src/ImageSharp/Colors/PackedPixel/IPackedVector.cs
  3. 4
      src/ImageSharp/Common/Extensions/ArrayExtensions.cs
  4. 2
      src/ImageSharp/Common/Helpers/ImageMaths.cs
  5. 4
      src/ImageSharp/Drawing/Brushes/Brushes`2.cs
  6. 4
      src/ImageSharp/Drawing/Brushes/IBrush.cs
  7. 2
      src/ImageSharp/Drawing/Brushes/ImageBrush`2.cs
  8. 3
      src/ImageSharp/Drawing/Brushes/PatternBrush`2.cs
  9. 2
      src/ImageSharp/Drawing/Brushes/Processors/IBrushApplicator.cs
  10. 3
      src/ImageSharp/Drawing/Brushes/SolidBrush`2.cs
  11. 61
      src/ImageSharp/Drawing/Draw.cs
  12. 6
      src/ImageSharp/Drawing/DrawImage.cs
  13. 22
      src/ImageSharp/Drawing/Fill.cs
  14. 2
      src/ImageSharp/Drawing/Pens/IPen.cs
  15. 4
      src/ImageSharp/Drawing/Pens/Pen.cs
  16. 4
      src/ImageSharp/Drawing/Pens/Pens.cs
  17. 8
      src/ImageSharp/Drawing/Pens/Processors/ColoredPointInfo.cs
  18. 2
      src/ImageSharp/Drawing/Pens/Processors/IPenApplicator.cs
  19. 2
      src/ImageSharp/Drawing/Processors/DrawImageProcessor.cs
  20. 2
      src/ImageSharp/Drawing/Processors/DrawPathProcessor.cs
  21. 2
      src/ImageSharp/Drawing/Processors/FillProcessor.cs
  22. 2
      src/ImageSharp/Drawing/Processors/FillShapeProcessor.cs
  23. 6
      src/ImageSharp/Filters/Binarization/BinaryThreshold.cs
  24. 6
      src/ImageSharp/Filters/ColorMatrix/BlackWhite.cs
  25. 6
      src/ImageSharp/Filters/ColorMatrix/ColorBlindness.cs
  26. 6
      src/ImageSharp/Filters/ColorMatrix/Grayscale.cs
  27. 6
      src/ImageSharp/Filters/ColorMatrix/Hue.cs
  28. 6
      src/ImageSharp/Filters/ColorMatrix/Kodachrome.cs
  29. 6
      src/ImageSharp/Filters/ColorMatrix/Lomograph.cs
  30. 6
      src/ImageSharp/Filters/ColorMatrix/Polaroid.cs
  31. 6
      src/ImageSharp/Filters/ColorMatrix/Saturation.cs
  32. 6
      src/ImageSharp/Filters/ColorMatrix/Sepia.cs
  33. 6
      src/ImageSharp/Filters/Convolution/BoxBlur.cs
  34. 14
      src/ImageSharp/Filters/Convolution/DetectEdges.cs
  35. 6
      src/ImageSharp/Filters/Convolution/GaussianBlur.cs
  36. 6
      src/ImageSharp/Filters/Convolution/GaussianSharpen.cs
  37. 6
      src/ImageSharp/Filters/Effects/Alpha.cs
  38. 4
      src/ImageSharp/Filters/Effects/BackgroundColor.cs
  39. 6
      src/ImageSharp/Filters/Effects/Brightness.cs
  40. 6
      src/ImageSharp/Filters/Effects/Contrast.cs
  41. 6
      src/ImageSharp/Filters/Effects/Invert.cs
  42. 4
      src/ImageSharp/Filters/Effects/OilPainting.cs
  43. 4
      src/ImageSharp/Filters/Effects/Pixelate.cs
  44. 12
      src/ImageSharp/Filters/Overlays/Glow.cs
  45. 12
      src/ImageSharp/Filters/Overlays/Vignette.cs
  46. 2
      src/ImageSharp/Filters/Processors/Binarization/BinaryThresholdProcessor.cs
  47. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/BlackWhiteProcessor.cs
  48. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs
  49. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs
  50. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs
  51. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs
  52. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs
  53. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs
  54. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs
  55. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs
  56. 2
      src/ImageSharp/Filters/Processors/ColorMatrix/ColorMatrixFilter.cs
  57. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/GrayscaleBt601Processor.cs
  58. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/GrayscaleBt709Processor.cs
  59. 2
      src/ImageSharp/Filters/Processors/ColorMatrix/HueProcessor.cs
  60. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/IColorMatrixFilter.cs
  61. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/KodachromeProcessor.cs
  62. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/LomographProcessor.cs
  63. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/PolaroidProcessor.cs
  64. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/SaturationProcessor.cs
  65. 3
      src/ImageSharp/Filters/Processors/ColorMatrix/SepiaProcessor.cs
  66. 4
      src/ImageSharp/Filters/Processors/Convolution/BoxBlurProcessor.cs
  67. 2
      src/ImageSharp/Filters/Processors/Convolution/Convolution2DProcessor.cs
  68. 3
      src/ImageSharp/Filters/Processors/Convolution/Convolution2PassProcessor.cs
  69. 3
      src/ImageSharp/Filters/Processors/Convolution/ConvolutionProcessor.cs
  70. 4
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs
  71. 2
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs
  72. 4
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs
  73. 4
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs
  74. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs
  75. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/KirschProcessor.cs
  76. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs
  77. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs
  78. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs
  79. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/PrewittProcessor.cs
  80. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs
  81. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs
  82. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/ScharrProcessor.cs
  83. 3
      src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/SobelProcessor.cs
  84. 2
      src/ImageSharp/Filters/Processors/Convolution/GaussianBlurProcessor.cs
  85. 2
      src/ImageSharp/Filters/Processors/Convolution/GaussianSharpenProcessor.cs
  86. 2
      src/ImageSharp/Filters/Processors/Effects/AlphaProcessor.cs
  87. 2
      src/ImageSharp/Filters/Processors/Effects/BackgroundColorProcessor.cs
  88. 2
      src/ImageSharp/Filters/Processors/Effects/BrightnessProcessor.cs
  89. 2
      src/ImageSharp/Filters/Processors/Effects/ContrastProcessor.cs
  90. 2
      src/ImageSharp/Filters/Processors/Effects/InvertProcessor.cs
  91. 2
      src/ImageSharp/Filters/Processors/Effects/OilPaintingProcessor.cs
  92. 2
      src/ImageSharp/Filters/Processors/Effects/PixelateProcessor.cs
  93. 4
      src/ImageSharp/Filters/Processors/IImageFilteringProcessor.cs
  94. 2
      src/ImageSharp/Filters/Processors/ImageFilteringProcessor.cs
  95. 2
      src/ImageSharp/Filters/Processors/Overlays/GlowProcessor.cs
  96. 2
      src/ImageSharp/Filters/Processors/Overlays/VignetteProcessor.cs
  97. 2
      src/ImageSharp/Filters/Processors/Transforms/CompandingResizeProcessor.cs
  98. 2
      src/ImageSharp/Filters/Processors/Transforms/CropProcessor.cs
  99. 4
      src/ImageSharp/Filters/Processors/Transforms/EntropyCropProcessor.cs
  100. 2
      src/ImageSharp/Filters/Processors/Transforms/FlipProcessor.cs

3
src/ImageSharp/Colors/PackedPixel/IPackedPixel.cs

@ -5,12 +5,13 @@
namespace ImageSharp
{
using System;
/// <summary>
/// An interface that represents a packed pixel type.
/// </summary>
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public interface IPackedPixel<TPacked> : IPackedVector<TPacked>, IPackedBytes
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
}
}

3
src/ImageSharp/Colors/PackedPixel/IPackedVector.cs

@ -5,6 +5,7 @@
namespace ImageSharp
{
using System;
using System.Numerics;
/// <summary>
@ -13,7 +14,7 @@ namespace ImageSharp
/// </summary>
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public interface IPackedVector<TPacked> : IPackedVector
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Gets or sets the packed representation of the value.

4
src/ImageSharp/Common/Extensions/ArrayExtensions.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
/// <summary>
/// Extension methods for arrays.
/// </summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="PixelAccessor{TColor,TPacked}"/></returns>
public static PixelAccessor<TColor, TPacked> Lock<TColor, TPacked>(this TColor[] pixels, int width, int height)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return new PixelAccessor<TColor, TPacked>(width, height, pixels);
}

2
src/ImageSharp/Common/Helpers/ImageMaths.cs

@ -166,7 +166,7 @@ namespace ImageSharp
/// </returns>
public static Rectangle GetFilteredBoundingRectangle<TColor, TPacked>(ImageBase<TColor, TPacked> bitmap, float componentValue, RgbaComponent channel = RgbaComponent.B)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
const float Epsilon = .00001f;
int width = bitmap.Width;

4
src/ImageSharp/Drawing/Brushes/Brushes`2.cs

@ -3,6 +3,8 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
using System;
namespace ImageSharp.Drawing.Brushes
{
/// <summary>
@ -13,7 +15,7 @@ namespace ImageSharp.Drawing.Brushes
/// <returns>A Brush</returns>
public class Brushes<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Percent10 Hatch Pattern

4
src/ImageSharp/Drawing/Brushes/IBrush.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Drawing
{
using System;
using Processors;
/// <summary>
@ -18,7 +20,7 @@ namespace ImageSharp.Drawing
/// </remarks>
public interface IBrush<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Creates the applicator for this brush.

2
src/ImageSharp/Drawing/Brushes/ImageBrush`2.cs

@ -17,7 +17,7 @@ namespace ImageSharp.Drawing.Brushes
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class ImageBrush<TColor, TPacked> : IBrush<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The image to paint.

3
src/ImageSharp/Drawing/Brushes/PatternBrush`2.cs

@ -8,6 +8,7 @@ namespace ImageSharp.Drawing.Brushes
using System.Numerics;
using Processors;
using System;
/// <summary>
/// Provides an implementation of a pattern brush for painting patterns.
@ -43,7 +44,7 @@ namespace ImageSharp.Drawing.Brushes
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class PatternBrush<TColor, TPacked> : IBrush<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The pattern.

2
src/ImageSharp/Drawing/Brushes/Processors/IBrushApplicator.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Drawing.Processors
/// <seealso cref="System.IDisposable" />
public interface IBrushApplicator<TColor, TPacked> : IDisposable // disposable will be required if/when there is an ImageBrush
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Gets the color for a single pixel.

3
src/ImageSharp/Drawing/Brushes/SolidBrush`2.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Drawing.Brushes
{
using System;
using System.Numerics;
using Processors;
@ -16,7 +17,7 @@ namespace ImageSharp.Drawing.Brushes
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class SolidBrush<TColor, TPacked> : IBrush<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The color to paint.

61
src/ImageSharp/Drawing/Draw.cs

@ -5,6 +5,7 @@
namespace ImageSharp
{
using System;
using System.Numerics;
using Drawing;
using Drawing.Brushes;
@ -32,7 +33,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(new DrawPathProcessor<TColor, TPacked>(pen, shape, options));
}
@ -48,7 +49,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, IShape shape)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(pen, shape, GraphicsOptions.Default);
}
@ -68,7 +69,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new Pen<TColor, TPacked>(brush, thickness), shape, options);
}
@ -85,7 +86,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, IShape shape)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new Pen<TColor, TPacked>(brush, thickness), shape);
}
@ -105,7 +106,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new SolidBrush<TColor, TPacked>(color), thickness, shape, options);
}
@ -122,7 +123,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, IShape shape)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new SolidBrush<TColor, TPacked>(color), thickness, shape);
}
@ -142,7 +143,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new Pen<TColor, TPacked>(brush, thickness), new Polygon(new LinearLineSegment(points)), options);
}
@ -159,7 +160,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new Pen<TColor, TPacked>(brush, thickness), new Polygon(new LinearLineSegment(points)));
}
@ -176,7 +177,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new SolidBrush<TColor, TPacked>(color), thickness, points);
}
@ -196,7 +197,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(new SolidBrush<TColor, TPacked>(color), thickness, points, options);
}
@ -215,7 +216,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(pen, new Polygon(new LinearLineSegment(points)), options);
}
@ -230,7 +231,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPolygon(pen, new Polygon(new LinearLineSegment(points)));
}
@ -249,7 +250,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPath<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, IPath path, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(new DrawPathProcessor<TColor, TPacked>(pen, path, options));
}
@ -265,7 +266,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPath<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, IPath path)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(new DrawPathProcessor<TColor, TPacked>(pen, path, GraphicsOptions.Default));
}
@ -285,7 +286,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPath<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, IPath path, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new Pen<TColor, TPacked>(brush, thickness), path, options);
}
@ -302,7 +303,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPath<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, IPath path)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new Pen<TColor, TPacked>(brush, thickness), path);
}
@ -322,7 +323,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawPath<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, IPath path, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new SolidBrush<TColor, TPacked>(color), thickness, path, options);
}
@ -339,7 +340,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawPath<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, IPath path)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new SolidBrush<TColor, TPacked>(color), thickness, path);
}
@ -359,7 +360,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawLines<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new Pen<TColor, TPacked>(brush, thickness), new Path(new LinearLineSegment(points)), options);
}
@ -376,7 +377,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawLines<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new Pen<TColor, TPacked>(brush, thickness), new Path(new LinearLineSegment(points)));
}
@ -393,7 +394,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawLines<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawLines(new SolidBrush<TColor, TPacked>(color), thickness, points);
}
@ -413,7 +414,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawLines<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawLines(new SolidBrush<TColor, TPacked>(color), thickness, points, options);
}
@ -432,7 +433,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawLines<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(pen, new Path(new LinearLineSegment(points)), options);
}
@ -448,7 +449,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawLines<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(pen, new Path(new LinearLineSegment(points)));
}
@ -468,7 +469,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawBeziers<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new Pen<TColor, TPacked>(brush, thickness), new Path(new BezierLineSegment(points)), options);
}
@ -485,7 +486,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawBeziers<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, float thickness, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(new Pen<TColor, TPacked>(brush, thickness), new Path(new BezierLineSegment(points)));
}
@ -502,7 +503,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawBeziers<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawBeziers(new SolidBrush<TColor, TPacked>(color), thickness, points);
}
@ -522,7 +523,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawBeziers<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float thickness, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawBeziers(new SolidBrush<TColor, TPacked>(color), thickness, points, options);
}
@ -541,7 +542,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> DrawBeziers<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(pen, new Path(new BezierLineSegment(points)), options);
}
@ -557,7 +558,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> DrawBeziers<TColor, TPacked>(this Image<TColor, TPacked> source, IPen<TColor, TPacked> pen, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.DrawPath(pen, new Path(new BezierLineSegment(points)));
}

6
src/ImageSharp/Drawing/DrawImage.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -23,7 +25,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Blend<TColor, TPacked>(this Image<TColor, TPacked> source, Image<TColor, TPacked> image, int percent = 50)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return DrawImage(source, image, percent, default(Size), default(Point));
}
@ -41,7 +43,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DrawImage<TColor, TPacked>(this Image<TColor, TPacked> source, Image<TColor, TPacked> image, int percent, Size size, Point location)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
if (size == default(Size))
{

22
src/ImageSharp/Drawing/Fill.cs

@ -5,13 +5,13 @@
namespace ImageSharp
{
using System;
using System.Numerics;
using Drawing;
using Drawing.Brushes;
using Drawing.Paths;
using Drawing.Processors;
using Drawing.Shapes;
using Processors;
/// <summary>
/// Extension methods for the <see cref="Image{TColor, TPacked}"/> type.
@ -28,7 +28,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> Fill<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(new FillProcessor<TColor, TPacked>(brush));
}
@ -43,7 +43,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> Fill<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Fill(new SolidBrush<TColor, TPacked>(color));
}
@ -59,7 +59,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> Fill<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(new FillShapeProcessor<TColor, TPacked>(brush, shape, options));
}
@ -75,7 +75,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> Fill<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, IShape shape)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(new FillShapeProcessor<TColor, TPacked>(brush, shape, GraphicsOptions.Default));
}
@ -94,7 +94,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> Fill<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Fill(new SolidBrush<TColor, TPacked>(color), shape, options);
}
@ -110,7 +110,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> Fill<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, IShape shape)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Fill(new SolidBrush<TColor, TPacked>(color), shape);
}
@ -129,7 +129,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> FillPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
// using Polygon directly instead of LinearPolygon as its will have less indirection
return source.Fill(brush, new Polygon(new LinearLineSegment(points)), options);
@ -146,7 +146,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> FillPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, IBrush<TColor, TPacked> brush, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
// using Polygon directly instead of LinearPolygon as its will have less indirection
return source.Fill(brush, new Polygon(new LinearLineSegment(points)));
@ -166,7 +166,7 @@ namespace ImageSharp
/// </returns>
public static Image<TColor, TPacked> FillPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, Vector2[] points, GraphicsOptions options)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
// using Polygon directly instead of LinearPolygon as its will have less indirection
return source.Fill(new SolidBrush<TColor, TPacked>(color), new Polygon(new LinearLineSegment(points)), options);
@ -183,7 +183,7 @@ namespace ImageSharp
/// <returns>The Image</returns>
public static Image<TColor, TPacked> FillPolygon<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, Vector2[] points)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
// using Polygon directly instead of LinearPolygon as its will have less indirection
return source.Fill(new SolidBrush<TColor, TPacked>(color), new Polygon(new LinearLineSegment(points)));

2
src/ImageSharp/Drawing/Pens/IPen.cs

@ -15,7 +15,7 @@ namespace ImageSharp.Drawing.Pens
/// <typeparam name="TPacked">The type of the packed.</typeparam>
public interface IPen<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Creates the applicator for applying this pen to an Image

4
src/ImageSharp/Drawing/Pens/Pen.cs

@ -72,9 +72,9 @@ namespace ImageSharp.Drawing.Pens
/// section 3 will be width/2 long and will be filled
/// the the pattern will imidiatly repeat without gap.
/// </remarks>
public partial class Pen<TColor, TPacked> : IPen<TColor, TPacked>
public class Pen<TColor, TPacked> : IPen<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
private static readonly float[] EmptyPattern = new float[0];
private readonly float[] pattern;

4
src/ImageSharp/Drawing/Pens/Pens.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Drawing.Pens
{
using System;
/// <summary>
/// Common Pen styles
/// </summary>
@ -108,7 +110,7 @@ namespace ImageSharp.Drawing.Pens
/// <typeparam name="TPacked">The type of the packed.</typeparam>
public partial class Pens<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
private static readonly float[] DashDotPattern = new[] { 3f, 1f, 1f, 1f };
private static readonly float[] DashDotDotPattern = new[] { 3f, 1f, 1f, 1f, 1f, 1f };

8
src/ImageSharp/Drawing/Pens/Processors/ColoredPointInfo.cs

@ -5,14 +5,16 @@
namespace ImageSharp.Drawing.Pens.Processors
{
using System;
/// <summary>
/// Returns details about how far awau from the inside of a shape and the color the pixel could be.
/// Returns details about how far away from the inside of a shape and the color the pixel could be.
/// </summary>
/// <typeparam name="TColor">The type of the color.</typeparam>
/// <typeparam name="TPacked">The type of the packed.</typeparam>
public struct ColoredPointInfo<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The color

2
src/ImageSharp/Drawing/Pens/Processors/IPenApplicator.cs

@ -15,7 +15,7 @@ namespace ImageSharp.Drawing.Pens.Processors
/// <typeparam name="TPacked">The type of the packed.</typeparam>
public interface IPenApplicator<TColor, TPacked> : IDisposable
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Gets the required region.

2
src/ImageSharp/Drawing/Processors/DrawImageProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class DrawImageProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="DrawImageProcessor{TColor,TPacked}"/> class.

2
src/ImageSharp/Drawing/Processors/DrawPathProcessor.cs

@ -24,7 +24,7 @@ namespace ImageSharp.Drawing.Processors
/// <seealso cref="ImageSharp.Processors.ImageFilteringProcessor{TColor, TPacked}" />
public class DrawPathProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
private const float AntialiasFactor = 1f;
private const int PaddingFactor = 1; // needs to been the same or greater than AntialiasFactor

2
src/ImageSharp/Drawing/Processors/FillProcessor.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Drawing.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class FillProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
private const float Epsilon = 0.001f;

2
src/ImageSharp/Drawing/Processors/FillShapeProcessor.cs

@ -20,7 +20,7 @@ namespace ImageSharp.Drawing.Processors
/// <seealso cref="ImageSharp.Processors.ImageFilteringProcessor{TColor, TPacked}" />
public class FillShapeProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
private const float Epsilon = 0.001f;

6
src/ImageSharp/Filters/Binarization/BinaryThreshold.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BinaryThreshold<TColor, TPacked>(this Image<TColor, TPacked> source, float threshold)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return BinaryThreshold(source, threshold, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BinaryThreshold<TColor, TPacked>(this Image<TColor, TPacked> source, float threshold, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new BinaryThresholdProcessor<TColor, TPacked>(threshold));
}

6
src/ImageSharp/Filters/ColorMatrix/BlackWhite.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BlackWhite<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return BlackWhite(source, source.Bounds);
}
@ -38,7 +40,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BlackWhite<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new BlackWhiteProcessor<TColor, TPacked>());
}

6
src/ImageSharp/Filters/ColorMatrix/ColorBlindness.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> ColorBlindness<TColor, TPacked>(this Image<TColor, TPacked> source, ColorBlindness colorBlindness)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return ColorBlindness(source, colorBlindness, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> ColorBlindness<TColor, TPacked>(this Image<TColor, TPacked> source, ColorBlindness colorBlindness, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
IImageFilteringProcessor<TColor, TPacked> processor;

6
src/ImageSharp/Filters/ColorMatrix/Grayscale.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Grayscale<TColor, TPacked>(this Image<TColor, TPacked> source, GrayscaleMode mode = GrayscaleMode.Bt709)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Grayscale(source, source.Bounds, mode);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Grayscale<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle, GrayscaleMode mode = GrayscaleMode.Bt709)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
IImageFilteringProcessor<TColor, TPacked> processor = mode == GrayscaleMode.Bt709
? (IImageFilteringProcessor<TColor, TPacked>)new GrayscaleBt709Processor<TColor, TPacked>()

6
src/ImageSharp/Filters/ColorMatrix/Hue.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Hue<TColor, TPacked>(this Image<TColor, TPacked> source, float degrees)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Hue(source, degrees, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Hue<TColor, TPacked>(this Image<TColor, TPacked> source, float degrees, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new HueProcessor<TColor, TPacked>(degrees));
}

6
src/ImageSharp/Filters/ColorMatrix/Kodachrome.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Kodachrome<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Kodachrome(source, source.Bounds);
}
@ -38,7 +40,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Kodachrome<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new KodachromeProcessor<TColor, TPacked>());
}

6
src/ImageSharp/Filters/ColorMatrix/Lomograph.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Lomograph<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Lomograph(source, source.Bounds);
}
@ -38,7 +40,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Lomograph<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new LomographProcessor<TColor, TPacked>());
}

6
src/ImageSharp/Filters/ColorMatrix/Polaroid.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Polaroid<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Polaroid(source, source.Bounds);
}
@ -38,7 +40,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Polaroid<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new PolaroidProcessor<TColor, TPacked>());
}

6
src/ImageSharp/Filters/ColorMatrix/Saturation.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Saturation<TColor, TPacked>(this Image<TColor, TPacked> source, int amount)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Saturation(source, amount, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Saturation<TColor, TPacked>(this Image<TColor, TPacked> source, int amount, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new SaturationProcessor<TColor, TPacked>(amount));
}

6
src/ImageSharp/Filters/ColorMatrix/Sepia.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image"/>.</returns>
public static Image<TColor, TPacked> Sepia<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Sepia(source, source.Bounds);
}
@ -38,7 +40,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image"/>.</returns>
public static Image<TColor, TPacked> Sepia<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new SepiaProcessor<TColor, TPacked>());
}

6
src/ImageSharp/Filters/Convolution/BoxBlur.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BoxBlur<TColor, TPacked>(this Image<TColor, TPacked> source, int radius = 7)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return BoxBlur(source, radius, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BoxBlur<TColor, TPacked>(this Image<TColor, TPacked> source, int radius, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new BoxBlurProcessor<TColor, TPacked>(radius));
}

14
src/ImageSharp/Filters/Convolution/DetectEdges.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DetectEdges<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return DetectEdges(source, source.Bounds, new SobelProcessor<TColor, TPacked> { Grayscale = true });
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DetectEdges<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return DetectEdges(source, rectangle, new SobelProcessor<TColor, TPacked> { Grayscale = true });
}
@ -56,7 +58,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DetectEdges<TColor, TPacked>(this Image<TColor, TPacked> source, EdgeDetection filter, bool grayscale = true)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return DetectEdges(source, filter, source.Bounds, grayscale);
}
@ -75,7 +77,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DetectEdges<TColor, TPacked>(this Image<TColor, TPacked> source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
IEdgeDetectorProcessor<TColor, TPacked> processor;
@ -135,7 +137,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DetectEdges<TColor, TPacked>(this Image<TColor, TPacked> source, IEdgeDetectorProcessor<TColor, TPacked> filter)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return DetectEdges(source, source.Bounds, filter);
}
@ -153,7 +155,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> DetectEdges<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle, IEdgeDetectorProcessor<TColor, TPacked> filter)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, filter);
}

6
src/ImageSharp/Filters/Convolution/GaussianBlur.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> GaussianBlur<TColor, TPacked>(this Image<TColor, TPacked> source, float sigma = 3f)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return GaussianBlur(source, sigma, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> GaussianBlur<TColor, TPacked>(this Image<TColor, TPacked> source, float sigma, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new GaussianBlurProcessor<TColor, TPacked>(sigma));
}

6
src/ImageSharp/Filters/Convolution/GaussianSharpen.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> GaussianSharpen<TColor, TPacked>(this Image<TColor, TPacked> source, float sigma = 3f)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return GaussianSharpen(source, sigma, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> GaussianSharpen<TColor, TPacked>(this Image<TColor, TPacked> source, float sigma, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new GaussianSharpenProcessor<TColor, TPacked>(sigma));
}

6
src/ImageSharp/Filters/Effects/Alpha.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Alpha<TColor, TPacked>(this Image<TColor, TPacked> source, int percent)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Alpha(source, percent, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image"/>.</returns>
public static Image<TColor, TPacked> Alpha<TColor, TPacked>(this Image<TColor, TPacked> source, int percent, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new AlphaProcessor<TColor, TPacked>(percent));
}

4
src/ImageSharp/Filters/Effects/BackgroundColor.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> BackgroundColor<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(source.Bounds, new BackgroundColorProcessor<TColor, TPacked>(color));
}

6
src/ImageSharp/Filters/Effects/Brightness.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Brightness<TColor, TPacked>(this Image<TColor, TPacked> source, int amount)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Brightness(source, amount, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Brightness<TColor, TPacked>(this Image<TColor, TPacked> source, int amount, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new BrightnessProcessor<TColor, TPacked>(amount));
}

6
src/ImageSharp/Filters/Effects/Contrast.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -22,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Contrast<TColor, TPacked>(this Image<TColor, TPacked> source, int amount)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Contrast(source, amount, source.Bounds);
}
@ -40,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Contrast<TColor, TPacked>(this Image<TColor, TPacked> source, int amount, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new ContrastProcessor<TColor, TPacked>(amount));
}

6
src/ImageSharp/Filters/Effects/Invert.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image"/>.</returns>
public static Image<TColor, TPacked> Invert<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Invert(source, source.Bounds);
}
@ -38,7 +40,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image"/>.</returns>
public static Image<TColor, TPacked> Invert<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return source.Process(rectangle, new InvertProcessor<TColor, TPacked>());
}

4
src/ImageSharp/Filters/Effects/OilPainting.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> OilPaint<TColor, TPacked>(this Image<TColor, TPacked> source, int levels = 10, int brushSize = 15)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return OilPaint(source, levels, brushSize, source.Bounds);
}
@ -44,7 +44,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> OilPaint<TColor, TPacked>(this Image<TColor, TPacked> source, int levels, int brushSize, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
Guard.MustBeGreaterThan(levels, 0, nameof(levels));

4
src/ImageSharp/Filters/Effects/Pixelate.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Pixelate<TColor, TPacked>(this Image<TColor, TPacked> source, int size = 4)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Pixelate(source, size, source.Bounds);
}
@ -42,7 +42,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Pixelate<TColor, TPacked>(this Image<TColor, TPacked> source, int size, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
if (size <= 0 || size > source.Height || size > source.Width)
{

12
src/ImageSharp/Filters/Overlays/Glow.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Glow<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Glow(source, default(TColor), source.Bounds.Width * .5F, source.Bounds);
}
@ -36,7 +38,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Glow<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Glow(source, color, source.Bounds.Width * .5F, source.Bounds);
}
@ -51,7 +53,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Glow<TColor, TPacked>(this Image<TColor, TPacked> source, float radius)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Glow(source, default(TColor), radius, source.Bounds);
}
@ -68,7 +70,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Glow<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Glow(source, default(TColor), 0, rectangle);
}
@ -87,7 +89,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Glow<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float radius, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
GlowProcessor<TColor, TPacked> processor = new GlowProcessor<TColor, TPacked> { Radius = radius, };

12
src/ImageSharp/Filters/Overlays/Vignette.cs

@ -5,6 +5,8 @@
namespace ImageSharp
{
using System;
using Processors;
/// <summary>
@ -21,7 +23,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Vignette<TColor, TPacked>(this Image<TColor, TPacked> source)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Vignette(source, default(TColor), source.Bounds.Width * .5F, source.Bounds.Height * .5F, source.Bounds);
}
@ -36,7 +38,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Vignette<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Vignette(source, color, source.Bounds.Width * .5F, source.Bounds.Height * .5F, source.Bounds);
}
@ -52,7 +54,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Vignette<TColor, TPacked>(this Image<TColor, TPacked> source, float radiusX, float radiusY)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Vignette(source, default(TColor), radiusX, radiusY, source.Bounds);
}
@ -69,7 +71,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Vignette<TColor, TPacked>(this Image<TColor, TPacked> source, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
return Vignette(source, default(TColor), 0, 0, rectangle);
}
@ -89,7 +91,7 @@ namespace ImageSharp
/// <returns>The <see cref="Image{TColor, TPacked}"/>.</returns>
public static Image<TColor, TPacked> Vignette<TColor, TPacked>(this Image<TColor, TPacked> source, TColor color, float radiusX, float radiusY, Rectangle rectangle)
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
VignetteProcessor<TColor, TPacked> processor = new VignetteProcessor<TColor, TPacked> { RadiusX = radiusX, RadiusY = radiusY };

2
src/ImageSharp/Filters/Processors/Binarization/BinaryThresholdProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class BinaryThresholdProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="BinaryThresholdProcessor{TColor, TPacked}"/> class.

3
src/ImageSharp/Filters/Processors/ColorMatrix/BlackWhiteProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class BlackWhiteProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class AchromatomalyProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class AchromatopsiaProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class DeuteranomalyProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class DeuteranopiaProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class ProtanomalyProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class ProtanopiaProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class TritanomalyProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class TritanopiaProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorMatrixFilter.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public abstract class ColorMatrixFilter<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>, IColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public abstract Matrix4x4 Matrix { get; }

3
src/ImageSharp/Filters/Processors/ColorMatrix/GrayscaleBt601Processor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class GrayscaleBt601Processor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/GrayscaleBt709Processor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class GrayscaleBt709Processor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

2
src/ImageSharp/Filters/Processors/ColorMatrix/HueProcessor.cs

@ -15,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class HueProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="HueProcessor{TColor, TPacked}"/> class.

3
src/ImageSharp/Filters/Processors/ColorMatrix/IColorMatrixFilter.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public interface IColorMatrixFilter<TColor, TPacked> : IImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Gets the <see cref="Matrix4x4"/> used to alter the image.

3
src/ImageSharp/Filters/Processors/ColorMatrix/KodachromeProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class KodachromeProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/LomographProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class LomographProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/PolaroidProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class PolaroidProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4()

3
src/ImageSharp/Filters/Processors/ColorMatrix/SaturationProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -14,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class SaturationProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="SaturationProcessor{TColor, TPacked}"/> class.

3
src/ImageSharp/Filters/Processors/ColorMatrix/SepiaProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
/// <summary>
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class SepiaProcessor<TColor, TPacked> : ColorMatrixFilter<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public override Matrix4x4 Matrix => new Matrix4x4

4
src/ImageSharp/Filters/Processors/Convolution/BoxBlurProcessor.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Processors
{
using System;
/// <summary>
/// Applies a Box blur sampler to the image.
/// </summary>
@ -12,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class BoxBlurProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The maximum size of the kernel in either direction.

2
src/ImageSharp/Filters/Processors/Convolution/Convolution2DProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class Convolution2DProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="Convolution2DProcessor{TColor,TPacked}"/> class.

3
src/ImageSharp/Filters/Processors/Convolution/Convolution2PassProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
using System.Threading.Tasks;
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class Convolution2PassProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="Convolution2PassProcessor{TColor,TPacked}"/> class.

3
src/ImageSharp/Filters/Processors/Convolution/ConvolutionProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Numerics;
using System.Threading.Tasks;
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class ConvolutionProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="ConvolutionProcessor{TColor,TPacked}"/> class.

4
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Processors
{
using System;
/// <summary>
/// Defines a sampler that detects edges within an image using two one-dimensional matrices.
/// </summary>
@ -12,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public abstract class EdgeDetector2DProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>, IEdgeDetectorProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Gets the horizontal gradient operator.

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public abstract class EdgeDetectorCompassProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>, IEdgeDetectorProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Gets the North gradient operator

4
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Processors
{
using System;
/// <summary>
/// Defines a sampler that detects edges within an image using a single two dimensional matrix.
/// </summary>
@ -12,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public abstract class EdgeDetectorProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>, IEdgeDetectorProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public bool Grayscale { get; set; }

4
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Processors
{
using System;
/// <summary>
/// Provides properties and methods allowing the detection of edges within an image.
/// </summary>
@ -12,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public interface IEdgeDetectorProcessor<TColor, TPacked> : IImageFilteringProcessor<TColor, TPacked>, IEdgeDetectorProcessor
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
}

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class KayyaliProcessor<TColor, TPacked> : EdgeDetector2DProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The horizontal gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/KirschProcessor.cs

@ -4,6 +4,7 @@
// </copyright>
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class KirschProcessor<TColor, TPacked> : EdgeDetectorCompassProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The North gradient operator

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class Laplacian3X3Processor<TColor, TPacked> : EdgeDetectorProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The 2d gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class Laplacian5X5Processor<TColor, TPacked> : EdgeDetectorProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The 2d gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class LaplacianOfGaussianProcessor<TColor, TPacked> : EdgeDetectorProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The 2d gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/PrewittProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class PrewittProcessor<TColor, TPacked> : EdgeDetector2DProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The horizontal gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class RobertsCrossProcessor<TColor, TPacked> : EdgeDetector2DProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The horizontal gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs

@ -4,6 +4,7 @@
// </copyright>
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -15,7 +16,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class RobinsonProcessor<TColor, TPacked> : EdgeDetectorCompassProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The North gradient operator

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/ScharrProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class ScharrProcessor<TColor, TPacked> : EdgeDetector2DProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The horizontal gradient operator.

3
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/SobelProcessor.cs

@ -5,6 +5,7 @@
namespace ImageSharp.Processors
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
@ -16,7 +17,7 @@ namespace ImageSharp.Processors
[SuppressMessage("ReSharper", "StaticMemberInGenericType", Justification = "We want to use only one instance of each array field for each generic type.")]
public class SobelProcessor<TColor, TPacked> : EdgeDetector2DProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The horizontal gradient operator.

2
src/ImageSharp/Filters/Processors/Convolution/GaussianBlurProcessor.cs

@ -14,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class GaussianBlurProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The maximum size of the kernel in either direction.

2
src/ImageSharp/Filters/Processors/Convolution/GaussianSharpenProcessor.cs

@ -14,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class GaussianSharpenProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The maximum size of the kernel in either direction.

2
src/ImageSharp/Filters/Processors/Effects/AlphaProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class AlphaProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="AlphaProcessor{TColor, TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Effects/BackgroundColorProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class BackgroundColorProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// The epsilon for comparing floating point numbers.

2
src/ImageSharp/Filters/Processors/Effects/BrightnessProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class BrightnessProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="BrightnessProcessor{TColor, TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Effects/ContrastProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>long, float.</example></typeparam>
public class ContrastProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="ContrastProcessor{TColor, TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Effects/InvertProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class InvertProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
protected override void OnApply(ImageBase<TColor, TPacked> source, Rectangle sourceRectangle)

2
src/ImageSharp/Filters/Processors/Effects/OilPaintingProcessor.cs

@ -17,7 +17,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class OilPaintingProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="OilPaintingProcessor{TColor,TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Effects/PixelateProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class PixelateProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="PixelateProcessor{TColor,TPacked}"/> class.

4
src/ImageSharp/Filters/Processors/IImageFilteringProcessor.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Processors
{
using System;
/// <summary>
/// Encapsulates methods to alter the pixels of an image. The processor operates on the original source pixels.
/// </summary>
@ -12,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public interface IImageFilteringProcessor<TColor, TPacked> : IImageProcessor
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Applies the process to the specified portion of the specified <see cref="ImageBase{T, TP}"/>.

2
src/ImageSharp/Filters/Processors/ImageFilteringProcessor.cs

@ -14,7 +14,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public abstract class ImageFilteringProcessor<TColor, TPacked> : ImageProcessor<TColor, TPacked>, IImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <inheritdoc/>
public void Apply(ImageBase<TColor, TPacked> source, Rectangle sourceRectangle)

2
src/ImageSharp/Filters/Processors/Overlays/GlowProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class GlowProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="GlowProcessor{TColor,TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Overlays/VignetteProcessor.cs

@ -16,7 +16,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class VignetteProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="VignetteProcessor{TColor, TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Transforms/CompandingResizeProcessor.cs

@ -17,7 +17,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class CompandingResizeProcessor<TColor, TPacked> : ResamplingWeightedProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="CompandingResizeProcessor{TColor,TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Transforms/CropProcessor.cs

@ -15,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class CropProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="CropProcessor{TColor,TPacked}"/> class.

4
src/ImageSharp/Filters/Processors/Transforms/EntropyCropProcessor.cs

@ -5,6 +5,8 @@
namespace ImageSharp.Processors
{
using System;
/// <summary>
/// Provides methods to allow the cropping of an image to preserve areas of highest
/// entropy.
@ -13,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class EntropyCropProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="EntropyCropProcessor{TColor, TPacked}"/> class.

2
src/ImageSharp/Filters/Processors/Transforms/FlipProcessor.cs

@ -15,7 +15,7 @@ namespace ImageSharp.Processors
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
public class FlipProcessor<TColor, TPacked> : ImageFilteringProcessor<TColor, TPacked>
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
where TPacked : struct, IEquatable<TPacked>
{
/// <summary>
/// Initializes a new instance of the <see cref="FlipProcessor{TColor, TPacked}"/> class.

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save