Browse Source

migrate processors

pull/69/head
Scott Williams 9 years ago
committed by Scott Williams
parent
commit
b0985ddb0e
  1. 7
      ImageSharp.sln
  2. 6
      src/ImageSharp.Drawing/Draw.cs
  3. 4
      src/ImageSharp.Drawing/DrawImage.cs
  4. 2
      src/ImageSharp.Drawing/DrawRectangle.cs
  5. 6
      src/ImageSharp.Drawing/Fill.cs
  6. 4
      src/ImageSharp.Drawing/FillRectangle.cs
  7. 4
      src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs
  8. 4
      src/ImageSharp.Drawing/Processors/DrawPathProcessor.cs
  9. 2
      src/ImageSharp.Drawing/Processors/FillProcessor.cs
  10. 4
      src/ImageSharp.Drawing/Processors/FillShapeProcessor.cs
  11. 9
      src/ImageSharp.Drawing/project.json
  12. 5
      src/ImageSharp.Formats.Bmp/project.json
  13. 5
      src/ImageSharp.Formats.Gif/project.json
  14. 5
      src/ImageSharp.Formats.Jpeg/project.json
  15. 5
      src/ImageSharp.Formats.Png/project.json
  16. 25
      src/ImageSharp.Formats/project.json
  17. 4
      src/ImageSharp.Processing/Binarization/BinaryThreshold.cs
  18. 2
      src/ImageSharp.Processing/Binarization/BinaryThresholdProcessor.cs
  19. 4
      src/ImageSharp.Processing/ColorMatrix/BlackWhite.cs
  20. 2
      src/ImageSharp.Processing/ColorMatrix/BlackWhiteProcessor.cs
  21. 4
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness.cs
  22. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs
  23. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs
  24. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs
  25. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs
  26. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs
  27. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs
  28. 0
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/README.md
  29. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs
  30. 2
      src/ImageSharp.Processing/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs
  31. 2
      src/ImageSharp.Processing/ColorMatrix/ColorMatrixFilter.cs
  32. 4
      src/ImageSharp.Processing/ColorMatrix/Grayscale.cs
  33. 2
      src/ImageSharp.Processing/ColorMatrix/GrayscaleBt601Processor.cs
  34. 2
      src/ImageSharp.Processing/ColorMatrix/GrayscaleBt709Processor.cs
  35. 4
      src/ImageSharp.Processing/ColorMatrix/Hue.cs
  36. 2
      src/ImageSharp.Processing/ColorMatrix/HueProcessor.cs
  37. 2
      src/ImageSharp.Processing/ColorMatrix/IColorMatrixFilter.cs
  38. 4
      src/ImageSharp.Processing/ColorMatrix/Kodachrome.cs
  39. 2
      src/ImageSharp.Processing/ColorMatrix/KodachromeProcessor.cs
  40. 4
      src/ImageSharp.Processing/ColorMatrix/Lomograph.cs
  41. 2
      src/ImageSharp.Processing/ColorMatrix/LomographProcessor.cs
  42. 0
      src/ImageSharp.Processing/ColorMatrix/Options/ColorBlindness.cs
  43. 0
      src/ImageSharp.Processing/ColorMatrix/Options/GrayscaleMode.cs
  44. 4
      src/ImageSharp.Processing/ColorMatrix/Polaroid.cs
  45. 2
      src/ImageSharp.Processing/ColorMatrix/PolaroidProcessor.cs
  46. 4
      src/ImageSharp.Processing/ColorMatrix/Saturation.cs
  47. 2
      src/ImageSharp.Processing/ColorMatrix/SaturationProcessor.cs
  48. 4
      src/ImageSharp.Processing/ColorMatrix/Sepia.cs
  49. 2
      src/ImageSharp.Processing/ColorMatrix/SepiaProcessor.cs
  50. 182
      src/ImageSharp.Processing/ComparableExtensions.cs
  51. 18
      src/ImageSharp.Processing/Constants.cs
  52. 4
      src/ImageSharp.Processing/Convolution/BoxBlur.cs
  53. 2
      src/ImageSharp.Processing/Convolution/BoxBlurProcessor.cs
  54. 2
      src/ImageSharp.Processing/Convolution/Convolution2DProcessor.cs
  55. 2
      src/ImageSharp.Processing/Convolution/Convolution2PassProcessor.cs
  56. 2
      src/ImageSharp.Processing/Convolution/ConvolutionProcessor.cs
  57. 4
      src/ImageSharp.Processing/Convolution/DetectEdges.cs
  58. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs
  59. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs
  60. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/EdgeDetectorProcessor.cs
  61. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs
  62. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/KayyaliProcessor.cs
  63. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/KirschProcessor.cs
  64. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/Laplacian3X3Processor.cs
  65. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/Laplacian5X5Processor.cs
  66. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs
  67. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/PrewittProcessor.cs
  68. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/RobertsCrossProcessor.cs
  69. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/RobinsonProcessor.cs
  70. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/ScharrProcessor.cs
  71. 2
      src/ImageSharp.Processing/Convolution/EdgeDetection/SobelProcessor.cs
  72. 4
      src/ImageSharp.Processing/Convolution/GaussianBlur.cs
  73. 2
      src/ImageSharp.Processing/Convolution/GaussianBlurProcessor.cs
  74. 4
      src/ImageSharp.Processing/Convolution/GaussianSharpen.cs
  75. 2
      src/ImageSharp.Processing/Convolution/GaussianSharpenProcessor.cs
  76. 0
      src/ImageSharp.Processing/Convolution/Options/EdgeDetection.cs
  77. 4
      src/ImageSharp.Processing/Effects/Alpha.cs
  78. 2
      src/ImageSharp.Processing/Effects/AlphaProcessor.cs
  79. 4
      src/ImageSharp.Processing/Effects/BackgroundColor.cs
  80. 2
      src/ImageSharp.Processing/Effects/BackgroundColorProcessor.cs
  81. 4
      src/ImageSharp.Processing/Effects/Brightness.cs
  82. 2
      src/ImageSharp.Processing/Effects/BrightnessProcessor.cs
  83. 4
      src/ImageSharp.Processing/Effects/Contrast.cs
  84. 2
      src/ImageSharp.Processing/Effects/ContrastProcessor.cs
  85. 4
      src/ImageSharp.Processing/Effects/Invert.cs
  86. 2
      src/ImageSharp.Processing/Effects/InvertProcessor.cs
  87. 4
      src/ImageSharp.Processing/Effects/OilPainting.cs
  88. 2
      src/ImageSharp.Processing/Effects/OilPaintingProcessor.cs
  89. 4
      src/ImageSharp.Processing/Effects/Pixelate.cs
  90. 2
      src/ImageSharp.Processing/Effects/PixelateProcessor.cs
  91. 286
      src/ImageSharp.Processing/ImageMaths.cs
  92. 25
      src/ImageSharp.Processing/ImageSharp.Processing.xproj
  93. 4
      src/ImageSharp.Processing/Overlays/Glow.cs
  94. 2
      src/ImageSharp.Processing/Overlays/GlowProcessor.cs
  95. 4
      src/ImageSharp.Processing/Overlays/Vignette.cs
  96. 2
      src/ImageSharp.Processing/Overlays/VignetteProcessor.cs
  97. 41
      src/ImageSharp.Processing/Properties/AssemblyInfo.cs
  98. 1
      src/ImageSharp.Processing/Transforms/AutoOrient.cs
  99. 2
      src/ImageSharp.Processing/Transforms/CompandingResizeProcessor.cs
  100. 4
      src/ImageSharp.Processing/Transforms/Crop.cs

