Skip to content

Commit 648c1e0

Browse files
committed
Moved Kuwahara to IMagickImageCreateOperations.
1 parent 9e044c3 commit 648c1e0

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,20 +1245,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
12451245
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
12461246
void Kmeans(IKmeansSettings settings);
12471247

1248-
/// <summary>
1249-
/// An edge preserving noise reduction filter.
1250-
/// </summary>
1251-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1252-
void Kuwahara();
1253-
1254-
/// <summary>
1255-
/// An edge preserving noise reduction filter.
1256-
/// </summary>
1257-
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
1258-
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
1259-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1260-
void Kuwahara(double radius, double sigma);
1261-
12621248
/// <summary>
12631249
/// Adjust the levels of the image by scaling the colors falling between specified white and
12641250
/// black points to the full available quantum range.

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,20 @@ public interface IMagickImageCreateOperations
618618
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
619619
void InterpolativeResize(Percentage percentageWidth, Percentage percentageHeight, PixelInterpolateMethod method);
620620

621+
/// <summary>
622+
/// An edge preserving noise reduction filter.
623+
/// </summary>
624+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
625+
void Kuwahara();
626+
627+
/// <summary>
628+
/// An edge preserving noise reduction filter.
629+
/// </summary>
630+
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
631+
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
632+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
633+
void Kuwahara(double radius, double sigma);
634+
621635
/// <summary>
622636
/// Resize image to specified size.
623637
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ public void InterpolativeResize(Percentage percentage, PixelInterpolateMethod me
351351
public void InterpolativeResize(Percentage percentageWidth, Percentage percentageHeight, PixelInterpolateMethod method)
352352
=> InterpolativeResize(new MagickGeometry(percentageWidth, percentageHeight), method);
353353

354+
public void Kuwahara()
355+
=> Kuwahara(0.0, 1.0);
356+
357+
public void Kuwahara(double radius, double sigma)
358+
=> SetResult(NativeMagickImage.Kuwahara(radius, sigma));
359+
354360
public void Resize(uint width, uint height)
355361
=> Resize(new MagickGeometry(width, height));
356362

src/Magick.NET/MagickImage.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3811,7 +3811,10 @@ public void Kmeans(IKmeansSettings settings)
38113811
/// </summary>
38123812
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
38133813
public void Kuwahara()
3814-
=> Kuwahara(0.0, 1.0);
3814+
{
3815+
using var mutator = new Mutator(_nativeInstance);
3816+
mutator.Kuwahara();
3817+
}
38153818

38163819
/// <summary>
38173820
/// An edge preserving noise reduction filter.
@@ -3820,7 +3823,10 @@ public void Kuwahara()
38203823
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
38213824
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
38223825
public void Kuwahara(double radius, double sigma)
3823-
=> _nativeInstance.Kuwahara(radius, sigma);
3826+
{
3827+
using var mutator = new Mutator(_nativeInstance);
3828+
mutator.Kuwahara(radius, sigma);
3829+
}
38243830

38253831
/// <summary>
38263832
/// Adjust the levels of the image by scaling the colors falling between specified white and

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
498498
public partial void Kmeans(nuint numberColors, nuint maxIterations, double tolerance);
499499

500500
[Throws]
501-
[SetInstance]
502-
public partial void Kuwahara(double radius, double sigma);
501+
public partial IntPtr Kuwahara(double radius, double sigma);
503502

504503
[Throws]
505504
public partial void Level(double blackPoint, double whitePoint, double gamma, Channels channels);

0 commit comments

Comments
 (0)