Skip to content

Commit 0c6df40

Browse files
committed
Moved AdaptiveSharpen to IMagickImageCreateOperations.
1 parent 3b69e25 commit 0c6df40

File tree

5 files changed

+62
-39
lines changed

5 files changed

+62
-39
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -253,39 +253,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
253253
/// </summary>
254254
uint Width { get; }
255255

256-
/// <summary>
257-
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
258-
/// intensely far from edges.
259-
/// </summary>
260-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
261-
void AdaptiveSharpen();
262-
263-
/// <summary>
264-
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
265-
/// intensely far from edges.
266-
/// </summary>
267-
/// <param name="channels">The channel(s) that should be sharpened.</param>
268-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
269-
void AdaptiveSharpen(Channels channels);
270-
271-
/// <summary>
272-
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
273-
/// intensely far from edges.
274-
/// </summary>
275-
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
276-
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
277-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
278-
void AdaptiveSharpen(double radius, double sigma);
279-
280-
/// <summary>
281-
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
282-
/// intensely far from edges.
283-
/// </summary>
284-
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
285-
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
286-
/// <param name="channels">The channel(s) that should be sharpened.</param>
287-
void AdaptiveSharpen(double radius, double sigma, Channels channels);
288-
289256
/// <summary>
290257
/// Local adaptive threshold image.
291258
/// http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm.

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,39 @@ public interface IMagickImageCreateOperations
5151
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
5252
void AdaptiveResize(IMagickGeometry geometry);
5353

54+
/// <summary>
55+
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
56+
/// intensely far from edges.
57+
/// </summary>
58+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
59+
void AdaptiveSharpen();
60+
61+
/// <summary>
62+
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
63+
/// intensely far from edges.
64+
/// </summary>
65+
/// <param name="channels">The channel(s) that should be sharpened.</param>
66+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
67+
void AdaptiveSharpen(Channels channels);
68+
69+
/// <summary>
70+
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
71+
/// intensely far from edges.
72+
/// </summary>
73+
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
74+
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
75+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
76+
void AdaptiveSharpen(double radius, double sigma);
77+
78+
/// <summary>
79+
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
80+
/// intensely far from edges.
81+
/// </summary>
82+
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
83+
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
84+
/// <param name="channels">The channel(s) that should be sharpened.</param>
85+
void AdaptiveSharpen(double radius, double sigma, Channels channels);
86+
5487
/// <summary>
5588
/// Resize image to specified size.
5689
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ public void AdaptiveResize(IMagickGeometry geometry)
4949
SetResult(NativeMagickImage.AdaptiveResize(geometry.ToString()));
5050
}
5151

52+
public void AdaptiveSharpen()
53+
=> AdaptiveSharpen(0.0, 1.0);
54+
55+
public void AdaptiveSharpen(Channels channels)
56+
=> AdaptiveSharpen(0.0, 1.0, channels);
57+
58+
public void AdaptiveSharpen(double radius, double sigma)
59+
=> AdaptiveSharpen(radius, sigma, ImageMagick.Channels.Undefined);
60+
61+
public void AdaptiveSharpen(double radius, double sigma, Channels channels)
62+
=> SetResult(NativeMagickImage.AdaptiveSharpen(radius, sigma, channels));
63+
5264
public void Resize(uint width, uint height)
5365
=> Resize(new MagickGeometry(width, height));
5466

src/Magick.NET/MagickImage.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,10 @@ public void AdaptiveResize(IMagickGeometry geometry)
968968
/// </summary>
969969
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
970970
public void AdaptiveSharpen()
971-
=> AdaptiveSharpen(0.0, 1.0);
971+
{
972+
using var mutator = new Mutator(_nativeInstance);
973+
mutator.AdaptiveSharpen();
974+
}
972975

973976
/// <summary>
974977
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
@@ -977,7 +980,10 @@ public void AdaptiveSharpen()
977980
/// <param name="channels">The channel(s) that should be sharpened.</param>
978981
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
979982
public void AdaptiveSharpen(Channels channels)
980-
=> AdaptiveSharpen(0.0, 1.0, channels);
983+
{
984+
using var mutator = new Mutator(_nativeInstance);
985+
mutator.AdaptiveSharpen(channels);
986+
}
981987

982988
/// <summary>
983989
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
@@ -987,7 +993,10 @@ public void AdaptiveSharpen(Channels channels)
987993
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
988994
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
989995
public void AdaptiveSharpen(double radius, double sigma)
990-
=> AdaptiveSharpen(radius, sigma, ImageMagick.Channels.Undefined);
996+
{
997+
using var mutator = new Mutator(_nativeInstance);
998+
mutator.AdaptiveSharpen(radius, sigma);
999+
}
9911000

9921001
/// <summary>
9931002
/// Adaptively sharpens the image by sharpening more intensely near image edges and less
@@ -997,7 +1006,10 @@ public void AdaptiveSharpen(double radius, double sigma)
9971006
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
9981007
/// <param name="channels">The channel(s) that should be sharpened.</param>
9991008
public void AdaptiveSharpen(double radius, double sigma, Channels channels)
1000-
=> _nativeInstance.AdaptiveSharpen(radius, sigma, channels);
1009+
{
1010+
using var mutator = new Mutator(_nativeInstance);
1011+
mutator.AdaptiveSharpen(radius, sigma, channels);
1012+
}
10011013

10021014
/// <summary>
10031015
/// Local adaptive threshold image.

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
233233
public partial IntPtr AdaptiveResize(string geometry);
234234

235235
[Throws]
236-
[SetInstance]
237-
public partial void AdaptiveSharpen(double radius, double sigma, Channels channels);
236+
public partial IntPtr AdaptiveSharpen(double radius, double sigma, Channels channels);
238237

239238
[Throws]
240239
[SetInstance]

0 commit comments

Comments
 (0)