7
ImageSharp.sln

@ -49,6 +49,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ImageSharp.Formats.Jpeg", "
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ImageSharp.Formats.Png", "src\ImageSharp.Formats.Png\ImageSharp.Formats.Png.xproj", "{556ABDCF-ED93-4327-BE98-F6815F78B9B8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ImageSharp.Processing", "src\ImageSharp.Processing\ImageSharp.Processing.xproj", "{A623CFE9-9D2B-4528-AD1F-2E834B061134}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -95,6 +97,10 @@ Global
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|Any CPU.Build.0 = Release|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -110,5 +116,6 @@ Global
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{7213767C-0003-41CA-AB18-0223CFA7CE4B} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{556ABDCF-ED93-4327-BE98-F6815F78B9B8} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{A623CFE9-9D2B-4528-AD1F-2E834B061134} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
EndGlobalSection
EndGlobal

6
src/ImageSharp.Drawing/Draw.cs

@ -33,7 +33,7 @@ namespace ImageSharp
public static Image<TColor> DrawPolygon<TColor>(this Image<TColor> source, IPen<TColor> pen, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new DrawPathProcessor<TColor>(pen, shape, options));
return source.Apply(new DrawPathProcessor<TColor>(pen, shape, options));
}
/// <summary>
@ -227,7 +227,7 @@ namespace ImageSharp
public static Image<TColor> DrawPath<TColor>(this Image<TColor> source, IPen<TColor> pen, IPath path, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new DrawPathProcessor<TColor>(pen, path, options));
return source.Apply(new DrawPathProcessor<TColor>(pen, path, options));
}
/// <summary>
@ -241,7 +241,7 @@ namespace ImageSharp
public static Image<TColor> DrawPath<TColor>(this Image<TColor> source, IPen<TColor> pen, IPath path)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new DrawPathProcessor<TColor>(pen, path, GraphicsOptions.Default));
return source.Apply(new DrawPathProcessor<TColor>(pen, path, GraphicsOptions.Default));
}
/// <summary>

4
src/ImageSharp.Drawing/DrawImage.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Drawing.Processors;
/// <summary>
/// Extension methods for the <see cref="Image"/> type.
@ -51,7 +51,7 @@ namespace ImageSharp
location = Point.Empty;
}
return source.Process(source.Bounds, new DrawImageProcessor<TColor>(image, size, location, percent));
return source.Apply(source.Bounds, new DrawImageProcessor<TColor>(image, size, location, percent));
}
}
}

2
src/ImageSharp.Drawing/DrawRectangle.cs

@ -33,7 +33,7 @@ namespace ImageSharp
public static Image<TColor> DrawPolygon<TColor>(this Image<TColor> source, IPen<TColor> pen, RectangleF shape, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new DrawPathProcessor<TColor>(pen, (IPath)new RectangularPolygon(shape), options));
return source.Apply(new DrawPathProcessor<TColor>(pen, (IPath)new RectangularPolygon(shape), options));
}
/// <summary>

