@@ -16,8 +16,8 @@ public static class DetectEdgesExtensions
1616 /// </summary>
1717 /// <param name="source">The current image processing context.</param>
1818 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
19- public static IImageProcessingContext DetectEdges ( this IImageProcessingContext source ) =>
20- DetectEdges ( source , KnownEdgeDetectorKernels . Sobel ) ;
19+ public static IImageProcessingContext DetectEdges ( this IImageProcessingContext source )
20+ => DetectEdges ( source , KnownEdgeDetectorKernels . Sobel ) ;
2121
2222 /// <summary>
2323 /// Detects any edges within the image.
@@ -28,21 +28,17 @@ public static IImageProcessingContext DetectEdges(this IImageProcessingContext s
2828 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
2929 /// </param>
3030 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
31- public static IImageProcessingContext DetectEdges (
32- this IImageProcessingContext source ,
33- Rectangle rectangle ) =>
34- DetectEdges ( source , KnownEdgeDetectorKernels . Sobel , rectangle ) ;
31+ public static IImageProcessingContext DetectEdges ( this IImageProcessingContext source , Rectangle rectangle )
32+ => DetectEdges ( source , rectangle , KnownEdgeDetectorKernels . Sobel ) ;
3533
3634 /// <summary>
3735 /// Detects any edges within the image operating in grayscale mode.
3836 /// </summary>
3937 /// <param name="source">The current image processing context.</param>
4038 /// <param name="kernel">The 2D edge detector kernel.</param>
4139 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
42- public static IImageProcessingContext DetectEdges (
43- this IImageProcessingContext source ,
44- EdgeDetector2DKernel kernel ) =>
45- DetectEdges ( source , kernel , true ) ;
40+ public static IImageProcessingContext DetectEdges ( this IImageProcessingContext source , EdgeDetector2DKernel kernel )
41+ => DetectEdges ( source , kernel , true ) ;
4642
4743 /// <summary>
4844 /// Detects any edges within the image using a <see cref="EdgeDetector2DKernel"/>.
@@ -57,60 +53,50 @@ public static IImageProcessingContext DetectEdges(
5753 this IImageProcessingContext source ,
5854 EdgeDetector2DKernel kernel ,
5955 bool grayscale )
60- {
61- var processor = new EdgeDetector2DProcessor ( kernel , grayscale ) ;
62- source . ApplyProcessor ( processor ) ;
63- return source ;
64- }
56+ => source . ApplyProcessor ( new EdgeDetector2DProcessor ( kernel , grayscale ) ) ;
6557
6658 /// <summary>
6759 /// Detects any edges within the image operating in grayscale mode.
6860 /// </summary>
6961 /// <param name="source">The current image processing context.</param>
70- /// <param name="kernel">The 2D edge detector kernel.</param>
7162 /// <param name="rectangle">
7263 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
7364 /// </param>
65+ /// <param name="kernel">The 2D edge detector kernel.</param>
7466 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
7567 public static IImageProcessingContext DetectEdges (
7668 this IImageProcessingContext source ,
77- EdgeDetector2DKernel kernel ,
78- Rectangle rectangle ) =>
79- DetectEdges ( source , kernel , true , rectangle ) ;
69+ Rectangle rectangle ,
70+ EdgeDetector2DKernel kernel )
71+ => DetectEdges ( source , rectangle , kernel , true ) ;
8072
8173 /// <summary>
8274 /// Detects any edges within the image using a <see cref="EdgeDetector2DKernel"/>.
8375 /// </summary>
8476 /// <param name="source">The current image processing context.</param>
77+ /// <param name="rectangle">
78+ /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
79+ /// </param>
8580 /// <param name="kernel">The 2D edge detector kernel.</param>
8681 /// <param name="grayscale">
8782 /// Whether to convert the image to grayscale before performing edge detection.
8883 /// </param>
89- /// <param name="rectangle">
90- /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
91- /// </param>
9284 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
9385 public static IImageProcessingContext DetectEdges (
9486 this IImageProcessingContext source ,
87+ Rectangle rectangle ,
9588 EdgeDetector2DKernel kernel ,
96- bool grayscale ,
97- Rectangle rectangle )
98- {
99- var processor = new EdgeDetector2DProcessor ( kernel , grayscale ) ;
100- source . ApplyProcessor ( processor , rectangle ) ;
101- return source ;
102- }
89+ bool grayscale )
90+ => source . ApplyProcessor ( new EdgeDetector2DProcessor ( kernel , grayscale ) , rectangle ) ;
10391
10492 /// <summary>
10593 /// Detects any edges within the image operating in grayscale mode.
10694 /// </summary>
10795 /// <param name="source">The current image processing context.</param>
10896 /// <param name="kernel">The edge detector kernel.</param>
10997 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
110- public static IImageProcessingContext DetectEdges (
111- this IImageProcessingContext source ,
112- EdgeDetectorKernel kernel ) =>
113- DetectEdges ( source , kernel , true ) ;
98+ public static IImageProcessingContext DetectEdges ( this IImageProcessingContext source , EdgeDetectorKernel kernel )
99+ => DetectEdges ( source , kernel , true ) ;
114100
115101 /// <summary>
116102 /// Detects any edges within the image using a <see cref="EdgeDetectorKernel"/>.
@@ -125,66 +111,56 @@ public static IImageProcessingContext DetectEdges(
125111 this IImageProcessingContext source ,
126112 EdgeDetectorKernel kernel ,
127113 bool grayscale )
128- {
129- var processor = new EdgeDetectorProcessor ( kernel , grayscale ) ;
130- source . ApplyProcessor ( processor ) ;
131- return source ;
132- }
114+ => source . ApplyProcessor ( new EdgeDetectorProcessor ( kernel , grayscale ) ) ;
133115
134116 /// <summary>
135117 /// Detects any edges within the image operating in grayscale mode.
136118 /// </summary>
137119 /// <param name="source">The current image processing context.</param>
138- /// <param name="kernel">The edge detector kernel.</param>
139120 /// <param name="rectangle">
140121 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
141122 /// </param>
123+ /// <param name="kernel">The edge detector kernel.</param>
142124 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
143125 public static IImageProcessingContext DetectEdges (
144126 this IImageProcessingContext source ,
145- EdgeDetectorKernel kernel ,
146- Rectangle rectangle ) =>
147- DetectEdges ( source , kernel , true , rectangle ) ;
127+ Rectangle rectangle ,
128+ EdgeDetectorKernel kernel )
129+ => DetectEdges ( source , rectangle , kernel , true ) ;
148130
149131 /// <summary>
150132 /// Detects any edges within the image using a <see cref="EdgeDetectorKernel"/>.
151133 /// </summary>
152134 /// <param name="source">The current image processing context.</param>
135+ /// <param name="rectangle">
136+ /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
137+ /// </param>
153138 /// <param name="kernel">The edge detector kernel.</param>
154139 /// <param name="grayscale">
155140 /// Whether to convert the image to grayscale before performing edge detection.
156141 /// </param>
157- /// <param name="rectangle">
158- /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
159- /// </param>
160142 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
161143 public static IImageProcessingContext DetectEdges (
162144 this IImageProcessingContext source ,
145+ Rectangle rectangle ,
163146 EdgeDetectorKernel kernel ,
164- bool grayscale ,
165- Rectangle rectangle )
166- {
167- var processor = new EdgeDetectorProcessor ( kernel , grayscale ) ;
168- source . ApplyProcessor ( processor , rectangle ) ;
169- return source ;
170- }
147+ bool grayscale )
148+ => source . ApplyProcessor ( new EdgeDetectorProcessor ( kernel , grayscale ) , rectangle ) ;
171149
172150 /// <summary>
173151 /// Detects any edges within the image operating in grayscale mode.
174152 /// </summary>
175153 /// <param name="source">The current image processing context.</param>
176- /// <param name="kernel">Thecompass edge detector kernel.</param>
154+ /// <param name="kernel">The compass edge detector kernel.</param>
177155 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
178- public static IImageProcessingContext DetectEdges (
179- this IImageProcessingContext source ,
180- EdgeDetectorCompassKernel kernel ) =>
181- DetectEdges ( source , kernel , true ) ;
156+ public static IImageProcessingContext DetectEdges ( this IImageProcessingContext source , EdgeDetectorCompassKernel kernel )
157+ => DetectEdges ( source , kernel , true ) ;
182158
183159 /// <summary>
184160 /// Detects any edges within the image using a <see cref="EdgeDetectorCompassKernel"/>.
185161 /// </summary>
186162 /// <param name="source">The current image processing context.</param>
187- /// <param name="kernel">Thecompass edge detector kernel.</param>
163+ /// <param name="kernel">The compass edge detector kernel.</param>
188164 /// <param name="grayscale">
189165 /// Whether to convert the image to grayscale before performing edge detection.
190166 /// </param>
@@ -193,47 +169,39 @@ public static IImageProcessingContext DetectEdges(
193169 this IImageProcessingContext source ,
194170 EdgeDetectorCompassKernel kernel ,
195171 bool grayscale )
196- {
197- var processor = new EdgeDetectorCompassProcessor ( kernel , grayscale ) ;
198- source . ApplyProcessor ( processor ) ;
199- return source ;
200- }
172+ => source . ApplyProcessor ( new EdgeDetectorCompassProcessor ( kernel , grayscale ) ) ;
201173
202174 /// <summary>
203175 /// Detects any edges within the image operating in grayscale mode.
204176 /// </summary>
205177 /// <param name="source">The current image processing context.</param>
206- /// <param name="kernel">Thecompass edge detector kernel.</param>
207178 /// <param name="rectangle">
208179 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
209180 /// </param>
181+ /// <param name="kernel">The compass edge detector kernel.</param>
210182 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
211183 public static IImageProcessingContext DetectEdges (
212184 this IImageProcessingContext source ,
213- EdgeDetectorCompassKernel kernel ,
214- Rectangle rectangle ) =>
215- DetectEdges ( source , kernel , true , rectangle ) ;
185+ Rectangle rectangle ,
186+ EdgeDetectorCompassKernel kernel )
187+ => DetectEdges ( source , rectangle , kernel , true ) ;
216188
217189 /// <summary>
218190 /// Detects any edges within the image using a <see cref="EdgeDetectorCompassKernel"/>.
219191 /// </summary>
220192 /// <param name="source">The current image processing context.</param>
221- /// <param name="kernel">Thecompass edge detector kernel.</param>
222- /// <param name="grayscale">
223- /// Whether to convert the image to grayscale before performing edge detection.
224- /// </param>
225193 /// <param name="rectangle">
226194 /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
227195 /// </param>
196+ /// <param name="kernel">The compass edge detector kernel.</param>
197+ /// <param name="grayscale">
198+ /// Whether to convert the image to grayscale before performing edge detection.
199+ /// </param>
228200 /// <returns>The <see cref="IImageProcessingContext"/>.</returns>
229201 public static IImageProcessingContext DetectEdges (
230202 this IImageProcessingContext source ,
203+ Rectangle rectangle ,
231204 EdgeDetectorCompassKernel kernel ,
232- bool grayscale ,
233- Rectangle rectangle )
234- {
235- var processor = new EdgeDetectorCompassProcessor ( kernel , grayscale ) ;
236- source . ApplyProcessor ( processor , rectangle ) ;
237- return source ;
238- }
205+ bool grayscale )
206+ => source . ApplyProcessor ( new EdgeDetectorCompassProcessor ( kernel , grayscale ) , rectangle ) ;
239207}
0 commit comments