@@ -4140,7 +4140,7 @@ public void Morphology(MorphologyMethod method, Kernel kernel, Channels channels
4140
4140
/// <param name="method">The morphology method.</param>
4141
4141
/// <param name="kernel">Built-in kernel.</param>
4142
4142
/// <param name="channels">The channels to apply the kernel to.</param>
4143
- /// <param name="iterations">The number of iterations.</param>
4143
+ /// <param name="iterations">The number of iterations. A value of -1 means loop until no change found. </param>
4144
4144
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
4145
4145
public void Morphology ( MorphologyMethod method , Kernel kernel , Channels channels , int iterations )
4146
4146
=> Morphology ( method , kernel , string . Empty , channels , iterations ) ;
@@ -4150,7 +4150,7 @@ public void Morphology(MorphologyMethod method, Kernel kernel, Channels channels
4150
4150
/// </summary>
4151
4151
/// <param name="method">The morphology method.</param>
4152
4152
/// <param name="kernel">Built-in kernel.</param>
4153
- /// <param name="iterations">The number of iterations.</param>
4153
+ /// <param name="iterations">The number of iterations. A value of -1 means loop until no change found. </param>
4154
4154
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
4155
4155
public void Morphology ( MorphologyMethod method , Kernel kernel , int iterations )
4156
4156
=> Morphology ( method , kernel , string . Empty , ImageMagick . Channels . Undefined , iterations ) ;
@@ -4183,7 +4183,7 @@ public void Morphology(MorphologyMethod method, Kernel kernel, string? arguments
4183
4183
/// <param name="kernel">Built-in kernel.</param>
4184
4184
/// <param name="arguments">Kernel arguments.</param>
4185
4185
/// <param name="channels">The channels to apply the kernel to.</param>
4186
- /// <param name="iterations">The number of iterations.</param>
4186
+ /// <param name="iterations">The number of iterations. A value of -1 means loop until no change found. </param>
4187
4187
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
4188
4188
public void Morphology ( MorphologyMethod method , Kernel kernel , string ? arguments , Channels channels , int iterations )
4189
4189
{
@@ -4198,7 +4198,7 @@ public void Morphology(MorphologyMethod method, Kernel kernel, string? arguments
4198
4198
/// <param name="method">The morphology method.</param>
4199
4199
/// <param name="kernel">Built-in kernel.</param>
4200
4200
/// <param name="arguments">Kernel arguments.</param>
4201
- /// <param name="iterations">The number of iterations.</param>
4201
+ /// <param name="iterations">The number of iterations. A value of -1 means loop until no change found. </param>
4202
4202
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
4203
4203
public void Morphology ( MorphologyMethod method , Kernel kernel , string ? arguments , int iterations )
4204
4204
=> Morphology ( method , kernel , arguments , ImageMagick . Channels . Undefined , iterations ) ;
@@ -4228,17 +4228,21 @@ public void Morphology(MorphologyMethod method, string userKernel, Channels chan
4228
4228
/// <param name="method">The morphology method.</param>
4229
4229
/// <param name="userKernel">User suplied kernel.</param>
4230
4230
/// <param name="channels">The channels to apply the kernel to.</param>
4231
- /// <param name="iterations">The number of iterations.</param>
4231
+ /// <param name="iterations">The number of iterations. A value of -1 means loop until no change found. </param>
4232
4232
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
4233
4233
public void Morphology ( MorphologyMethod method , string userKernel , Channels channels , int iterations )
4234
- => _nativeInstance . Morphology ( method , userKernel , channels , iterations ) ;
4234
+ {
4235
+ Throw . IfTrue ( nameof ( iterations ) , iterations < - 1 , "The number of iterations must be unlimited (-1) or positive" ) ;
4236
+
4237
+ _nativeInstance . Morphology ( method , userKernel , channels , iterations ) ;
4238
+ }
4235
4239
4236
4240
/// <summary>
4237
4241
/// Applies a kernel to the image according to the given mophology method.
4238
4242
/// </summary>
4239
4243
/// <param name="method">The morphology method.</param>
4240
4244
/// <param name="userKernel">User suplied kernel.</param>
4241
- /// <param name="iterations">The number of iterations.</param>
4245
+ /// <param name="iterations">The number of iterations. A value of -1 means loop until no change found. </param>
4242
4246
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
4243
4247
public void Morphology ( MorphologyMethod method , string userKernel , int iterations )
4244
4248
=> Morphology ( method , userKernel , ImageMagick . Channels . Undefined , iterations ) ;
0 commit comments