6
src/ImageSharp.Drawing/Fill.cs

@ -28,7 +28,7 @@ namespace ImageSharp
public static Image<TColor> Fill<TColor>(this Image<TColor> source, IBrush<TColor> brush)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new FillProcessor<TColor>(brush));
return source.Apply(new FillProcessor<TColor>(brush));
}
/// <summary>
@ -56,7 +56,7 @@ namespace ImageSharp
public static Image<TColor> Fill<TColor>(this Image<TColor> source, IBrush<TColor> brush, IShape shape, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new FillShapeProcessor<TColor>(brush, shape, options));
return source.Apply(new FillShapeProcessor<TColor>(brush, shape, options));
}
/// <summary>
@ -70,7 +70,7 @@ namespace ImageSharp
public static Image<TColor> Fill<TColor>(this Image<TColor> source, IBrush<TColor> brush, IShape shape)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new FillShapeProcessor<TColor>(brush, shape, GraphicsOptions.Default));
return source.Apply(new FillShapeProcessor<TColor>(brush, shape, GraphicsOptions.Default));
}
/// <summary>

4
src/ImageSharp.Drawing/FillRectangle.cs

@ -31,7 +31,7 @@ namespace ImageSharp
public static Image<TColor> Fill<TColor>(this Image<TColor> source, IBrush<TColor> brush, RectangleF shape, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new FillShapeProcessor<TColor>(brush, new RectangularPolygon(shape), options));
return source.Apply(new FillShapeProcessor<TColor>(brush, new RectangularPolygon(shape), options));
}
/// <summary>
@ -45,7 +45,7 @@ namespace ImageSharp
public static Image<TColor> Fill<TColor>(this Image<TColor> source, IBrush<TColor> brush, RectangleF shape)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(new FillShapeProcessor<TColor>(brush, new RectangularPolygon(shape), GraphicsOptions.Default));
return source.Apply(new FillShapeProcessor<TColor>(brush, new RectangularPolygon(shape), GraphicsOptions.Default));
}
/// <summary>

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

@ -3,11 +3,12 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Drawing.Processors
{
using System;
using System.Numerics;
using System.Threading.Tasks;
using Processing;
/// <summary>
/// Combines two images together by blending the pixels.
@ -57,6 +58,7 @@ namespace ImageSharp.Processors
{
if (this.Image.Bounds.Size != this.Size)
{
// should Resize be moved to core?
this.Image = this.Image.Resize(this.Size.Width, this.Size.Height);
}

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

@ -9,7 +9,7 @@ namespace ImageSharp.Drawing.Processors
using System.Linq;
using System.Numerics;
using System.Threading.Tasks;
using ImageSharp.Processors;
using ImageSharp.Processing;
using Paths;
using Pens;
using Pens.Processors;
@ -20,7 +20,7 @@ namespace ImageSharp.Drawing.Processors
/// Draws a path using the processor pipeline
/// </summary>
/// <typeparam name="TColor">The type of the color.</typeparam>
/// <seealso cref="ImageSharp.Processors.ImageProcessor{TColor}" />
/// <seealso cref="ImageSharp.Processing.ImageProcessor{TColor}" />
public class DrawPathProcessor<TColor> : ImageProcessor<TColor>
where TColor : struct, IPackedPixel, IEquatable<TColor>
{

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

@ -10,7 +10,7 @@ namespace ImageSharp.Drawing.Processors
using System.Threading.Tasks;
using Drawing;
using ImageSharp.Processors;
using ImageSharp.Processing;
/// <summary>
/// Using the bursh as a source of pixels colors blends the brush color with source.

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

@ -9,7 +9,7 @@ namespace ImageSharp.Drawing.Processors
using System.Numerics;
using System.Threading.Tasks;
using Drawing;
using ImageSharp.Processors;
using ImageSharp.Processing;
using Shapes;
using Rectangle = ImageSharp.Rectangle;
@ -17,7 +17,7 @@ namespace ImageSharp.Drawing.Processors
/// Usinf a brsuh and a shape fills shape with contents of brush the
/// </summary>
/// <typeparam name="TColor">The type of the color.</typeparam>
/// <seealso cref="ImageSharp.Processors.ImageProcessor{TColor}" />
/// <seealso cref="ImageSharp.Processing.ImageProcessor{TColor}" />
public class FillShapeProcessor<TColor> : ImageProcessor<TColor>
where TColor : struct, IPackedPixel, IEquatable<TColor>
{

9
src/ImageSharp.Drawing/project.json

@ -37,7 +37,14 @@
}
},
"dependencies": {
"ImageSharp": "1.0.0-*",
"ImageSharp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"ImageSharp.Processing": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"StyleCop.Analyzers": {
"version": "1.0.0",
"type": "build"

5
src/ImageSharp.Formats.Bmp/project.json

@ -35,7 +35,10 @@
}
},
"dependencies": {
"ImageSharp": "1.0.0-*",
"ImageSharp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"StyleCop.Analyzers": {
"version": "1.1.0-beta001",
"type": "build"

5
src/ImageSharp.Formats.Gif/project.json

@ -35,7 +35,10 @@
}
},
"dependencies": {
"ImageSharp": "1.0.0-*",
"ImageSharp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"StyleCop.Analyzers": {
"version": "1.1.0-beta001",
"type": "build"

5
src/ImageSharp.Formats.Jpeg/project.json

@ -35,7 +35,10 @@
}
},
"dependencies": {
"ImageSharp": "1.0.0-*",
"ImageSharp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"StyleCop.Analyzers": {
"version": "1.1.0-beta001",
"type": "build"

5
src/ImageSharp.Formats.Png/project.json

@ -35,7 +35,10 @@
}
},
"dependencies": {
"ImageSharp": "1.0.0-*",
"ImageSharp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"StyleCop.Analyzers": {
"version": "1.1.0-beta001",
"type": "build"

25
src/ImageSharp.Formats/project.json

@ -35,11 +35,26 @@
}
},
"dependencies": {
"ImageSharp": "1.0.0-*",
"ImageSharp.Formats.Png": "1.0.0-*",
"ImageSharp.Formats.Bmp": "1.0.0-*",
"ImageSharp.Formats.Jpeg": "1.0.0-*",
"ImageSharp.Formats.Gif": "1.0.0-*",
"ImageSharp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"ImageSharp.Formats.Png": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"ImageSharp.Formats.Bmp": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"ImageSharp.Formats.Jpeg": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"ImageSharp.Formats.Gif": {
"target": "project",
"version": "1.0.0-alpha1-*"
},
"StyleCop.Analyzers": {
"version": "1.1.0-beta001",
"type": "build"

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> BinaryThreshold<TColor>(this Image<TColor> source, float threshold, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new BinaryThresholdProcessor<TColor>(threshold));
return source.Apply(rectangle, new BinaryThresholdProcessor<TColor>(threshold));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Threading.Tasks;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -38,7 +38,7 @@ namespace ImageSharp
public static Image<TColor> BlackWhite<TColor>(this Image<TColor> source, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new BlackWhiteProcessor<TColor>());
return source.Apply(rectangle, new BlackWhiteProcessor<TColor>());
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/BlackWhiteProcessor.cs → src/ImageSharp.Processing/ColorMatrix/BlackWhiteProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -77,7 +77,7 @@ namespace ImageSharp
break;
}
return source.Process(rectangle, processor);
return source.Apply(rectangle, processor);
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

