Browse Source

internalise cloning processor + rename context

pull/275/head
Scott Williams 9 years ago
parent
commit
7635558f9b
  1. 2
      samples/AvatarWithRoundedCorner/Program.cs
  2. 12
      src/ImageSharp.Drawing/DrawImage.cs
  3. 14
      src/ImageSharp.Drawing/FillRegion.cs
  4. 12
      src/ImageSharp.Drawing/Paths/DrawBeziers.cs
  5. 12
      src/ImageSharp.Drawing/Paths/DrawLines.cs
  6. 12
      src/ImageSharp.Drawing/Paths/DrawPath.cs
  7. 12
      src/ImageSharp.Drawing/Paths/DrawPathCollection.cs
  8. 12
      src/ImageSharp.Drawing/Paths/DrawPolygon.cs
  9. 12
      src/ImageSharp.Drawing/Paths/DrawRectangle.cs
  10. 8
      src/ImageSharp.Drawing/Paths/FillPathBuilder.cs
  11. 8
      src/ImageSharp.Drawing/Paths/FillPathCollection.cs
  12. 8
      src/ImageSharp.Drawing/Paths/FillPaths.cs
  13. 8
      src/ImageSharp.Drawing/Paths/FillPolygon.cs
  14. 8
      src/ImageSharp.Drawing/Paths/FillRectangle.cs
  15. 16
      src/ImageSharp.Drawing/Text/DrawText.Path.cs
  16. 16
      src/ImageSharp.Drawing/Text/DrawText.cs
  17. 14
      src/ImageSharp/ApplyProcessors.cs
  18. 2
      src/ImageSharp/Configuration.cs
  19. 14
      src/ImageSharp/DefaultInternalImageProcessorContext.cs
  20. 10
      src/ImageSharp/IImageProcessingContextFactory.cs
  21. 8
      src/ImageSharp/IImageProcessingContext{TPixel}.cs
  22. 4
      src/ImageSharp/Image/ICloneingImageProcessor.cs
  23. 4
      src/ImageSharp/Processing/Binarization/BinaryThreshold.cs
  24. 12
      src/ImageSharp/Processing/Binarization/Dither.cs
  25. 4
      src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs
  26. 4
      src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs
  27. 8
      src/ImageSharp/Processing/ColorMatrix/Grayscale.cs
  28. 4
      src/ImageSharp/Processing/ColorMatrix/Hue.cs
  29. 4
      src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs
  30. 8
      src/ImageSharp/Processing/ColorMatrix/Lomograph.cs
  31. 8
      src/ImageSharp/Processing/ColorMatrix/Polaroid.cs
  32. 4
      src/ImageSharp/Processing/ColorMatrix/Saturation.cs
  33. 4
      src/ImageSharp/Processing/ColorMatrix/Sepia.cs
  34. 6
      src/ImageSharp/Processing/Convolution/BoxBlur.cs
  35. 14
      src/ImageSharp/Processing/Convolution/DetectEdges.cs
  36. 6
      src/ImageSharp/Processing/Convolution/GaussianBlur.cs
  37. 6
      src/ImageSharp/Processing/Convolution/GaussianSharpen.cs
  38. 2
      src/ImageSharp/Processing/Delegate.cs
  39. 4
      src/ImageSharp/Processing/Effects/Alpha.cs
  40. 8
      src/ImageSharp/Processing/Effects/BackgroundColor.cs
  41. 4
      src/ImageSharp/Processing/Effects/Brightness.cs
  42. 4
      src/ImageSharp/Processing/Effects/Contrast.cs
  43. 4
      src/ImageSharp/Processing/Effects/Invert.cs
  44. 8
      src/ImageSharp/Processing/Effects/OilPainting.cs
  45. 6
      src/ImageSharp/Processing/Effects/Pixelate.cs
  46. 24
      src/ImageSharp/Processing/Overlays/Glow.cs
  47. 24
      src/ImageSharp/Processing/Overlays/Vignette.cs
  48. 2
      src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs
  49. 2
      src/ImageSharp/Processing/Transforms/AutoOrient.cs
  50. 4
      src/ImageSharp/Processing/Transforms/Crop.cs
  51. 2
      src/ImageSharp/Processing/Transforms/EntropyCrop.cs
  52. 2
      src/ImageSharp/Processing/Transforms/Flip.cs
  53. 2
      src/ImageSharp/Processing/Transforms/Pad.cs
  54. 18
      src/ImageSharp/Processing/Transforms/Resize.cs
  55. 6
      src/ImageSharp/Processing/Transforms/Rotate.cs
  56. 2
      src/ImageSharp/Processing/Transforms/RotateFlip.cs
  57. 4
      src/ImageSharp/Processing/Transforms/Skew.cs
  58. 4
      src/ImageSharp/Quantizers/Quantize.cs
  59. 14
      tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs
  60. 10
      tests/ImageSharp.Tests/FakeImageOperationsProvider.cs
  61. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs

2
samples/AvatarWithRoundedCorner/Program.cs

@ -36,7 +36,7 @@ namespace AvatarWithRoundedCorner
}
// lets create our custom image mutating pipeline
private static IImageProcessorApplicator<Rgba32> ConvertToAvatar(this IImageProcessorApplicator<Rgba32> operations, Size size, float cornerRadius)
private static IImageProcessingContext<Rgba32> ConvertToAvatar(this IImageProcessingContext<Rgba32> operations, Size size, float cornerRadius)
{
return operations.Resize(new ImageSharp.Processing.ResizeOptions
{

12
src/ImageSharp.Drawing/DrawImage.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="location">The location to draw the blended image.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawImage<TPixel>(this IImageProcessorApplicator<TPixel> source, Image<TPixel> image, Size size, Point location, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawImage<TPixel>(this IImageProcessingContext<TPixel> source, Image<TPixel> image, Size size, Point location, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
if (size == default(Size))
@ -49,7 +49,7 @@ namespace ImageSharp
/// <param name="image">The image to blend with the currently processing image.</param>
/// <param name="percent">The opacity of the image image to blend. Must be between 0 and 1.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Blend<TPixel>(this IImageProcessorApplicator<TPixel> source, Image<TPixel> image, float percent)
public static IImageProcessingContext<TPixel> Blend<TPixel>(this IImageProcessingContext<TPixel> source, Image<TPixel> image, float percent)
where TPixel : struct, IPixel<TPixel>
{
GraphicsOptions options = GraphicsOptions.Default;
@ -66,7 +66,7 @@ namespace ImageSharp
/// <param name="blender">The blending mode.</param>
/// <param name="percent">The opacity of the image image to blend. Must be between 0 and 1.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Blend<TPixel>(this IImageProcessorApplicator<TPixel> source, Image<TPixel> image, PixelBlenderMode blender, float percent)
public static IImageProcessingContext<TPixel> Blend<TPixel>(this IImageProcessingContext<TPixel> source, Image<TPixel> image, PixelBlenderMode blender, float percent)
where TPixel : struct, IPixel<TPixel>
{
GraphicsOptions options = GraphicsOptions.Default;
@ -83,7 +83,7 @@ namespace ImageSharp
/// <param name="image">The image to blend with the currently processing image.</param>
/// <param name="options">The options, including the blending type and belnding amount.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Blend<TPixel>(this IImageProcessorApplicator<TPixel> source, Image<TPixel> image, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Blend<TPixel>(this IImageProcessingContext<TPixel> source, Image<TPixel> image, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return DrawImage(source, image, default(Size), default(Point), options);
@ -99,7 +99,7 @@ namespace ImageSharp
/// <param name="size">The size to draw the blended image.</param>
/// <param name="location">The location to draw the blended image.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawImage<TPixel>(this IImageProcessorApplicator<TPixel> source, Image<TPixel> image, float percent, Size size, Point location)
public static IImageProcessingContext<TPixel> DrawImage<TPixel>(this IImageProcessingContext<TPixel> source, Image<TPixel> image, float percent, Size size, Point location)
where TPixel : struct, IPixel<TPixel>
{
GraphicsOptions options = GraphicsOptions.Default;
@ -118,7 +118,7 @@ namespace ImageSharp
/// <param name="size">The size to draw the blended image.</param>
/// <param name="location">The location to draw the blended image.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawImage<TPixel>(this IImageProcessorApplicator<TPixel> source, Image<TPixel> image, PixelBlenderMode blender, float percent, Size size, Point location)
public static IImageProcessingContext<TPixel> DrawImage<TPixel>(this IImageProcessingContext<TPixel> source, Image<TPixel> image, PixelBlenderMode blender, float percent, Size size, Point location)
where TPixel : struct, IPixel<TPixel>
{
GraphicsOptions options = GraphicsOptions.Default;

14
src/ImageSharp.Drawing/FillRegion.cs

@ -23,7 +23,7 @@ namespace ImageSharp
/// <param name="brush">The details how to fill the region of interest.</param>
/// <param name="options">The graphics options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.ApplyProcessor(new FillProcessor<TPixel>(brush, options));
@ -36,7 +36,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="brush">The details how to fill the region of interest.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, GraphicsOptions.Default);
@ -49,7 +49,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="color">The color.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color));
@ -64,7 +64,7 @@ namespace ImageSharp
/// <param name="region">The region.</param>
/// <param name="options">The graphics options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, Region region, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, Region region, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.ApplyProcessor(new FillRegionProcessor<TPixel>(brush, region, options));
@ -78,7 +78,7 @@ namespace ImageSharp
/// <param name="brush">The brush.</param>
/// <param name="region">The region.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, Region region)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, Region region)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, region, GraphicsOptions.Default);
@ -93,7 +93,7 @@ namespace ImageSharp
/// <param name="region">The region.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, Region region, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, Region region, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), region, options);
@ -107,7 +107,7 @@ namespace ImageSharp
/// <param name="color">The color.</param>
/// <param name="region">The region.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, Region region)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, Region region)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), region);

12
src/ImageSharp.Drawing/Paths/DrawBeziers.cs

@ -28,7 +28,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawBeziers<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawBeziers<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), new Path(new CubicBezierLineSegment(points)), options);
@ -43,7 +43,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawBeziers<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points)
public static IImageProcessingContext<TPixel> DrawBeziers<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), new Path(new CubicBezierLineSegment(points)));
@ -58,7 +58,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawBeziers<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, PointF[] points)
public static IImageProcessingContext<TPixel> DrawBeziers<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawBeziers(new SolidBrush<TPixel>(color), thickness, points);
@ -74,7 +74,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawBeziers<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawBeziers<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawBeziers(new SolidBrush<TPixel>(color), thickness, points, options);
@ -89,7 +89,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawBeziers<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawBeziers<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new Path(new CubicBezierLineSegment(points)), options);
@ -103,7 +103,7 @@ namespace ImageSharp
/// <param name="pen">The pen.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawBeziers<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, PointF[] points)
public static IImageProcessingContext<TPixel> DrawBeziers<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new Path(new CubicBezierLineSegment(points)));

