@@ -16,8 +16,8 @@ public static class DetectEdgesExtensions
16
16
/// </summary>
17
17
/// <param name="source">The current image processing context.</param>
18
18
/// <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 ) ;
21
21
22
22
/// <summary>
23
23
/// Detects any edges within the image.
@@ -28,21 +28,17 @@ public static IImageProcessingContext DetectEdges(this IImageProcessingContext s
28
28
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
29
29
/// </param>
30
30
/// <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 ) ;
35
33
36
34
/// <summary>
37
35
/// Detects any edges within the image operating in grayscale mode.
38
36
/// </summary>
39
37
/// <param name="source">The current image processing context.</param>
40
38
/// <param name="kernel">The 2D edge detector kernel.</param>
41
39
/// <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 ) ;
46
42
47
43
/// <summary>
48
44
/// Detects any edges within the image using a <see cref="EdgeDetector2DKernel"/>.
@@ -57,60 +53,50 @@ public static IImageProcessingContext DetectEdges(
57
53
this IImageProcessingContext source ,
58
54
EdgeDetector2DKernel kernel ,
59
55
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 ) ) ;
65
57
66
58
/// <summary>
67
59
/// Detects any edges within the image operating in grayscale mode.
68
60
/// </summary>
69
61
/// <param name="source">The current image processing context.</param>
70
- /// <param name="kernel">The 2D edge detector kernel.</param>
71
62
/// <param name="rectangle">
72
63
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
73
64
/// </param>
65
+ /// <param name="kernel">The 2D edge detector kernel.</param>
74
66
/// <returns>The <see cref="IImageProcessingContext"/>.</returns>
75
67
public static IImageProcessingContext DetectEdges (
76
68
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 ) ;
80
72
81
73
/// <summary>
82
74
/// Detects any edges within the image using a <see cref="EdgeDetector2DKernel"/>.
83
75
/// </summary>
84
76
/// <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>
85
80
/// <param name="kernel">The 2D edge detector kernel.</param>
86
81
/// <param name="grayscale">
87
82
/// Whether to convert the image to grayscale before performing edge detection.
88
83
/// </param>
89
- /// <param name="rectangle">
90
- /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
91
- /// </param>
92
84
/// <returns>The <see cref="IImageProcessingContext"/>.</returns>
93
85
public static IImageProcessingContext DetectEdges (
94
86
this IImageProcessingContext source ,
87
+ Rectangle rectangle ,
95
88
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 ) ;
103
91
104
92
/// <summary>
105
93
/// Detects any edges within the image operating in grayscale mode.
106
94
/// </summary>
107
95
/// <param name="source">The current image processing context.</param>
108
96
/// <param name="kernel">The edge detector kernel.</param>
109
97
/// <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 ) ;
114
100
115
101
/// <summary>
116
102
/// Detects any edges within the image using a <see cref="EdgeDetectorKernel"/>.
@@ -125,66 +111,56 @@ public static IImageProcessingContext DetectEdges(
125
111
this IImageProcessingContext source ,
126
112
EdgeDetectorKernel kernel ,
127
113
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 ) ) ;
133
115
134
116
/// <summary>
135
117
/// Detects any edges within the image operating in grayscale mode.
136
118
/// </summary>
137
119
/// <param name="source">The current image processing context.</param>
138
- /// <param name="kernel">The edge detector kernel.</param>
139
120
/// <param name="rectangle">
140
121
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
141
122
/// </param>
123
+ /// <param name="kernel">The edge detector kernel.</param>
142
124
/// <returns>The <see cref="IImageProcessingContext"/>.</returns>
143
125
public static IImageProcessingContext DetectEdges (
144
126
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 ) ;
148
130
149
131
/// <summary>
150
132
/// Detects any edges within the image using a <see cref="EdgeDetectorKernel"/>.
151
133
/// </summary>
152
134
/// <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>
153
138
/// <param name="kernel">The edge detector kernel.</param>
154
139
/// <param name="grayscale">
155
140
/// Whether to convert the image to grayscale before performing edge detection.
156
141
/// </param>
157
- /// <param name="rectangle">
158
- /// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
159
- /// </param>
160
142
/// <returns>The <see cref="IImageProcessingContext"/>.</returns>
161
143
public static IImageProcessingContext DetectEdges (
162
144
this IImageProcessingContext source ,
145
+ Rectangle rectangle ,
163
146
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 ) ;
171
149
172
150
/// <summary>
173
151
/// Detects any edges within the image operating in grayscale mode.
174
152
/// </summary>
175
153
/// <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>
177
155
/// <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 ) ;
182
158
183
159
/// <summary>
184
160
/// Detects any edges within the image using a <see cref="EdgeDetectorCompassKernel"/>.
185
161
/// </summary>
186
162
/// <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>
188
164
/// <param name="grayscale">
189
165
/// Whether to convert the image to grayscale before performing edge detection.
190
166
/// </param>
@@ -193,47 +169,39 @@ public static IImageProcessingContext DetectEdges(
193
169
this IImageProcessingContext source ,
194
170
EdgeDetectorCompassKernel kernel ,
195
171
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 ) ) ;
201
173
202
174
/// <summary>
203
175
/// Detects any edges within the image operating in grayscale mode.
204
176
/// </summary>
205
177
/// <param name="source">The current image processing context.</param>
206
- /// <param name="kernel">Thecompass edge detector kernel.</param>
207
178
/// <param name="rectangle">
208
179
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
209
180
/// </param>
181
+ /// <param name="kernel">The compass edge detector kernel.</param>
210
182
/// <returns>The <see cref="IImageProcessingContext"/>.</returns>
211
183
public static IImageProcessingContext DetectEdges (
212
184
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 ) ;
216
188
217
189
/// <summary>
218
190
/// Detects any edges within the image using a <see cref="EdgeDetectorCompassKernel"/>.
219
191
/// </summary>
220
192
/// <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>
225
193
/// <param name="rectangle">
226
194
/// The <see cref="Rectangle"/> structure that specifies the portion of the image object to alter.
227
195
/// </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>
228
200
/// <returns>The <see cref="IImageProcessingContext"/>.</returns>
229
201
public static IImageProcessingContext DetectEdges (
230
202
this IImageProcessingContext source ,
203
+ Rectangle rectangle ,
231
204
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 ) ;
239
207
}
0 commit comments