0
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/README.md → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/README.md

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs → src/ImageSharp.Processing/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

4
src/ImageSharp/Filters/ColorMatrix/Grayscale.cs → src/ImageSharp.Processing/ColorMatrix/Grayscale.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -44,7 +44,7 @@ namespace ImageSharp
? (IImageProcessor<TColor>)new GrayscaleBt709Processor<TColor>()
: new GrayscaleBt601Processor<TColor>();
return source.Process(rectangle, processor);
return source.Apply(rectangle, processor);
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/GrayscaleBt601Processor.cs → src/ImageSharp.Processing/ColorMatrix/GrayscaleBt601Processor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/GrayscaleBt709Processor.cs → src/ImageSharp.Processing/ColorMatrix/GrayscaleBt709Processor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> Hue<TColor>(this Image<TColor> source, float degrees, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new HueProcessor<TColor>(degrees));
return source.Apply(rectangle, new HueProcessor<TColor>(degrees));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/ColorMatrix/IColorMatrixFilter.cs → src/ImageSharp.Processing/ColorMatrix/IColorMatrixFilter.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -38,7 +38,7 @@ namespace ImageSharp
public static Image<TColor> Kodachrome<TColor>(this Image<TColor> source, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new KodachromeProcessor<TColor>());
return source.Apply(rectangle, new KodachromeProcessor<TColor>());
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/KodachromeProcessor.cs → src/ImageSharp.Processing/ColorMatrix/KodachromeProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

4
src/ImageSharp/Filters/ColorMatrix/Lomograph.cs → src/ImageSharp.Processing/ColorMatrix/Lomograph.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -38,7 +38,7 @@ namespace ImageSharp
public static Image<TColor> Lomograph<TColor>(this Image<TColor> source, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new LomographProcessor<TColor>());
return source.Apply(rectangle, new LomographProcessor<TColor>());
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/LomographProcessor.cs → src/ImageSharp.Processing/ColorMatrix/LomographProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

0
src/ImageSharp/Filters/ColorMatrix/Options/ColorBlindness.cs → src/ImageSharp.Processing/ColorMatrix/Options/ColorBlindness.cs

0
src/ImageSharp/Filters/ColorMatrix/Options/GrayscaleMode.cs → src/ImageSharp.Processing/ColorMatrix/Options/GrayscaleMode.cs

4
src/ImageSharp/Filters/ColorMatrix/Polaroid.cs → src/ImageSharp.Processing/ColorMatrix/Polaroid.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -38,7 +38,7 @@ namespace ImageSharp
public static Image<TColor> Polaroid<TColor>(this Image<TColor> source, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new PolaroidProcessor<TColor>());
return source.Apply(rectangle, new PolaroidProcessor<TColor>());
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/PolaroidProcessor.cs → src/ImageSharp.Processing/ColorMatrix/PolaroidProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> Saturation<TColor>(this Image<TColor> source, int amount, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new SaturationProcessor<TColor>(amount));
return source.Apply(rectangle, new SaturationProcessor<TColor>(amount));
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/SaturationProcessor.cs → src/ImageSharp.Processing/ColorMatrix/SaturationProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -38,7 +38,7 @@ namespace ImageSharp
public static Image<TColor> Sepia<TColor>(this Image<TColor> source, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new SepiaProcessor<TColor>());
return source.Apply(rectangle, new SepiaProcessor<TColor>());
}
}
}

