diff --git a/src/ImageProcessorCore/Filters/Alpha.cs b/src/ImageProcessorCore/Filters/Alpha.cs
index 1d678370d..4cbb6342f 100644
--- a/src/ImageProcessorCore/Filters/Alpha.cs
+++ b/src/ImageProcessorCore/Filters/Alpha.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The new opacity of the image. Must be between 0 and 100.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Alpha(this Image source, int percent, ProgressEventHandler progressHandler = null)
+ public static Image Alpha(this Image source, int percent)
where TColor : IPackedVector
where TPacked : struct
{
- return Alpha(source, percent, source.Bounds, progressHandler);
+ return Alpha(source, percent, source.Bounds);
}
///
@@ -38,23 +37,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Alpha(this Image source, int percent, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Alpha(this Image source, int percent, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- AlphaProcessor processor = new AlphaProcessor(percent);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new AlphaProcessor(percent));
}
}
}
diff --git a/src/ImageProcessorCore/Filters/BackgroundColor.cs b/src/ImageProcessorCore/Filters/BackgroundColor.cs
index f059700e1..5a1b39d5f 100644
--- a/src/ImageProcessorCore/Filters/BackgroundColor.cs
+++ b/src/ImageProcessorCore/Filters/BackgroundColor.cs
@@ -19,23 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The color to set as the background.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image BackgroundColor(this Image source, TColor color, ProgressEventHandler progressHandler = null)
+ public static Image BackgroundColor(this Image source, TColor color)
where TColor : IPackedVector
where TPacked : struct
{
- BackgroundColorProcessor processor = new BackgroundColorProcessor(color);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(source.Bounds, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(source.Bounds, new BackgroundColorProcessor(color));
}
}
}
diff --git a/src/ImageProcessorCore/Filters/BinaryThreshold.cs b/src/ImageProcessorCore/Filters/BinaryThreshold.cs
index b57d63c4f..40538fb2a 100644
--- a/src/ImageProcessorCore/Filters/BinaryThreshold.cs
+++ b/src/ImageProcessorCore/Filters/BinaryThreshold.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The threshold to apply binerization of the image. Must be between 0 and 1.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image BinaryThreshold(this Image source, float threshold, ProgressEventHandler progressHandler = null)
+ public static Image BinaryThreshold(this Image source, float threshold)
where TColor : IPackedVector
where TPacked : struct
{
- return BinaryThreshold(source, threshold, source.Bounds, progressHandler);
+ return BinaryThreshold(source, threshold, source.Bounds);
}
///
@@ -38,23 +37,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image BinaryThreshold(this Image source, float threshold, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image BinaryThreshold(this Image source, float threshold, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- BinaryThresholdProcessor processor = new BinaryThresholdProcessor(threshold);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new BinaryThresholdProcessor(threshold));
}
}
}
diff --git a/src/ImageProcessorCore/Filters/BlackWhite.cs b/src/ImageProcessorCore/Filters/BlackWhite.cs
index 209387308..6cd0e86cd 100644
--- a/src/ImageProcessorCore/Filters/BlackWhite.cs
+++ b/src/ImageProcessorCore/Filters/BlackWhite.cs
@@ -18,13 +18,12 @@ namespace ImageProcessorCore
/// The pixel format.
/// The packed format. uint, long, float.
/// The image this method extends.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image BlackWhite(this Image source, ProgressEventHandler progressHandler = null)
+ public static Image BlackWhite(this Image source)
where TColor : IPackedVector
where TPacked : struct
{
- return BlackWhite(source, source.Bounds, progressHandler);
+ return BlackWhite(source, source.Bounds);
}
///
@@ -36,23 +35,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image BlackWhite(this Image source, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image BlackWhite(this Image source, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- BlackWhiteProcessor processor = new BlackWhiteProcessor();
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new BlackWhiteProcessor());
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Blend.cs b/src/ImageProcessorCore/Filters/Blend.cs
index ea7af5f19..6161bf164 100644
--- a/src/ImageProcessorCore/Filters/Blend.cs
+++ b/src/ImageProcessorCore/Filters/Blend.cs
@@ -20,13 +20,12 @@ namespace ImageProcessorCore
/// The image this method extends.
/// The image to blend with the currently processing image.
/// The opacity of the image image to blend. Must be between 0 and 100.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Blend(this Image source, ImageBase image, int percent = 50, ProgressEventHandler progressHandler = null)
+ public static Image Blend(this Image source, ImageBase image, int percent = 50)
where TColor : IPackedVector
where TPacked : struct
{
- return Blend(source, image, percent, source.Bounds, progressHandler);
+ return Blend(source, image, percent, source.Bounds);
}
///
@@ -40,23 +39,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Blend(this Image source, ImageBase image, int percent, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Blend(this Image source, ImageBase image, int percent, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- BlendProcessor processor = new BlendProcessor(image, percent);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new BlendProcessor(image, percent));
}
}
}
\ No newline at end of file
diff --git a/src/ImageProcessorCore/Filters/Brightness.cs b/src/ImageProcessorCore/Filters/Brightness.cs
index f7d1a6263..47b59067e 100644
--- a/src/ImageProcessorCore/Filters/Brightness.cs
+++ b/src/ImageProcessorCore/Filters/Brightness.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The new brightness of the image. Must be between -100 and 100.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Brightness(this Image source, int amount, ProgressEventHandler progressHandler = null)
+ public static Image Brightness(this Image source, int amount)
where TColor : IPackedVector
where TPacked : struct
{
- return Brightness(source, amount, source.Bounds, progressHandler);
+ return Brightness(source, amount, source.Bounds);
}
///
@@ -38,23 +37,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Brightness(this Image source, int amount, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Brightness(this Image source, int amount, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- BrightnessProcessor processor = new BrightnessProcessor(amount);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new BrightnessProcessor(amount));
}
}
}
diff --git a/src/ImageProcessorCore/Filters/ColorBlindness.cs b/src/ImageProcessorCore/Filters/ColorBlindness.cs
index 5a29a63de..cb7759b46 100644
--- a/src/ImageProcessorCore/Filters/ColorBlindness.cs
+++ b/src/ImageProcessorCore/Filters/ColorBlindness.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The type of color blindness simulator to apply.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image ColorBlindness(this Image source, ColorBlindness colorBlindness, ProgressEventHandler progressHandler = null)
+ public static Image ColorBlindness(this Image source, ColorBlindness colorBlindness)
where TColor : IPackedVector
where TPacked : struct
{
- return ColorBlindness(source, colorBlindness, source.Bounds, progressHandler);
+ return ColorBlindness(source, colorBlindness, source.Bounds);
}
///
@@ -38,9 +37,8 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image ColorBlindness(this Image source, ColorBlindness colorBlindness, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image ColorBlindness(this Image source, ColorBlindness colorBlindness, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
@@ -81,16 +79,7 @@ namespace ImageProcessorCore
break;
}
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, processor);
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Contrast.cs b/src/ImageProcessorCore/Filters/Contrast.cs
index 364fc34b4..1f4d04746 100644
--- a/src/ImageProcessorCore/Filters/Contrast.cs
+++ b/src/ImageProcessorCore/Filters/Contrast.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The new contrast of the image. Must be between -100 and 100.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Contrast(this Image source, int amount, ProgressEventHandler progressHandler = null)
+ public static Image Contrast(this Image source, int amount)
where TColor : IPackedVector
where TPacked : struct
{
- return Contrast(source, amount, source.Bounds, progressHandler);
+ return Contrast(source, amount, source.Bounds);
}
///
@@ -38,23 +37,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Contrast(this Image source, int amount, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Contrast(this Image source, int amount, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- ContrastProcessor processor = new ContrastProcessor(amount);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new ContrastProcessor(amount));
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Glow.cs b/src/ImageProcessorCore/Filters/Glow.cs
index 0d5b18fb3..1e973bbf9 100644
--- a/src/ImageProcessorCore/Filters/Glow.cs
+++ b/src/ImageProcessorCore/Filters/Glow.cs
@@ -18,13 +18,12 @@ namespace ImageProcessorCore
/// The pixel format.
/// The packed format. uint, long, float.
/// The image this method extends.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Glow(this Image source, ProgressEventHandler progressHandler = null)
+ public static Image Glow(this Image source)
where TColor : IPackedVector
where TPacked : struct
{
- return Glow(source, default(TColor), source.Bounds.Width * .5F, source.Bounds, progressHandler);
+ return Glow(source, default(TColor), source.Bounds.Width * .5F, source.Bounds);
}
///
@@ -34,13 +33,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The color to set as the glow.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Glow(this Image source, TColor color, ProgressEventHandler progressHandler = null)
+ public static Image Glow(this Image source, TColor color)
where TColor : IPackedVector
where TPacked : struct
{
- return Glow(source, color, source.Bounds.Width * .5F, source.Bounds, progressHandler);
+ return Glow(source, color, source.Bounds.Width * .5F, source.Bounds);
}
///
@@ -50,13 +48,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The the radius.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Glow(this Image source, float radius, ProgressEventHandler progressHandler = null)
+ public static Image Glow(this Image source, float radius)
where TColor : IPackedVector
where TPacked : struct
{
- return Glow(source, default(TColor), radius, source.Bounds, progressHandler);
+ return Glow(source, default(TColor), radius, source.Bounds);
}
///
@@ -68,13 +65,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Glow(this Image source, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Glow(this Image source, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- return Glow(source, default(TColor), 0, rectangle, progressHandler);
+ return Glow(source, default(TColor), 0, rectangle);
}
///
@@ -88,9 +84,8 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Glow(this Image source, TColor color, float radius, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Glow(this Image source, TColor color, float radius, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
@@ -101,16 +96,7 @@ namespace ImageProcessorCore
processor.GlowColor = color;
}
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, processor);
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Grayscale.cs b/src/ImageProcessorCore/Filters/Grayscale.cs
index f9fae3671..f496c3da8 100644
--- a/src/ImageProcessorCore/Filters/Grayscale.cs
+++ b/src/ImageProcessorCore/Filters/Grayscale.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The formula to apply to perform the operation.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Grayscale(this Image source, GrayscaleMode mode = GrayscaleMode.Bt709, ProgressEventHandler progressHandler = null)
+ public static Image Grayscale(this Image source, GrayscaleMode mode = GrayscaleMode.Bt709)
where TColor : IPackedVector
where TPacked : struct
{
- return Grayscale(source, source.Bounds, mode, progressHandler);
+ return Grayscale(source, source.Bounds, mode);
}
///
@@ -38,9 +37,8 @@ namespace ImageProcessorCore
/// The structure that specifies the portion of the image object to alter.
///
/// The formula to apply to perform the operation.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Grayscale(this Image source, Rectangle rectangle, GrayscaleMode mode = GrayscaleMode.Bt709, ProgressEventHandler progressHandler = null)
+ public static Image Grayscale(this Image source, Rectangle rectangle, GrayscaleMode mode = GrayscaleMode.Bt709)
where TColor : IPackedVector
where TPacked : struct
{
@@ -48,16 +46,7 @@ namespace ImageProcessorCore
? (IImageFilter)new GrayscaleBt709Processor()
: new GrayscaleBt601Processor();
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, processor);
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Hue.cs b/src/ImageProcessorCore/Filters/Hue.cs
index d4c86ac3a..18e3a8a1a 100644
--- a/src/ImageProcessorCore/Filters/Hue.cs
+++ b/src/ImageProcessorCore/Filters/Hue.cs
@@ -19,13 +19,12 @@ namespace ImageProcessorCore
/// The packed format. uint, long, float.
/// The image this method extends.
/// The angle in degrees to adjust the image.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Hue(this Image source, float degrees, ProgressEventHandler progressHandler = null)
+ public static Image Hue(this Image source, float degrees)
where TColor : IPackedVector
where TPacked : struct
{
- return Hue(source, degrees, source.Bounds, progressHandler);
+ return Hue(source, degrees, source.Bounds);
}
///
@@ -38,23 +37,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Hue(this Image source, float degrees, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Hue(this Image source, float degrees, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- HueProcessor processor = new HueProcessor(degrees);
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new HueProcessor(degrees));
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Invert.cs b/src/ImageProcessorCore/Filters/Invert.cs
index ed7124662..b2132da6f 100644
--- a/src/ImageProcessorCore/Filters/Invert.cs
+++ b/src/ImageProcessorCore/Filters/Invert.cs
@@ -18,13 +18,12 @@ namespace ImageProcessorCore
/// The pixel format.
/// The packed format. uint, long, float.
/// The image this method extends.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Invert(this Image source, ProgressEventHandler progressHandler = null)
+ public static Image Invert(this Image source)
where TColor : IPackedVector
where TPacked : struct
{
- return Invert(source, source.Bounds, progressHandler);
+ return Invert(source, source.Bounds);
}
///
@@ -36,23 +35,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Invert(this Image source, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Invert(this Image source, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- InvertProcessor processor = new InvertProcessor();
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new InvertProcessor());
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Kodachrome.cs b/src/ImageProcessorCore/Filters/Kodachrome.cs
index 7310703b0..32eb6dd9d 100644
--- a/src/ImageProcessorCore/Filters/Kodachrome.cs
+++ b/src/ImageProcessorCore/Filters/Kodachrome.cs
@@ -10,8 +10,6 @@ namespace ImageProcessorCore
///
/// Extension methods for the type.
///
- /// The pixel format.
- /// The packed format. uint, long, float.
public static partial class ImageExtensions
{
///
@@ -20,13 +18,12 @@ namespace ImageProcessorCore
/// The pixel format.
/// The packed format. uint, long, float.
/// The image this method extends.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Kodachrome(this Image source, ProgressEventHandler progressHandler = null)
+ public static Image Kodachrome(this Image source)
where TColor : IPackedVector
where TPacked : struct
{
- return Kodachrome(source, source.Bounds, progressHandler);
+ return Kodachrome(source, source.Bounds);
}
///
@@ -38,23 +35,12 @@ namespace ImageProcessorCore
///
/// The structure that specifies the portion of the image object to alter.
///
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Kodachrome(this Image source, Rectangle rectangle, ProgressEventHandler progressHandler = null)
+ public static Image Kodachrome(this Image source, Rectangle rectangle)
where TColor : IPackedVector
where TPacked : struct
{
- KodachromeProcessor processor = new KodachromeProcessor();
- processor.OnProgress += progressHandler;
-
- try
- {
- return source.Process(rectangle, processor);
- }
- finally
- {
- processor.OnProgress -= progressHandler;
- }
+ return source.Process(rectangle, new KodachromeProcessor());
}
}
}
diff --git a/src/ImageProcessorCore/Filters/Lomograph.cs b/src/ImageProcessorCore/Filters/Lomograph.cs
index fa5f094b4..dc5443bd2 100644
--- a/src/ImageProcessorCore/Filters/Lomograph.cs
+++ b/src/ImageProcessorCore/Filters/Lomograph.cs
@@ -18,13 +18,12 @@ namespace ImageProcessorCore
/// The pixel format.
/// The packed format. uint, long, float.
/// The image this method extends.
- /// A delegate which is called as progress is made processing the image.
/// The .
- public static Image Lomograph(this Image source, ProgressEventHandler progressHandler = null)
+ public static Image Lomograph(this Image