12
src/ImageSharp.Drawing/Paths/DrawLines.cs

@ -28,7 +28,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawLines<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawLines<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), new Path(new LinearLineSegment(points)), options);
@ -43,7 +43,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawLines<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points)
public static IImageProcessingContext<TPixel> DrawLines<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), new Path(new LinearLineSegment(points)));
@ -58,7 +58,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawLines<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, PointF[] points)
public static IImageProcessingContext<TPixel> DrawLines<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawLines(new SolidBrush<TPixel>(color), thickness, points);
@ -74,7 +74,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>>
public static IImageProcessorApplicator<TPixel> DrawLines<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawLines<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawLines(new SolidBrush<TPixel>(color), thickness, points, options);
@ -89,7 +89,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawLines<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawLines<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new Path(new LinearLineSegment(points)), options);
@ -103,7 +103,7 @@ namespace ImageSharp
/// <param name="pen">The pen.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawLines<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, PointF[] points)
public static IImageProcessingContext<TPixel> DrawLines<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new Path(new LinearLineSegment(points)));

12
src/ImageSharp.Drawing/Paths/DrawPath.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="path">The path.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, IPath path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, IPath path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(pen.StrokeFill, new ShapePath(path, pen), options);
@ -39,7 +39,7 @@ namespace ImageSharp
/// <param name="pen">The pen.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, IPath path)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, path, GraphicsOptions.Default);
@ -55,7 +55,7 @@ namespace ImageSharp
/// <param name="path">The shape.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, IPath path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, IPath path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), path, options);
@ -70,7 +70,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, IPath path)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), path);
@ -86,7 +86,7 @@ namespace ImageSharp
/// <param name="path">The path.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, IPath path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, IPath path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new SolidBrush<TPixel>(color), thickness, path, options);
@ -101,7 +101,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, IPath path)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new SolidBrush<TPixel>(color), thickness, path);

12
src/ImageSharp.Drawing/Paths/DrawPathCollection.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="paths">The paths.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, IPathCollection paths, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, IPathCollection paths, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
foreach (IPath path in paths)
@ -44,7 +44,7 @@ namespace ImageSharp
/// <param name="pen">The pen.</param>
/// <param name="paths">The paths.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, IPathCollection paths)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, IPathCollection paths)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, paths, GraphicsOptions.Default);
@ -60,7 +60,7 @@ namespace ImageSharp
/// <param name="paths">The shapes.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, IPathCollection paths, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, IPathCollection paths, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), paths, options);
@ -75,7 +75,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="paths">The paths.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, IPathCollection paths)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, IPathCollection paths)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), paths);
@ -91,7 +91,7 @@ namespace ImageSharp
/// <param name="paths">The paths.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new SolidBrush<TPixel>(color), thickness, paths, options);
@ -106,7 +106,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="paths">The paths.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, IPathCollection paths)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, IPathCollection paths)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new SolidBrush<TPixel>(color), thickness, paths);

12
src/ImageSharp.Drawing/Paths/DrawPolygon.cs

@ -28,7 +28,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawPolygon<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), new Polygon(new LinearLineSegment(points)), options);
@ -43,7 +43,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points)
public static IImageProcessingContext<TPixel> DrawPolygon<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), new Polygon(new LinearLineSegment(points)));
@ -58,7 +58,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, PointF[] points)
public static IImageProcessingContext<TPixel> DrawPolygon<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawPolygon(new SolidBrush<TPixel>(color), thickness, points);
@ -74,7 +74,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawPolygon<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawPolygon(new SolidBrush<TPixel>(color), thickness, points, options);
@ -88,7 +88,7 @@ namespace ImageSharp
/// <param name="pen">The pen.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, PointF[] points)
public static IImageProcessingContext<TPixel> DrawPolygon<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new Polygon(new LinearLineSegment(points)), GraphicsOptions.Default);
@ -103,7 +103,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DrawPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawPolygon<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new Polygon(new LinearLineSegment(points)), options);

12
src/ImageSharp.Drawing/Paths/DrawRectangle.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="shape">The shape.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, RectangleF shape, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, RectangleF shape, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options);
@ -39,7 +39,7 @@ namespace ImageSharp
/// <param name="pen">The pen.</param>
/// <param name="shape">The shape.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IPen<TPixel> pen, RectangleF shape)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IPen<TPixel> pen, RectangleF shape)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(pen, shape, GraphicsOptions.Default);
@ -55,7 +55,7 @@ namespace ImageSharp
/// <param name="shape">The shape.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, RectangleF shape, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, RectangleF shape, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), shape, options);
@ -70,7 +70,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="shape">The shape.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, float thickness, RectangleF shape)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, float thickness, RectangleF shape)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new Pen<TPixel>(brush, thickness), shape);
@ -86,7 +86,7 @@ namespace ImageSharp
/// <param name="shape">The shape.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new SolidBrush<TPixel>(color), thickness, shape, options);
@ -101,7 +101,7 @@ namespace ImageSharp
/// <param name="thickness">The thickness.</param>
/// <param name="shape">The shape.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Draw<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float thickness, RectangleF shape)
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float thickness, RectangleF shape)
where TPixel : struct, IPixel<TPixel>
{
return source.Draw(new SolidBrush<TPixel>(color), thickness, shape);

8
src/ImageSharp.Drawing/Paths/FillPathBuilder.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="path">The shape.</param>
/// <param name="options">The graphics options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, Action<PathBuilder> path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, Action<PathBuilder> path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
var pb = new PathBuilder();
@ -42,7 +42,7 @@ namespace ImageSharp
/// <param name="brush">The brush.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, Action<PathBuilder> path)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, Action<PathBuilder> path)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, path, GraphicsOptions.Default);
@ -57,7 +57,7 @@ namespace ImageSharp
/// <param name="path">The path.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, Action<PathBuilder> path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, Action<PathBuilder> path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), path, options);
@ -71,7 +71,7 @@ namespace ImageSharp
/// <param name="color">The color.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, Action<PathBuilder> path)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, Action<PathBuilder> path)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), path);

8
src/ImageSharp.Drawing/Paths/FillPathCollection.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="paths">The shapes.</param>
/// <param name="options">The graphics options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, IPathCollection paths, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, IPathCollection paths, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
foreach (IPath s in paths)
@ -43,7 +43,7 @@ namespace ImageSharp
/// <param name="brush">The brush.</param>
/// <param name="paths">The paths.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, IPathCollection paths)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, IPathCollection paths)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, paths, GraphicsOptions.Default);
@ -58,7 +58,7 @@ namespace ImageSharp
/// <param name="paths">The paths.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, IPathCollection paths, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, IPathCollection paths, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), paths, options);
@ -72,7 +72,7 @@ namespace ImageSharp
/// <param name="color">The color.</param>
/// <param name="paths">The paths.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, IPathCollection paths)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, IPathCollection paths)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), paths);

8
src/ImageSharp.Drawing/Paths/FillPaths.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="path">The shape.</param>
/// <param name="options">The graphics options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, IPath path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, IPath path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, new ShapeRegion(path), options);
@ -38,7 +38,7 @@ namespace ImageSharp
/// <param name="brush">The brush.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, IPath path)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, new ShapeRegion(path), GraphicsOptions.Default);
@ -53,7 +53,7 @@ namespace ImageSharp
/// <param name="path">The path.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, IPath path, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, IPath path, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), path, options);
@ -67,7 +67,7 @@ namespace ImageSharp
/// <param name="color">The color.</param>
/// <param name="path">The path.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, IPath path)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), path);

8
src/ImageSharp.Drawing/Paths/FillPolygon.cs

@ -27,7 +27,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> FillPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> FillPolygon<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, new Polygon(new LinearLineSegment(points)), options);
@ -41,7 +41,7 @@ namespace ImageSharp
/// <param name="brush">The brush.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> FillPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, PointF[] points)
public static IImageProcessingContext<TPixel> FillPolygon<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, new Polygon(new LinearLineSegment(points)));
@ -56,7 +56,7 @@ namespace ImageSharp
/// <param name="points">The points.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> FillPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, PointF[] points, GraphicsOptions options)
public static IImageProcessingContext<TPixel> FillPolygon<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, PointF[] points, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), new Polygon(new LinearLineSegment(points)), options);
@ -70,7 +70,7 @@ namespace ImageSharp
/// <param name="color">The color.</param>
/// <param name="points">The points.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> FillPolygon<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, PointF[] points)
public static IImageProcessingContext<TPixel> FillPolygon<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, PointF[] points)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), new Polygon(new LinearLineSegment(points)));