2
src/ImageSharp/Filters/Processors/ColorMatrix/SepiaProcessor.cs → src/ImageSharp.Processing/ColorMatrix/SepiaProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

182
src/ImageSharp.Processing/ComparableExtensions.cs

@ -0,0 +1,182 @@
// <copyright file="ComparableExtensions.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processing
{
using System;
/// <summary>
/// Extension methods for classes that implement <see cref="IComparable{T}"/>.
/// </summary>
internal static class ComparableExtensions
{
/// <summary>
/// Restricts a <see cref="byte"/> to be within a specified range.
/// </summary>
/// <param name="value">The The value to clamp.</param>
/// <param name="min">The minimum value. If value is less than min, min will be returned.</param>
/// <param name="max">The maximum value. If value is greater than max, max will be returned.</param>
/// <returns>
/// The <see cref="byte"/> representing the clamped value.
/// </returns>
public static byte Clamp(this byte value, byte min, byte max)
{
// Order is important here as someone might set min to higher than max.
if (value > max)
{
return max;
}
if (value < min)
{
return min;
}
return value;
}
/// <summary>
/// Restricts a <see cref="uint"/> to be within a specified range.
/// </summary>
/// <param name="value">The The value to clamp.</param>
/// <param name="min">The minimum value. If value is less than min, min will be returned.</param>
/// <param name="max">The maximum value. If value is greater than max, max will be returned.</param>
/// <returns>
/// The <see cref="int"/> representing the clamped value.
/// </returns>
public static uint Clamp(this uint value, uint min, uint max)
{
if (value > max)
{
return max;
}
if (value < min)
{
return min;
}
return value;
}
/// <summary>
/// Restricts a <see cref="int"/> to be within a specified range.
/// </summary>
/// <param name="value">The The value to clamp.</param>
/// <param name="min">The minimum value. If value is less than min, min will be returned.</param>
/// <param name="max">The maximum value. If value is greater than max, max will be returned.</param>
/// <returns>
/// The <see cref="int"/> representing the clamped value.
/// </returns>
public static int Clamp(this int value, int min, int max)
{
if (value > max)
{
return max;
}
if (value < min)
{
return min;
}
return value;
}
/// <summary>
/// Restricts a <see cref="float"/> to be within a specified range.
/// </summary>
/// <param name="value">The The value to clamp.</param>
/// <param name="min">The minimum value. If value is less than min, min will be returned.</param>
/// <param name="max">The maximum value. If value is greater than max, max will be returned.</param>
/// <returns>
/// The <see cref="float"/> representing the clamped value.
/// </returns>
public static float Clamp(this float value, float min, float max)
{
if (value > max)
{
return max;
}
if (value < min)
{
return min;
}
return value;
}
/// <summary>
/// Restricts a <see cref="double"/> to be within a specified range.
/// </summary>
/// <param name="value">The The value to clamp.</param>
/// <param name="min">The minimum value. If value is less than min, min will be returned.</param>
/// <param name="max">The maximum value. If value is greater than max, max will be returned.</param>
/// <returns>
/// The <see cref="double"/> representing the clamped value.
/// </returns>
public static double Clamp(this double value, double min, double max)
{
if (value > max)
{
return max;
}
if (value < min)
{
return min;
}
return value;
}
/// <summary>
/// Converts an <see cref="int"/> to a <see cref="byte"/> first restricting the value between the
/// minimum and maximum allowable ranges.
/// </summary>
/// <param name="value">The <see cref="int"/> this method extends.</param>
/// <returns>The <see cref="byte"/></returns>
public static byte ToByte(this int value)
{
return (byte)value.Clamp(0, 255);
}
/// <summary>
/// Converts an <see cref="float"/> to a <see cref="byte"/> first restricting the value between the
/// minimum and maximum allowable ranges.
/// </summary>
/// <param name="value">The <see cref="float"/> this method extends.</param>
/// <returns>The <see cref="byte"/></returns>
public static byte ToByte(this float value)
{
return (byte)value.Clamp(0, 255);
}
/// <summary>
/// Converts an <see cref="double"/> to a <see cref="byte"/> first restricting the value between the
/// minimum and maximum allowable ranges.
/// </summary>
/// <param name="value">The <see cref="double"/> this method extends.</param>
/// <returns>The <see cref="byte"/></returns>
public static byte ToByte(this double value)
{
return (byte)value.Clamp(0, 255);
}
/// <summary>
/// Swaps the references to two objects in memory.
/// </summary>
/// <param name="first">The first reference.</param>
/// <param name="second">The second reference.</param>
/// <typeparam name="T">The type of object.</typeparam>
public static void Swap<T>(ref T first, ref T second)
{
T temp = second;
second = first;
first = temp;
}
}
}

18
src/ImageSharp.Processing/Constants.cs

@ -0,0 +1,18 @@
// <copyright file="Constants.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processing
{
/// <summary>
/// Common constants used throughout the project
/// </summary>
internal static class Constants
{
/// <summary>
/// The epsilon for comparing floating point numbers.
/// </summary>
public static readonly float Epsilon = 0.001f;
}
}

4
src/ImageSharp/Filters/Convolution/BoxBlur.cs → src/ImageSharp.Processing/Convolution/BoxBlur.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> BoxBlur<TColor>(this Image<TColor> source, int radius, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new BoxBlurProcessor<TColor>(radius));
return source.Apply(rectangle, new BoxBlurProcessor<TColor>(radius));
}
}
}

2
src/ImageSharp/Filters/Processors/Convolution/BoxBlurProcessor.cs → src/ImageSharp.Processing/Convolution/BoxBlurProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/Convolution/Convolution2PassProcessor.cs → src/ImageSharp.Processing/Convolution/Convolution2PassProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/Convolution/ConvolutionProcessor.cs → src/ImageSharp.Processing/Convolution/ConvolutionProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

4
src/ImageSharp/Filters/Convolution/DetectEdges.cs → src/ImageSharp.Processing/Convolution/DetectEdges.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -145,7 +145,7 @@ namespace ImageSharp
public static Image<TColor> DetectEdges<TColor>(this Image<TColor> source, Rectangle rectangle, IEdgeDetectorProcessor<TColor> filter)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, filter);
return source.Apply(rectangle, filter);
}
}
}

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/EdgeDetectorProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/KayyaliProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/KirschProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/KirschProcessor.cs

@ -2,7 +2,7 @@
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/Laplacian3X3Processor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/Laplacian5X5Processor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/PrewittProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/PrewittProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/RobertsCrossProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/RobinsonProcessor.cs

@ -2,7 +2,7 @@
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/ScharrProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/ScharrProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

2
src/ImageSharp/Filters/Processors/Convolution/EdgeDetection/SobelProcessor.cs → src/ImageSharp.Processing/Convolution/EdgeDetection/SobelProcessor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Diagnostics.CodeAnalysis;

4
src/ImageSharp/Filters/Convolution/GaussianBlur.cs → src/ImageSharp.Processing/Convolution/GaussianBlur.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> GaussianBlur<TColor>(this Image<TColor> source, float sigma, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new GaussianBlurProcessor<TColor>(sigma));
return source.Apply(rectangle, new GaussianBlurProcessor<TColor>(sigma));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;

4
src/ImageSharp/Filters/Convolution/GaussianSharpen.cs → src/ImageSharp.Processing/Convolution/GaussianSharpen.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> GaussianSharpen<TColor>(this Image<TColor> source, float sigma, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new GaussianSharpenProcessor<TColor>(sigma));
return source.Apply(rectangle, new GaussianSharpenProcessor<TColor>(sigma));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;

0
src/ImageSharp/Filters/Convolution/Options/EdgeDetection.cs → src/ImageSharp.Processing/Convolution/Options/EdgeDetection.cs

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> Alpha<TColor>(this Image<TColor> source, int percent, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new AlphaProcessor<TColor>(percent));
return source.Apply(rectangle, new AlphaProcessor<TColor>(percent));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -24,7 +24,7 @@ namespace ImageSharp
public static Image<TColor> BackgroundColor<TColor>(this Image<TColor> source, TColor color)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(source.Bounds, new BackgroundColorProcessor<TColor>(color));
return source.Apply(source.Bounds, new BackgroundColorProcessor<TColor>(color));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> Brightness<TColor>(this Image<TColor> source, int amount, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new BrightnessProcessor<TColor>(amount));
return source.Apply(rectangle, new BrightnessProcessor<TColor>(amount));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -40,7 +40,7 @@ namespace ImageSharp
public static Image<TColor> Contrast<TColor>(this Image<TColor> source, int amount, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new ContrastProcessor<TColor>(amount));
return source.Apply(rectangle, new ContrastProcessor<TColor>(amount));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -38,7 +38,7 @@ namespace ImageSharp
public static Image<TColor> Invert<TColor>(this Image<TColor> source, Rectangle rectangle)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
return source.Process(rectangle, new InvertProcessor<TColor>());
return source.Apply(rectangle, new InvertProcessor<TColor>());
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -49,7 +49,7 @@ namespace ImageSharp
throw new ArgumentOutOfRangeException(nameof(brushSize));
}
return source.Process(rectangle, new OilPaintingProcessor<TColor>(levels, brushSize));
return source.Apply(rectangle, new OilPaintingProcessor<TColor>(levels, brushSize));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -45,7 +45,7 @@ namespace ImageSharp
throw new ArgumentOutOfRangeException(nameof(size));
}
return source.Process(rectangle, new PixelateProcessor<TColor>(size));
return source.Apply(rectangle, new PixelateProcessor<TColor>(size));
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Collections.Generic;

286
src/ImageSharp.Processing/ImageMaths.cs