8
src/ImageSharp.Drawing/Paths/FillRectangle.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="shape">The shape.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, RectangleF shape, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, RectangleF shape, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options);
@ -38,7 +38,7 @@ namespace ImageSharp
/// <param name="brush">The brush.</param>
/// <param name="shape">The shape.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, IBrush<TPixel> brush, RectangleF shape)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, RectangleF shape)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height));
@ -53,7 +53,7 @@ namespace ImageSharp
/// <param name="shape">The shape.</param>
/// <param name="options">The options.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, RectangleF shape, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, RectangleF shape, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), shape, options);
@ -67,7 +67,7 @@ namespace ImageSharp
/// <param name="color">The color.</param>
/// <param name="shape">The shape.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Fill<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, RectangleF shape)
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, RectangleF shape)
where TPixel : struct, IPixel<TPixel>
{
return source.Fill(new SolidBrush<TPixel>(color), shape);

16
src/ImageSharp.Drawing/Text/DrawText.Path.cs

@ -31,7 +31,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, TPixel color, IPath path)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, TPixel color, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, color, path, TextGraphicsOptions.Default);
@ -50,7 +50,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, Brushes.Solid(color), null, path, options);
@ -68,7 +68,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPath path)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, brush, path, TextGraphicsOptions.Default);
@ -87,7 +87,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPath path, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPath path, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, brush, null, path, options);
@ -105,7 +105,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IPen<TPixel> pen, IPath path)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IPen<TPixel> pen, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, pen, path, TextGraphicsOptions.Default);
@ -124,7 +124,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IPen<TPixel> pen, IPath path, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IPen<TPixel> pen, IPath path, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, null, pen, path, options);
@ -143,7 +143,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, IPath path)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, IPath path)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, brush, pen, path, TextGraphicsOptions.Default);
@ -163,7 +163,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, IPath path, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, IPath path, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
float dpiX = DefaultTextDpi;

16
src/ImageSharp.Drawing/Text/DrawText.cs

@ -34,7 +34,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, TPixel color, PointF location)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, TPixel color, PointF location)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, color, location, TextGraphicsOptions.Default);
@ -53,7 +53,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, Brushes.Solid(color), null, location, options);
@ -71,7 +71,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, PointF location)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, PointF location)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, brush, location, TextGraphicsOptions.Default);
@ -90,7 +90,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, PointF location, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, PointF location, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, brush, null, location, options);
@ -108,7 +108,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IPen<TPixel> pen, PointF location)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IPen<TPixel> pen, PointF location)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, pen, location, TextGraphicsOptions.Default);
@ -127,7 +127,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IPen<TPixel> pen, PointF location, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IPen<TPixel> pen, PointF location, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, null, pen, location, options);
@ -146,7 +146,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, PointF location)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, PointF location)
where TPixel : struct, IPixel<TPixel>
{
return source.DrawText(text, font, brush, pen, location, TextGraphicsOptions.Default);
@ -166,7 +166,7 @@ namespace ImageSharp
/// <returns>
/// The <see cref="Image{TPixel}" />.
/// </returns>
public static IImageProcessorApplicator<TPixel> DrawText<TPixel>(this IImageProcessorApplicator<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, PointF location, TextGraphicsOptions options)
public static IImageProcessingContext<TPixel> DrawText<TPixel>(this IImageProcessingContext<TPixel> source, string text, Font font, IBrush<TPixel> brush, IPen<TPixel> pen, PointF location, TextGraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
float dpiX = DefaultTextDpi;

14
src/ImageSharp/ApplyProcessors.cs

@ -22,13 +22,13 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image to rotate, flip, or both.</param>
/// <param name="operations">The operations to perform on the source.</param>
public static void Mutate<TPixel>(this Image<TPixel> source, Action<IImageProcessorApplicator<TPixel>> operations)
public static void Mutate<TPixel>(this Image<TPixel> source, Action<IImageProcessingContext<TPixel>> operations)
where TPixel : struct, IPixel<TPixel>
{
Guard.NotNull(operations, nameof(operations));
Guard.NotNull(source, nameof(source));
IInternalImageProcessorApplicator<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, true);
IInternalImageProcessingContext<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, true);
operations(operationsRunner);
operationsRunner.Apply();
}
@ -45,7 +45,7 @@ namespace ImageSharp
Guard.NotNull(operations, nameof(operations));
Guard.NotNull(source, nameof(source));
IInternalImageProcessorApplicator<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, true);
IInternalImageProcessingContext<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, true);
operationsRunner.ApplyProcessors(operations);
operationsRunner.Apply();
}
@ -57,13 +57,13 @@ namespace ImageSharp
/// <param name="source">The image to rotate, flip, or both.</param>
/// <param name="operations">The operations to perform on the source.</param>
/// <returns>Anew Image which has teh data from the <paramref name="source"/> but with the <paramref name="operations"/> applied.</returns>
public static Image<TPixel> Clone<TPixel>(this Image<TPixel> source, Action<IImageProcessorApplicator<TPixel>> operations)
public static Image<TPixel> Clone<TPixel>(this Image<TPixel> source, Action<IImageProcessingContext<TPixel>> operations)
where TPixel : struct, IPixel<TPixel>
{
Guard.NotNull(operations, nameof(operations));
Guard.NotNull(source, nameof(source));
IInternalImageProcessorApplicator<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, false);
IInternalImageProcessingContext<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, false);
operations(operationsRunner);
return operationsRunner.Apply();
}
@ -81,7 +81,7 @@ namespace ImageSharp
Guard.NotNull(operations, nameof(operations));
Guard.NotNull(source, nameof(source));
IInternalImageProcessorApplicator<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, false);
IInternalImageProcessingContext<TPixel> operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, false);
operationsRunner.ApplyProcessors(operations);
return operationsRunner.Apply();
}
@ -93,7 +93,7 @@ namespace ImageSharp
/// <param name="source">The image to rotate, flip, or both.</param>
/// <param name="operations">The operations to perform on the source.</param>
/// <returns>returns the current optinoatins class to allow chaining of oprations.</returns>
public static IImageProcessorApplicator<TPixel> ApplyProcessors<TPixel>(this IImageProcessorApplicator<TPixel> source, params IImageProcessor<TPixel>[] operations)
public static IImageProcessingContext<TPixel> ApplyProcessors<TPixel>(this IImageProcessingContext<TPixel> source, params IImageProcessor<TPixel>[] operations)
where TPixel : struct, IPixel<TPixel>
{
foreach (IImageProcessor<TPixel> p in operations)

2
src/ImageSharp/Configuration.cs

@ -111,7 +111,7 @@ namespace ImageSharp
/// <summary>
/// Gets or sets the image operations providers.
/// </summary>
internal IImageProcessorApplicatorFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider();
internal IImageProcessingContextFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider();
/// <summary>
/// Registers a new format provider.

14
src/ImageSharp/DefaultInternalImageProcessorApplicator.cs → src/ImageSharp/DefaultInternalImageProcessorContext.cs

@ -15,7 +15,7 @@ namespace ImageSharp
/// The static collection of all the default image formats
/// </summary>
/// <typeparam name="TPixel">The pixel format</typeparam>
internal class DefaultInternalImageProcessorApplicator<TPixel> : IInternalImageProcessorApplicator<TPixel>
internal class DefaultInternalImageProcessorContext<TPixel> : IInternalImageProcessingContext<TPixel>
where TPixel : struct, IPixel<TPixel>
{
private readonly bool mutate;
@ -23,11 +23,11 @@ namespace ImageSharp
private Image<TPixel> destination;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultInternalImageProcessorApplicator{TPixel}"/> class.
/// Initializes a new instance of the <see cref="DefaultInternalImageProcessorContext{TPixel}"/> class.
/// </summary>
/// <param name="source">The image.</param>
/// <param name="mutate">The mutate.</param>
public DefaultInternalImageProcessorApplicator(Image<TPixel> source, bool mutate)
public DefaultInternalImageProcessorContext(Image<TPixel> source, bool mutate)
{
this.mutate = mutate;
this.source = source;
@ -50,16 +50,16 @@ namespace ImageSharp
}
/// <inheritdoc/>
public IImageProcessorApplicator<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor, Rectangle rectangle)
public IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor, Rectangle rectangle)
{
if (!this.mutate && this.destination == null)
{
// this will only work if the first processor applied is the cloning one thus
// realistically for this optermissation to work the resize must the first processor
// applied any only up processors will take the douple data path.
if (processor is ICloningImageProcessor<TPixel>)
if (processor is ICloneingImageProcessor<TPixel>)
{
var cloningProcessor = (ICloningImageProcessor<TPixel>)processor;
var cloningProcessor = (ICloneingImageProcessor<TPixel>)processor;
this.destination = cloningProcessor.CloneAndApply(this.source, rectangle);
return this;
}
@ -74,7 +74,7 @@ namespace ImageSharp
}
/// <inheritdoc/>
public IImageProcessorApplicator<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor)
public IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor)
{
return this.ApplyProcessor(processor, this.source.Bounds());
}

10
src/ImageSharp/IImageProcessorApplicatorFactory.cs → src/ImageSharp/IImageProcessingContextFactory.cs

@ -11,7 +11,7 @@ namespace ImageSharp
/// <summary>
/// Represents an interface that will create IImageOperations
/// </summary>
internal interface IImageProcessorApplicatorFactory
internal interface IImageProcessingContextFactory
{
/// <summary>
/// Called during Mutate operations to generate the imageoperations provider.
@ -20,20 +20,20 @@ namespace ImageSharp
/// <param name="source">The source image.</param>
/// <param name="mutate">A flag to determin with the image operations is allowed to mutate the source image or not.</param>
/// <returns>A new IImageOPeration</returns>
IInternalImageProcessorApplicator<TPixel> CreateImageOperations<TPixel>(Image<TPixel> source, bool mutate)
IInternalImageProcessingContext<TPixel> CreateImageProcessingContext<TPixel>(Image<TPixel> source, bool mutate)
where TPixel : struct, IPixel<TPixel>;
}
/// <summary>
/// The default implmentation of IImageOperationsProvider
/// </summary>
internal class DefaultImageOperationsProvider : IImageProcessorApplicatorFactory
internal class DefaultImageOperationsProvider : IImageProcessingContextFactory
{
/// <inheritdoc/>
public IInternalImageProcessorApplicator<TPixel> CreateImageOperations<TPixel>(Image<TPixel> source, bool mutate)
public IInternalImageProcessingContext<TPixel> CreateImageProcessingContext<TPixel>(Image<TPixel> source, bool mutate)
where TPixel : struct, IPixel<TPixel>
{
return new DefaultInternalImageProcessorApplicator<TPixel>(source, mutate);
return new DefaultInternalImageProcessorContext<TPixel>(source, mutate);
}
}
}

8
src/ImageSharp/IImageProcessorApplicator{TPixel}.cs → src/ImageSharp/IImageProcessingContext{TPixel}.cs

@ -15,7 +15,7 @@ namespace ImageSharp
/// An interface to queue up image operations.
/// </summary>
/// <typeparam name="TPixel">The pixel format</typeparam>
public interface IImageProcessorApplicator<TPixel>
public interface IImageProcessingContext<TPixel>
where TPixel : struct, IPixel<TPixel>
{
/// <summary>
@ -24,21 +24,21 @@ namespace ImageSharp
/// <param name="processor">The processor to apply</param>
/// <param name="rectangle">The area to apply it to</param>
/// <returns>returns the current optinoatins class to allow chaining of oprations.</returns>
IImageProcessorApplicator<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor, Rectangle rectangle);
IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor, Rectangle rectangle);
/// <summary>
/// Adds the processor to the current setr of image operations to be applied.
/// </summary>
/// <param name="processor">The processor to apply</param>
/// <returns>returns the current optinoatins class to allow chaining of oprations.</returns>
IImageProcessorApplicator<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor);
IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor);
}
/// <summary>
/// An internal interface to queue up image operations and have a method to apply them to and return a result
/// </summary>
/// <typeparam name="TPixel">The pixel format</typeparam>
public interface IInternalImageProcessorApplicator<TPixel> : IImageProcessorApplicator<TPixel>
internal interface IInternalImageProcessingContext<TPixel> : IImageProcessingContext<TPixel>
where TPixel : struct, IPixel<TPixel>
{
/// <summary>

4
src/ImageSharp/Image/ICloningImageProcessor.cs → src/ImageSharp/Image/ICloneingImageProcessor.cs

@ -1,4 +1,4 @@
// <copyright file="IImageProcessor.cs" company="James Jackson-South">
// <copyright file="ICloneingImageProcessor.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
@ -15,7 +15,7 @@ namespace ImageSharp.Processing
/// Encapsulates methods to alter the pixels of an image.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
public interface ICloningImageProcessor<TPixel> : IImageProcessor<TPixel>
internal interface ICloneingImageProcessor<TPixel> : IImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel>
{
/// <summary>

4
src/ImageSharp/Processing/Binarization/BinaryThreshold.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="threshold">The threshold to apply binarization of the image. Must be between 0 and 1.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BinaryThreshold<TPixel>(this IImageProcessorApplicator<TPixel> source, float threshold)
public static IImageProcessingContext<TPixel> BinaryThreshold<TPixel>(this IImageProcessingContext<TPixel> source, float threshold)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new BinaryThresholdProcessor<TPixel>(threshold));
@ -41,7 +41,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BinaryThreshold<TPixel>(this IImageProcessorApplicator<TPixel> source, float threshold, Rectangle rectangle)
public static IImageProcessingContext<TPixel> BinaryThreshold<TPixel>(this IImageProcessingContext<TPixel> source, float threshold, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new BinaryThresholdProcessor<TPixel>(threshold), rectangle);

12
src/ImageSharp/Processing/Binarization/Dither.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="dither">The ordered ditherer.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Dither<TPixel>(this IImageProcessorApplicator<TPixel> source, IOrderedDither dither)
public static IImageProcessingContext<TPixel> Dither<TPixel>(this IImageProcessingContext<TPixel> source, IOrderedDither dither)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new OrderedDitherProcessor<TPixel>(dither, 0));
@ -39,7 +39,7 @@ namespace ImageSharp
/// <param name="dither">The ordered ditherer.</param>
/// <param name="index">The component index to test the threshold against. Must range from 0 to 3.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Dither<TPixel>(this IImageProcessorApplicator<TPixel> source, IOrderedDither dither, int index)
public static IImageProcessingContext<TPixel> Dither<TPixel>(this IImageProcessingContext<TPixel> source, IOrderedDither dither, int index)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new OrderedDitherProcessor<TPixel>(dither, index));
@ -56,7 +56,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Dither<TPixel>(this IImageProcessorApplicator<TPixel> source, IOrderedDither dither, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Dither<TPixel>(this IImageProcessingContext<TPixel> source, IOrderedDither dither, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new OrderedDitherProcessor<TPixel>(dither, 0), rectangle);
@ -74,7 +74,7 @@ namespace ImageSharp
/// </param>
/// <param name="index">The component index to test the threshold against. Must range from 0 to 3.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Dither<TPixel>(this IImageProcessorApplicator<TPixel> source, IOrderedDither dither, Rectangle rectangle, int index)
public static IImageProcessingContext<TPixel> Dither<TPixel>(this IImageProcessingContext<TPixel> source, IOrderedDither dither, Rectangle rectangle, int index)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new OrderedDitherProcessor<TPixel>(dither, index), rectangle);
@ -89,7 +89,7 @@ namespace ImageSharp
/// <param name="diffuser">The diffusion algorithm to apply.</param>
/// <param name="threshold">The threshold to apply binarization of the image. Must be between 0 and 1.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Dither<TPixel>(this IImageProcessorApplicator<TPixel> source, IErrorDiffuser diffuser, float threshold)
public static IImageProcessingContext<TPixel> Dither<TPixel>(this IImageProcessingContext<TPixel> source, IErrorDiffuser diffuser, float threshold)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new ErrorDiffusionDitherProcessor<TPixel>(diffuser, threshold));
@ -107,7 +107,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Dither<TPixel>(this IImageProcessorApplicator<TPixel> source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Dither<TPixel>(this IImageProcessingContext<TPixel> source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new ErrorDiffusionDitherProcessor<TPixel>(diffuser, threshold), rectangle);

4
src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BlackWhite<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> BlackWhite<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new BlackWhiteProcessor<TPixel>());
@ -40,7 +40,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BlackWhite<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> BlackWhite<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new BlackWhiteProcessor<TPixel>(), rectangle);