@ -0,0 +1,286 @@
// <copyright file="ImageMaths.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processing
{
using System;
using System.Linq;
using System.Numerics;
/// <summary>
/// Provides common mathematical methods.
/// </summary>
internal static class ImageMaths
{
/// <summary>
/// Returns how many bits are required to store the specified number of colors.
/// Performs a Log2() on the value.
/// </summary>
/// <param name="colors">The number of colors.</param>
/// <returns>
/// The <see cref="int"/>
/// </returns>
public static int GetBitsNeededForColorDepth(int colors)
{
return (int)Math.Ceiling(Math.Log(colors, 2));
}
/// <summary>
/// Implementation of 1D Gaussian G(x) function
/// </summary>
/// <param name="x">The x provided to G(x).</param>
/// <param name="sigma">The spread of the blur.</param>
/// <returns>The Gaussian G(x)</returns>
public static float Gaussian(float x, float sigma)
{
const float Numerator = 1.0f;
float denominator = (float)(Math.Sqrt(2 * Math.PI) * sigma);
float exponentNumerator = -x * x;
float exponentDenominator = (float)(2 * Math.Pow(sigma, 2));
float left = Numerator / denominator;
float right = (float)Math.Exp(exponentNumerator / exponentDenominator);
return left * right;
}
/// <summary>
/// Returns the result of a B-C filter against the given value.
/// <see href="http://www.imagemagick.org/Usage/filter/#cubic_bc"/>
/// </summary>
/// <param name="x">The value to process.</param>
/// <param name="b">The B-Spline curve variable.</param>
/// <param name="c">The Cardinal curve variable.</param>
/// <returns>
/// The <see cref="float"/>.
/// </returns>
public static float GetBcValue(float x, float b, float c)
{
float temp;
if (x < 0F)
{
x = -x;
}
temp = x * x;
if (x < 1F)
{
x = ((12 - (9 * b) - (6 * c)) * (x * temp)) + ((-18 + (12 * b) + (6 * c)) * temp) + (6 - (2 * b));
return x / 6F;
}
if (x < 2F)
{
x = ((-b - (6 * c)) * (x * temp)) + (((6 * b) + (30 * c)) * temp) + (((-12 * b) - (48 * c)) * x) + ((8 * b) + (24 * c));
return x / 6F;
}
return 0F;
}
/// <summary>
/// Gets the result of a sine cardinal function for the given value.
/// </summary>
/// <param name="x">The value to calculate the result for.</param>
/// <returns>
/// The <see cref="float"/>.
/// </returns>
public static float SinC(float x)
{
if (Math.Abs(x) > Constants.Epsilon)
{
x *= (float)Math.PI;
return Clean((float)Math.Sin(x) / x);
}
return 1.0f;
}
/// <summary>
/// Returns the given degrees converted to radians.
/// </summary>
/// <param name="degrees">The angle in degrees.</param>
/// <returns>
/// The <see cref="float"/> representing the degree as radians.
/// </returns>
public static float DegreesToRadians(float degrees)
{
return degrees * (float)(Math.PI / 180);
}
/// <summary>
/// Gets the bounding <see cref="Rectangle"/> from the given points.
/// </summary>
/// <param name="topLeft">
/// The <see cref="Point"/> designating the top left position.
/// </param>
/// <param name="bottomRight">
/// The <see cref="Point"/> designating the bottom right position.
/// </param>
/// <returns>
/// The bounding <see cref="Rectangle"/>.
/// </returns>
public static Rectangle GetBoundingRectangle(Point topLeft, Point bottomRight)
{
return new Rectangle(topLeft.X, topLeft.Y, bottomRight.X - topLeft.X, bottomRight.Y - topLeft.Y);
}
/// <summary>
/// Gets the bounding <see cref="Rectangle"/> from the given matrix.
/// </summary>
/// <param name="rectangle">The source rectangle.</param>
/// <param name="matrix">The transformation matrix.</param>
/// <returns>
/// The <see cref="Rectangle"/>.
/// </returns>
public static Rectangle GetBoundingRectangle(Rectangle rectangle, Matrix3x2 matrix)
{
Vector2 leftTop = Vector2.Transform(new Vector2(rectangle.Left, rectangle.Top), matrix);
Vector2 rightTop = Vector2.Transform(new Vector2(rectangle.Right, rectangle.Top), matrix);
Vector2 leftBottom = Vector2.Transform(new Vector2(rectangle.Left, rectangle.Bottom), matrix);
Vector2 rightBottom = Vector2.Transform(new Vector2(rectangle.Right, rectangle.Bottom), matrix);
Vector2[] allCorners = { leftTop, rightTop, leftBottom, rightBottom };
float extentX = allCorners.Select(v => v.X).Max() - allCorners.Select(v => v.X).Min();
float extentY = allCorners.Select(v => v.Y).Max() - allCorners.Select(v => v.Y).Min();
return new Rectangle(0, 0, (int)extentX, (int)extentY);
}
/// <summary>
/// Finds the bounding rectangle based on the first instance of any color component other
/// than the given one.
/// </summary>
/// <typeparam name="TColor">The pixel format.</typeparam>
/// <param name="bitmap">The <see cref="Image"/> to search within.</param>
/// <param name="componentValue">The color component value to remove.</param>
/// <param name="channel">The <see cref="RgbaComponent"/> channel to test against.</param>
/// <returns>
/// The <see cref="Rectangle"/>.
/// </returns>
public static Rectangle GetFilteredBoundingRectangle<TColor>(ImageBase<TColor> bitmap, float componentValue, RgbaComponent channel = RgbaComponent.B)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
int width = bitmap.Width;
int height = bitmap.Height;
Point topLeft = default(Point);
Point bottomRight = default(Point);
Func<PixelAccessor<TColor>, int, int, float, bool> delegateFunc;
// Determine which channel to check against
switch (channel)
{
case RgbaComponent.R:
delegateFunc = (pixels, x, y, b) => Math.Abs(pixels[x, y].ToVector4().X - b) > Constants.Epsilon;
break;
case RgbaComponent.G:
delegateFunc = (pixels, x, y, b) => Math.Abs(pixels[x, y].ToVector4().Y - b) > Constants.Epsilon;
break;
case RgbaComponent.B:
delegateFunc = (pixels, x, y, b) => Math.Abs(pixels[x, y].ToVector4().Z - b) > Constants.Epsilon;
break;
default:
delegateFunc = (pixels, x, y, b) => Math.Abs(pixels[x, y].ToVector4().W - b) > Constants.Epsilon;
break;
}
Func<PixelAccessor<TColor>, int> getMinY = pixels =>
{
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
if (delegateFunc(pixels, x, y, componentValue))
{
return y;
}
}
}
return 0;
};
Func<PixelAccessor<TColor>, int> getMaxY = pixels =>
{
for (int y = height - 1; y > -1; y--)
{
for (int x = 0; x < width; x++)
{
if (delegateFunc(pixels, x, y, componentValue))
{
return y;
}
}
}
return height;
};
Func<PixelAccessor<TColor>, int> getMinX = pixels =>
{
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
if (delegateFunc(pixels, x, y, componentValue))
{
return x;
}
}
}
return 0;
};
Func<PixelAccessor<TColor>, int> getMaxX = pixels =>
{
for (int x = width - 1; x > -1; x--)
{
for (int y = 0; y < height; y++)
{
if (delegateFunc(pixels, x, y, componentValue))
{
return x;
}
}
}
return height;
};
using (PixelAccessor<TColor> bitmapPixels = bitmap.Lock())
{
topLeft.Y = getMinY(bitmapPixels);
topLeft.X = getMinX(bitmapPixels);
bottomRight.Y = (getMaxY(bitmapPixels) + 1).Clamp(0, height);
bottomRight.X = (getMaxX(bitmapPixels) + 1).Clamp(0, width);
}
return GetBoundingRectangle(topLeft, bottomRight);
}
/// <summary>
/// Ensures that any passed double is correctly rounded to zero
/// </summary>
/// <param name="x">The value to clean.</param>
/// <returns>
/// The <see cref="float"/>
/// </returns>.
private static float Clean(float x)
{
if (Math.Abs(x) < Constants.Epsilon)
{
return 0F;
}
return x;
}
}
}

25
src/ImageSharp.Processing/ImageSharp.Processing.xproj

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>a623cfe9-9d2b-4528-ad1f-2e834b061134</ProjectGuid>
<RootNamespace>ImageSharp.Processing</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

4
src/ImageSharp/Filters/Overlays/Glow.cs → src/ImageSharp.Processing/Overlays/Glow.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -88,7 +88,7 @@ namespace ImageSharp
processor.GlowColor = color;
}
return source.Process(rectangle, processor);
return source.Apply(rectangle, processor);
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

4
src/ImageSharp/Filters/Overlays/Vignette.cs → src/ImageSharp.Processing/Overlays/Vignette.cs

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -90,7 +90,7 @@ namespace ImageSharp
processor.VignetteColor = color;
}
return source.Process(rectangle, processor);
return source.Apply(rectangle, processor);
}
}
}

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

41
src/ImageSharp.Processing/Properties/AssemblyInfo.cs

@ -0,0 +1,41 @@
// <copyright file="AssemblyInfo.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ImageSharp")]
[assembly: AssemblyDescription("A cross-platform library for processing of image files; written in C#")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("James Jackson-South")]
[assembly: AssemblyProduct("ImageSharp")]
[assembly: AssemblyCopyright("Copyright (c) James Jackson-South and contributors.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
// Ensure the internals can be tested.
[assembly: InternalsVisibleTo("ImageSharp.Benchmarks")]
[assembly: InternalsVisibleTo("ImageSharp.Tests")]
[assembly: InternalsVisibleTo("ImageSharp.Tests46")]
[assembly: InternalsVisibleTo("ImageSharp.Drawing")]

1
src/ImageSharp/Filters/Transforms/AutoOrient.cs → src/ImageSharp.Processing/Transforms/AutoOrient.cs

@ -6,6 +6,7 @@
namespace ImageSharp
{
using System;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.

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

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Processors
namespace ImageSharp.Processing
{
using System;
using System.Numerics;

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

@ -7,7 +7,7 @@ namespace ImageSharp
{
using System;
using Processors;
using Processing;
/// <summary>
/// Extension methods for the <see cref="Image{TColor}"/> type.
@ -41,7 +41,7 @@ namespace ImageSharp
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
CropProcessor<TColor> processor = new CropProcessor<TColor>(cropRectangle);
return source.Process(source.Bounds, processor);
return source.Apply(source.Bounds, processor);
}
}
}

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

Loading…
Cancel
Save