4
src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="colorBlindness">The type of color blindness simulator to apply.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> ColorBlindness<TPixel>(this IImageProcessorApplicator<TPixel> source, ColorBlindness colorBlindness)
public static IImageProcessingContext<TPixel> ColorBlindness<TPixel>(this IImageProcessingContext<TPixel> source, ColorBlindness colorBlindness)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(GetProcessor<TPixel>(colorBlindness));
@ -42,7 +42,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> ColorBlindness<TPixel>(this IImageProcessorApplicator<TPixel> source, ColorBlindness colorBlindness, Rectangle rectangle)
public static IImageProcessingContext<TPixel> ColorBlindness<TPixel>(this IImageProcessingContext<TPixel> source, ColorBlindness colorBlindness, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(GetProcessor<TPixel>(colorBlindness), rectangle);

8
src/ImageSharp/Processing/ColorMatrix/Grayscale.cs

@ -22,7 +22,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Grayscale<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Grayscale<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return Grayscale(source, GrayscaleMode.Bt709);
@ -35,7 +35,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="mode">The formula to apply to perform the operation.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Grayscale<TPixel>(this IImageProcessorApplicator<TPixel> source, GrayscaleMode mode)
public static IImageProcessingContext<TPixel> Grayscale<TPixel>(this IImageProcessingContext<TPixel> source, GrayscaleMode mode)
where TPixel : struct, IPixel<TPixel>
{
IImageProcessor<TPixel> processor = mode == GrayscaleMode.Bt709
@ -55,7 +55,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Grayscale<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Grayscale<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return Grayscale(source, GrayscaleMode.Bt709, rectangle);
@ -71,7 +71,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Grayscale<TPixel>(this IImageProcessorApplicator<TPixel> source, GrayscaleMode mode, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Grayscale<TPixel>(this IImageProcessingContext<TPixel> source, GrayscaleMode mode, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
IImageProcessor<TPixel> processor = mode == GrayscaleMode.Bt709

4
src/ImageSharp/Processing/ColorMatrix/Hue.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="degrees">The angle in degrees to adjust the image.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Hue<TPixel>(this IImageProcessorApplicator<TPixel> source, float degrees)
public static IImageProcessingContext<TPixel> Hue<TPixel>(this IImageProcessingContext<TPixel> source, float degrees)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new HueProcessor<TPixel>(degrees));
@ -42,7 +42,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Hue<TPixel>(this IImageProcessorApplicator<TPixel> source, float degrees, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Hue<TPixel>(this IImageProcessingContext<TPixel> source, float degrees, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new HueProcessor<TPixel>(degrees), rectangle);

4
src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Kodachrome<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Kodachrome<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new KodachromeProcessor<TPixel>());
@ -40,7 +40,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Kodachrome<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Kodachrome<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new KodachromeProcessor<TPixel>(), rectangle);

8
src/ImageSharp/Processing/ColorMatrix/Lomograph.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Lomograph<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Lomograph<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return Lomograph(source, GraphicsOptions.Default);
@ -39,7 +39,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Lomograph<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Lomograph<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return Lomograph(source, rectangle, GraphicsOptions.Default);
@ -52,7 +52,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Lomograph<TPixel>(this IImageProcessorApplicator<TPixel> source, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Lomograph<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new LomographProcessor<TPixel>(options));
@ -69,7 +69,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Lomograph<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Lomograph<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new LomographProcessor<TPixel>(options), rectangle);

8
src/ImageSharp/Processing/ColorMatrix/Polaroid.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Polaroid<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Polaroid<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return Polaroid(source, GraphicsOptions.Default);
@ -39,7 +39,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Polaroid<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Polaroid<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return Polaroid(source, rectangle, GraphicsOptions.Default);
@ -52,7 +52,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Polaroid<TPixel>(this IImageProcessorApplicator<TPixel> source, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Polaroid<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new PolaroidProcessor<TPixel>(options));
@ -69,7 +69,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Polaroid<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Polaroid<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new PolaroidProcessor<TPixel>(options), rectangle);

4
src/ImageSharp/Processing/ColorMatrix/Saturation.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="amount">The new saturation of the image. Must be between -100 and 100.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Saturation<TPixel>(this IImageProcessorApplicator<TPixel> source, int amount)
public static IImageProcessingContext<TPixel> Saturation<TPixel>(this IImageProcessingContext<TPixel> source, int amount)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new SaturationProcessor<TPixel>(amount));
@ -42,7 +42,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Saturation<TPixel>(this IImageProcessorApplicator<TPixel> source, int amount, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Saturation<TPixel>(this IImageProcessingContext<TPixel> source, int amount, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(new SaturationProcessor<TPixel>(amount), rectangle);

4
src/ImageSharp/Processing/ColorMatrix/Sepia.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Sepia<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Sepia<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new SepiaProcessor<TPixel>());
@ -37,7 +37,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Sepia<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Sepia<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new SepiaProcessor<TPixel>(), rectangle);
}

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

@ -23,7 +23,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BoxBlur<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> BoxBlur<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BoxBlurProcessor<TPixel>(7));
@ -34,7 +34,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="radius">The 'radius' value representing the size of the area to sample.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BoxBlur<TPixel>(this IImageProcessorApplicator<TPixel> source, int radius)
public static IImageProcessingContext<TPixel> BoxBlur<TPixel>(this IImageProcessingContext<TPixel> source, int radius)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BoxBlurProcessor<TPixel>(radius));
@ -48,7 +48,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BoxBlur<TPixel>(this IImageProcessorApplicator<TPixel> source, int radius, Rectangle rectangle)
public static IImageProcessingContext<TPixel> BoxBlur<TPixel>(this IImageProcessingContext<TPixel> source, int radius, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BoxBlurProcessor<TPixel>(radius), rectangle);
}

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

@ -25,7 +25,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return DetectEdges(source, new SobelProcessor<TPixel> { Grayscale = true });
@ -41,7 +41,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return DetectEdges(source, rectangle, new SobelProcessor<TPixel> { Grayscale = true });
@ -54,7 +54,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="filter">The filter for detecting edges.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source, EdgeDetection filter)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source, EdgeDetection filter)
where TPixel : struct, IPixel<TPixel>
=> DetectEdges(source, GetProcessor<TPixel>(filter, true));
@ -66,7 +66,7 @@ namespace ImageSharp
/// <param name="filter">The filter for detecting edges.</param>
/// <param name="grayscale">Whether to convert the image to Grayscale first. Defaults to true.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source, EdgeDetection filter, bool grayscale)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source, EdgeDetection filter, bool grayscale)
where TPixel : struct, IPixel<TPixel>
=> DetectEdges(source, GetProcessor<TPixel>(filter, grayscale));
@ -81,7 +81,7 @@ namespace ImageSharp
/// </param>
/// <param name="grayscale">Whether to convert the image to Grayscale first. Defaults to true.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true)
where TPixel : struct, IPixel<TPixel>
=> DetectEdges(source, rectangle, GetProcessor<TPixel>(filter, grayscale));
@ -92,7 +92,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="filter">The filter for detecting edges.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source, IEdgeDetectorProcessor<TPixel> filter)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source, IEdgeDetectorProcessor<TPixel> filter)
where TPixel : struct, IPixel<TPixel>
{
return source.ApplyProcessor(filter);
@ -108,7 +108,7 @@ namespace ImageSharp
/// </param>
/// <param name="filter">The filter for detecting edges.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> DetectEdges<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle, IEdgeDetectorProcessor<TPixel> filter)
public static IImageProcessingContext<TPixel> DetectEdges<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle, IEdgeDetectorProcessor<TPixel> filter)
where TPixel : struct, IPixel<TPixel>
{
source.ApplyProcessor(filter, rectangle);

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

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> GaussianBlur<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> GaussianBlur<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GaussianBlurProcessor<TPixel>(3f));
@ -35,7 +35,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="sigma">The 'sigma' value representing the weight of the blur.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> GaussianBlur<TPixel>(this IImageProcessorApplicator<TPixel> source, float sigma)
public static IImageProcessingContext<TPixel> GaussianBlur<TPixel>(this IImageProcessingContext<TPixel> source, float sigma)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GaussianBlurProcessor<TPixel>(sigma));
@ -49,7 +49,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> GaussianBlur<TPixel>(this IImageProcessorApplicator<TPixel> source, float sigma, Rectangle rectangle)
public static IImageProcessingContext<TPixel> GaussianBlur<TPixel>(this IImageProcessingContext<TPixel> source, float sigma, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GaussianBlurProcessor<TPixel>(sigma), rectangle);
}

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

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> GaussianSharpen<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> GaussianSharpen<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GaussianSharpenProcessor<TPixel>(3f));
@ -35,7 +35,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="sigma">The 'sigma' value representing the weight of the blur.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> GaussianSharpen<TPixel>(this IImageProcessorApplicator<TPixel> source, float sigma)
public static IImageProcessingContext<TPixel> GaussianSharpen<TPixel>(this IImageProcessingContext<TPixel> source, float sigma)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GaussianSharpenProcessor<TPixel>(sigma));
@ -49,7 +49,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> GaussianSharpen<TPixel>(this IImageProcessorApplicator<TPixel> source, float sigma, Rectangle rectangle)
public static IImageProcessingContext<TPixel> GaussianSharpen<TPixel>(this IImageProcessingContext<TPixel> source, float sigma, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GaussianSharpenProcessor<TPixel>(sigma), rectangle);
}

2
src/ImageSharp/Processing/Delegate.cs

@ -23,7 +23,7 @@ namespace ImageSharp
/// <param name="source">The image to rotate, flip, or both.</param>
/// <param name="operation">The operations to perform on the source.</param>
/// <returns>returns the current optinoatins class to allow chaining of oprations.</returns>
public static IImageProcessorApplicator<TPixel> Run<TPixel>(this IImageProcessorApplicator<TPixel> source, Action<Image<TPixel>> operation)
public static IImageProcessingContext<TPixel> Run<TPixel>(this IImageProcessingContext<TPixel> source, Action<Image<TPixel>> operation)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new DelegateProcessor<TPixel>(operation));
}

4
src/ImageSharp/Processing/Effects/Alpha.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="percent">The new opacity of the image. Must be between 0 and 1.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Alpha<TPixel>(this IImageProcessorApplicator<TPixel> source, float percent)
public static IImageProcessingContext<TPixel> Alpha<TPixel>(this IImageProcessingContext<TPixel> source, float percent)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new AlphaProcessor<TPixel>(percent));
@ -38,7 +38,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Alpha<TPixel>(this IImageProcessorApplicator<TPixel> source, float percent, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Alpha<TPixel>(this IImageProcessingContext<TPixel> source, float percent, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new AlphaProcessor<TPixel>(percent), rectangle);
}

8
src/ImageSharp/Processing/Effects/BackgroundColor.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="color">The color to set as the background.</param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BackgroundColor<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, GraphicsOptions options)
public static IImageProcessingContext<TPixel> BackgroundColor<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BackgroundColorProcessor<TPixel>(color, options));
@ -40,7 +40,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BackgroundColor<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> BackgroundColor<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BackgroundColorProcessor<TPixel>(color, options), rectangle);
@ -51,7 +51,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="color">The color to set as the background.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BackgroundColor<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color)
public static IImageProcessingContext<TPixel> BackgroundColor<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color)
where TPixel : struct, IPixel<TPixel>
{
return BackgroundColor(source, color, GraphicsOptions.Default);
@ -67,7 +67,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> BackgroundColor<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, Rectangle rectangle)
public static IImageProcessingContext<TPixel> BackgroundColor<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return BackgroundColor(source, color, rectangle, GraphicsOptions.Default);

4
src/ImageSharp/Processing/Effects/Brightness.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="amount">The new brightness of the image. Must be between -100 and 100.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Brightness<TPixel>(this IImageProcessorApplicator<TPixel> source, int amount)
public static IImageProcessingContext<TPixel> Brightness<TPixel>(this IImageProcessingContext<TPixel> source, int amount)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BrightnessProcessor<TPixel>(amount));
@ -38,7 +38,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Brightness<TPixel>(this IImageProcessorApplicator<TPixel> source, int amount, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Brightness<TPixel>(this IImageProcessingContext<TPixel> source, int amount, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new BrightnessProcessor<TPixel>(amount), rectangle);
}

4
src/ImageSharp/Processing/Effects/Contrast.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="amount">The new contrast of the image. Must be between -100 and 100.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Contrast<TPixel>(this IImageProcessorApplicator<TPixel> source, int amount)
public static IImageProcessingContext<TPixel> Contrast<TPixel>(this IImageProcessingContext<TPixel> source, int amount)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new ContrastProcessor<TPixel>(amount));
@ -38,7 +38,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Contrast<TPixel>(this IImageProcessorApplicator<TPixel> source, int amount, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Contrast<TPixel>(this IImageProcessingContext<TPixel> source, int amount, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new ContrastProcessor<TPixel>(amount), rectangle);
}

4
src/ImageSharp/Processing/Effects/Invert.cs

@ -23,7 +23,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Invert<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Invert<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new InvertProcessor<TPixel>());
@ -36,7 +36,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Invert<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Invert<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new InvertProcessor<TPixel>(), rectangle);
}

8
src/ImageSharp/Processing/Effects/OilPainting.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> OilPaint<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> OilPaint<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return OilPaint(source, 10, 15);
@ -40,7 +40,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> OilPaint<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> OilPaint<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return OilPaint(source, 10, 15, rectangle);
@ -54,7 +54,7 @@ namespace ImageSharp
/// <param name="levels">The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image.</param>
/// <param name="brushSize">The number of neighboring pixels used in calculating each individual pixel value.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> OilPaint<TPixel>(this IImageProcessorApplicator<TPixel> source, int levels, int brushSize)
public static IImageProcessingContext<TPixel> OilPaint<TPixel>(this IImageProcessingContext<TPixel> source, int levels, int brushSize)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new OilPaintingProcessor<TPixel>(levels, brushSize));
@ -69,7 +69,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> OilPaint<TPixel>(this IImageProcessorApplicator<TPixel> source, int levels, int brushSize, Rectangle rectangle)
public static IImageProcessingContext<TPixel> OilPaint<TPixel>(this IImageProcessingContext<TPixel> source, int levels, int brushSize, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new OilPaintingProcessor<TPixel>(levels, brushSize), rectangle);
}

6
src/ImageSharp/Processing/Effects/Pixelate.cs

@ -23,7 +23,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Pixelate<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Pixelate<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new PixelateProcessor<TPixel>(4));
@ -34,7 +34,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="size">The size of the pixels.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Pixelate<TPixel>(this IImageProcessorApplicator<TPixel> source, int size)
public static IImageProcessingContext<TPixel> Pixelate<TPixel>(this IImageProcessingContext<TPixel> source, int size)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new PixelateProcessor<TPixel>(size));
@ -48,7 +48,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Pixelate<TPixel>(this IImageProcessorApplicator<TPixel> source, int size, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Pixelate<TPixel>(this IImageProcessingContext<TPixel> source, int size, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new PixelateProcessor<TPixel>(size), rectangle);
}

24
src/ImageSharp/Processing/Overlays/Glow.cs

@ -21,7 +21,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return Glow(source, GraphicsOptions.Default);
@ -34,7 +34,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="color">The color to set as the glow.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color)
where TPixel : struct, IPixel<TPixel>
{
return Glow(source, color, GraphicsOptions.Default);
@ -47,7 +47,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="radius">The the radius.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, float radius)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, float radius)
where TPixel : struct, IPixel<TPixel>
{
return Glow(source, radius, GraphicsOptions.Default);
@ -62,7 +62,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(rectangle, GraphicsOptions.Default);
@ -77,7 +77,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float radius, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float radius, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(color, ValueSize.Absolute(radius), rectangle, GraphicsOptions.Default);
@ -88,7 +88,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(NamedColors<TPixel>.Black, ValueSize.PercentageOfWidth(0.5f), options);
@ -100,7 +100,7 @@ namespace ImageSharp
/// <param name="color">The color to set as the glow.</param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(color, ValueSize.PercentageOfWidth(0.5f), options);
@ -112,7 +112,7 @@ namespace ImageSharp
/// <param name="radius">The the radius.</param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, float radius, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, float radius, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(NamedColors<TPixel>.Black, ValueSize.Absolute(radius), options);
@ -126,7 +126,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(NamedColors<TPixel>.Black, ValueSize.PercentageOfWidth(0.5f), rectangle, options);
@ -142,7 +142,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.Glow(color, ValueSize.Absolute(radius), rectangle, options);
@ -158,7 +158,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
private static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options)
private static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GlowProcessor<TPixel>(color, radius, options), rectangle);
@ -171,7 +171,7 @@ namespace ImageSharp
/// <param name="radius">The the radius.</param>
/// <param name="options">The options effecting things like blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
private static IImageProcessorApplicator<TPixel> Glow<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, ValueSize radius, GraphicsOptions options)
private static IImageProcessingContext<TPixel> Glow<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, ValueSize radius, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new GlowProcessor<TPixel>(color, radius, options));
}

24
src/ImageSharp/Processing/Overlays/Vignette.cs

@ -21,7 +21,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
{
return Vignette(source, GraphicsOptions.Default);
@ -34,7 +34,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="color">The color to set as the vignette.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color)
where TPixel : struct, IPixel<TPixel>
{
return Vignette(source, color, GraphicsOptions.Default);
@ -48,7 +48,7 @@ namespace ImageSharp
/// <param name="radiusX">The the x-radius.</param>
/// <param name="radiusY">The the y-radius.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, float radiusX, float radiusY)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, float radiusX, float radiusY)
where TPixel : struct, IPixel<TPixel>
{
return Vignette(source, radiusX, radiusY, GraphicsOptions.Default);
@ -63,7 +63,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
{
return Vignette(source, rectangle, GraphicsOptions.Default);
@ -81,7 +81,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float radiusX, float radiusY, Rectangle rectangle)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float radiusX, float radiusY, Rectangle rectangle)
where TPixel : struct, IPixel<TPixel>
=> source.Vignette(color, radiusX, radiusY, rectangle, GraphicsOptions.Default);
@ -92,7 +92,7 @@ namespace ImageSharp
/// <param name="source">The image this method extends.</param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.VignetteInternal(NamedColors<TPixel>.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options);
@ -104,7 +104,7 @@ namespace ImageSharp
/// <param name="color">The color to set as the vignette.</param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.VignetteInternal(color, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options);
@ -117,7 +117,7 @@ namespace ImageSharp
/// <param name="radiusY">The the y-radius.</param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, float radiusX, float radiusY, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, float radiusX, float radiusY, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.VignetteInternal(NamedColors<TPixel>.Black, radiusX, radiusY, options);
@ -131,7 +131,7 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.VignetteInternal(NamedColors<TPixel>.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), rectangle, options);
@ -148,15 +148,15 @@ namespace ImageSharp
/// </param>
/// <param name="options">The options effecting pixel blending.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Vignette<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options)
public static IImageProcessingContext<TPixel> Vignette<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.VignetteInternal(color, radiusX, radiusY, rectangle, options);
private static IImageProcessorApplicator<TPixel> VignetteInternal<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options)
private static IImageProcessingContext<TPixel> VignetteInternal<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new VignetteProcessor<TPixel>(color, radiusX, radiusY, options), rectangle);
private static IImageProcessorApplicator<TPixel> VignetteInternal<TPixel>(this IImageProcessorApplicator<TPixel> source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options)
private static IImageProcessingContext<TPixel> VignetteInternal<TPixel>(this IImageProcessingContext<TPixel> source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new VignetteProcessor<TPixel>(color, radiusX, radiusY, options));
}

2
src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs

@ -15,7 +15,7 @@ namespace ImageSharp.Processing
/// Allows the application of processors to images.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
internal abstract class CloneingImageProcessor<TPixel> : IImageProcessor<TPixel>, ICloningImageProcessor<TPixel>
internal abstract class CloneingImageProcessor<TPixel> : IImageProcessor<TPixel>, ICloneingImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel>
{
/// <inheritdoc/>

2
src/ImageSharp/Processing/Transforms/AutoOrient.cs

@ -21,7 +21,7 @@ namespace ImageSharp
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image to auto rotate.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> AutoOrient<TPixel>(this IImageProcessorApplicator<TPixel> source)
public static IImageProcessingContext<TPixel> AutoOrient<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new Processing.Processors.AutoRotateProcessor<TPixel>());
}

4
src/ImageSharp/Processing/Transforms/Crop.cs

@ -25,7 +25,7 @@ namespace ImageSharp
/// <param name="width">The target image width.</param>
/// <param name="height">The target image height.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Crop<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height)
public static IImageProcessingContext<TPixel> Crop<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height)
where TPixel : struct, IPixel<TPixel>
=> Crop(source, new Rectangle(0, 0, width, height));
@ -38,7 +38,7 @@ namespace ImageSharp
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to retain.
/// </param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Crop<TPixel>(this IImageProcessorApplicator<TPixel> source, Rectangle cropRectangle)
public static IImageProcessingContext<TPixel> Crop<TPixel>(this IImageProcessingContext<TPixel> source, Rectangle cropRectangle)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new CropProcessor<TPixel>(cropRectangle));
}

2
src/ImageSharp/Processing/Transforms/EntropyCrop.cs

@ -23,7 +23,7 @@ namespace ImageSharp
/// <param name="source">The image to crop.</param>
/// <param name="threshold">The threshold for entropic density.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> EntropyCrop<TPixel>(this IImageProcessorApplicator<TPixel> source, float threshold = .5f)
public static IImageProcessingContext<TPixel> EntropyCrop<TPixel>(this IImageProcessingContext<TPixel> source, float threshold = .5f)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new EntropyCropProcessor<TPixel>(threshold));
}

2
src/ImageSharp/Processing/Transforms/Flip.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image to rotate, flip, or both.</param>
/// <param name="flipType">The <see cref="FlipType"/> to perform the flip.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Flip<TPixel>(this IImageProcessorApplicator<TPixel> source, FlipType flipType)
public static IImageProcessingContext<TPixel> Flip<TPixel>(this IImageProcessingContext<TPixel> source, FlipType flipType)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new FlipProcessor<TPixel>(flipType));
}

2
src/ImageSharp/Processing/Transforms/Pad.cs

@ -26,7 +26,7 @@ namespace ImageSharp
/// <param name="width">The new width.</param>
/// <param name="height">The new height.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Pad<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height)
public static IImageProcessingContext<TPixel> Pad<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height)
where TPixel : struct, IPixel<TPixel>
{
ResizeOptions options = new ResizeOptions

18
src/ImageSharp/Processing/Transforms/Resize.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="options">The resize options.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, ResizeOptions options)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, ResizeOptions options)
where TPixel : struct, IPixel<TPixel>
{
return source.Run(img =>
@ -56,7 +56,7 @@ namespace ImageSharp
/// <param name="size">The target image size.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, Size size)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, Size size)
where TPixel : struct, IPixel<TPixel>
{
return Resize(source, size.Width, size.Height, new BicubicResampler(), false);
@ -71,7 +71,7 @@ namespace ImageSharp
/// <param name="compand">Whether to compress and expand the image color-space to gamma correct the image during processing.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, Size size, bool compand)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, Size size, bool compand)
where TPixel : struct, IPixel<TPixel>
{
return Resize(source, size.Width, size.Height, new BicubicResampler(), compand);
@ -86,7 +86,7 @@ namespace ImageSharp
/// <param name="height">The target image height.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height)
where TPixel : struct, IPixel<TPixel>
{
return Resize(source, width, height, new BicubicResampler(), false);
@ -102,7 +102,7 @@ namespace ImageSharp
/// <param name="compand">Whether to compress and expand the image color-space to gamma correct the image during processing.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height, bool compand)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height, bool compand)
where TPixel : struct, IPixel<TPixel>
{
return Resize(source, width, height, new BicubicResampler(), compand);
@ -118,7 +118,7 @@ namespace ImageSharp
/// <param name="sampler">The <see cref="IResampler"/> to perform the resampling.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height, IResampler sampler)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height, IResampler sampler)
where TPixel : struct, IPixel<TPixel>
{
return Resize(source, width, height, sampler, false);
@ -135,7 +135,7 @@ namespace ImageSharp
/// <param name="compand">Whether to compress and expand the image color-space to gamma correct the image during processing.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height, IResampler sampler, bool compand)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height, IResampler sampler, bool compand)
where TPixel : struct, IPixel<TPixel>
{
return Resize(source, width, height, sampler, new Rectangle(0, 0, width, height), compand);
@ -159,7 +159,7 @@ namespace ImageSharp
/// <param name="compand">Whether to compress and expand the image color-space to gamma correct the image during processing.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand)
where TPixel : struct, IPixel<TPixel>
{
return source.Run(img =>
@ -199,7 +199,7 @@ namespace ImageSharp
/// <param name="compand">Whether to compress and expand the image color-space to gamma correct the image during processing.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static IImageProcessorApplicator<TPixel> Resize<TPixel>(this IImageProcessorApplicator<TPixel> source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand)
public static IImageProcessingContext<TPixel> Resize<TPixel>(this IImageProcessingContext<TPixel> source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand)
where TPixel : struct, IPixel<TPixel>
{
return source.Run(img =>

6
src/ImageSharp/Processing/Transforms/Rotate.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="source">The image to rotate.</param>
/// <param name="degrees">The angle in degrees to perform the rotation.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Rotate<TPixel>(this IImageProcessorApplicator<TPixel> source, float degrees)
public static IImageProcessingContext<TPixel> Rotate<TPixel>(this IImageProcessingContext<TPixel> source, float degrees)
where TPixel : struct, IPixel<TPixel>
{
return Rotate(source, degrees, true);
@ -37,7 +37,7 @@ namespace ImageSharp
/// <param name="source">The image to rotate.</param>
/// <param name="rotateType">The <see cref="RotateType"/> to perform the rotation.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Rotate<TPixel>(this IImageProcessorApplicator<TPixel> source, RotateType rotateType)
public static IImageProcessingContext<TPixel> Rotate<TPixel>(this IImageProcessingContext<TPixel> source, RotateType rotateType)
where TPixel : struct, IPixel<TPixel>
=> Rotate(source, (float)rotateType, false);
@ -49,7 +49,7 @@ namespace ImageSharp
/// <param name="degrees">The angle in degrees to perform the rotation.</param>
/// <param name="expand">Whether to expand the image to fit the rotated result.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Rotate<TPixel>(this IImageProcessorApplicator<TPixel> source, float degrees, bool expand)
public static IImageProcessingContext<TPixel> Rotate<TPixel>(this IImageProcessingContext<TPixel> source, float degrees, bool expand)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new RotateProcessor<TPixel> { Angle = degrees, Expand = expand });
}

2
src/ImageSharp/Processing/Transforms/RotateFlip.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="rotateType">The <see cref="RotateType"/> to perform the rotation.</param>
/// <param name="flipType">The <see cref="FlipType"/> to perform the flip.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> RotateFlip<TPixel>(this IImageProcessorApplicator<TPixel> source, RotateType rotateType, FlipType flipType)
public static IImageProcessingContext<TPixel> RotateFlip<TPixel>(this IImageProcessingContext<TPixel> source, RotateType rotateType, FlipType flipType)
where TPixel : struct, IPixel<TPixel>
{
return source.Rotate(rotateType).Flip(flipType);

4
src/ImageSharp/Processing/Transforms/Skew.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="degreesX">The angle in degrees to perform the rotation along the x-axis.</param>
/// <param name="degreesY">The angle in degrees to perform the rotation along the y-axis.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Skew<TPixel>(this IImageProcessorApplicator<TPixel> source, float degreesX, float degreesY)
public static IImageProcessingContext<TPixel> Skew<TPixel>(this IImageProcessingContext<TPixel> source, float degreesX, float degreesY)
where TPixel : struct, IPixel<TPixel>
{
return Skew(source, degreesX, degreesY, true);
@ -39,7 +39,7 @@ namespace ImageSharp
/// <param name="degreesY">The angle in degrees to perform the rotation along the y-axis.</param>
/// <param name="expand">Whether to expand the image to fit the skewed result.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessorApplicator<TPixel> Skew<TPixel>(this IImageProcessorApplicator<TPixel> source, float degreesX, float degreesY, bool expand)
public static IImageProcessingContext<TPixel> Skew<TPixel>(this IImageProcessingContext<TPixel> source, float degreesX, float degreesY, bool expand)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new SkewProcessor<TPixel> { AngleX = degreesX, AngleY = degreesY, Expand = expand });
}

4
src/ImageSharp/Quantizers/Quantize.cs

@ -24,7 +24,7 @@ namespace ImageSharp
/// <param name="mode">The quantization mode to apply to perform the operation.</param>
/// <param name="maxColors">The maximum number of colors to return. Defaults to 256.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Quantize<TPixel>(this IImageProcessorApplicator<TPixel> source, Quantization mode = Quantization.Octree, int maxColors = 256)
public static IImageProcessingContext<TPixel> Quantize<TPixel>(this IImageProcessingContext<TPixel> source, Quantization mode = Quantization.Octree, int maxColors = 256)
where TPixel : struct, IPixel<TPixel>
{
IQuantizer<TPixel> quantizer;
@ -54,7 +54,7 @@ namespace ImageSharp
/// <param name="quantizer">The quantizer to apply to perform the operation.</param>
/// <param name="maxColors">The maximum number of colors to return.</param>
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessorApplicator<TPixel> Quantize<TPixel>(this IImageProcessorApplicator<TPixel> source, IQuantizer<TPixel> quantizer, int maxColors)
public static IImageProcessingContext<TPixel> Quantize<TPixel>(this IImageProcessingContext<TPixel> source, IQuantizer<TPixel> quantizer, int maxColors)
where TPixel : struct, IPixel<TPixel>
{
return source.Run(img =>

14
tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs

@ -9,7 +9,8 @@ namespace ImageSharp.Tests
{
public abstract class BaseImageOperationsExtensionTest
{
protected readonly FakeImageOperationsProvider.FakeImageOperations<Rgba32> operations;
protected readonly IImageProcessingContext<Rgba32> operations;
private readonly FakeImageOperationsProvider.FakeImageOperations<Rgba32> internalOperations;
protected readonly Rectangle rect;
protected readonly GraphicsOptions options;
@ -17,23 +18,24 @@ namespace ImageSharp.Tests
{
this.options = new GraphicsOptions(false) { };
this.rect = new Rectangle(91, 123, 324, 56); // make this random?
this.operations = new FakeImageOperationsProvider.FakeImageOperations<Rgba32>(null, false);
this.internalOperations = new FakeImageOperationsProvider.FakeImageOperations<Rgba32>(null, false);
this.operations = this.internalOperations;
}
public T Verify<T>(int index = 0)
{
Assert.InRange(index, 0, this.operations.applied.Count - 1);
Assert.InRange(index, 0, this.internalOperations.applied.Count - 1);
var operation = this.operations.applied[index];
var operation = this.internalOperations.applied[index];
return Assert.IsType<T>(operation.Processor);
}
public T Verify<T>(Rectangle rect, int index = 0)
{
Assert.InRange(index, 0, this.operations.applied.Count - 1);
Assert.InRange(index, 0, this.internalOperations.applied.Count - 1);
var operation = this.operations.applied[index];
var operation = this.internalOperations.applied[index];
Assert.Equal(rect, operation.Rectangle);
return Assert.IsType<T>(operation.Processor);

10
tests/ImageSharp.Tests/FakeImageOperationsProvider.cs

@ -8,7 +8,7 @@
using ImageSharp.Processing;
using SixLabors.Primitives;
public class FakeImageOperationsProvider : IImageProcessorApplicatorFactory
internal class FakeImageOperationsProvider : IImageProcessingContextFactory
{
private List<object> ImageOperators = new List<object>();
@ -29,7 +29,7 @@
.SelectMany(x => x.applied);
}
public IInternalImageProcessorApplicator<TPixel> CreateImageOperations<TPixel>(Image<TPixel> source, bool mutate) where TPixel : struct, IPixel<TPixel>
public IInternalImageProcessingContext<TPixel> CreateImageProcessingContext<TPixel>(Image<TPixel> source, bool mutate) where TPixel : struct, IPixel<TPixel>
{
var op = new FakeImageOperations<TPixel>(source, mutate);
this.ImageOperators.Add(op);
@ -37,7 +37,7 @@
}
public class FakeImageOperations<TPixel> : IInternalImageProcessorApplicator<TPixel>
public class FakeImageOperations<TPixel> : IInternalImageProcessingContext<TPixel>
where TPixel : struct, IPixel<TPixel>
{
public Image<TPixel> source;
@ -63,7 +63,7 @@
return source;
}
public IImageProcessorApplicator<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor, Rectangle rectangle)
public IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor, Rectangle rectangle)
{
applied.Add(new AppliedOpperation
{
@ -73,7 +73,7 @@
return this;
}
public IImageProcessorApplicator<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor)
public IImageProcessingContext<TPixel> ApplyProcessor(IImageProcessor<TPixel> processor)
{
applied.Add(new AppliedOpperation
{

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs

@ -85,7 +85,7 @@ namespace ImageSharp.Tests
/// <summary>
/// Returns an <see cref="Image{TPixel}"/> instance to the test case with the necessary traits.
/// </summary>
public Image<TPixel> GetImage(Action<IImageProcessorApplicator<TPixel>> operationsToApply)
public Image<TPixel> GetImage(Action<IImageProcessingContext<TPixel>> operationsToApply)
{
var img = GetImage();
img.Mutate(operationsToApply);

Loading…
Cancel
Save