Skip to content

Commit df7e9dd

Browse files
committed
Moved AdaptiveBlur to IMagickImageCreateOperations.
1 parent 987e06b commit df7e9dd

File tree

5 files changed

+43
-26
lines changed

5 files changed

+43
-26
lines changed

src/Magick.NET.Core/IMagickImage.cs

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

256-
/// <summary>
257-
/// Adaptive-blur image with the default blur factor (0x1).
258-
/// </summary>
259-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
260-
void AdaptiveBlur();
261-
262-
/// <summary>
263-
/// Adaptive-blur image with specified blur factor.
264-
/// </summary>
265-
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
266-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
267-
void AdaptiveBlur(double radius);
268-
269-
/// <summary>
270-
/// Adaptive-blur image with specified blur factor.
271-
/// </summary>
272-
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
273-
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
274-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
275-
void AdaptiveBlur(double radius, double sigma);
276-
277256
/// <summary>
278257
/// Resize using mesh interpolation. It works well for small resizes of less than +/- 50%
279258
/// of the original image size. For larger resizing on images a full filtered and slower resize

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ namespace ImageMagick;
88
/// </summary>
99
public interface IMagickImageCreateOperations
1010
{
11+
/// <summary>
12+
/// Adaptive-blur image with the default blur factor (0x1).
13+
/// </summary>
14+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
15+
void AdaptiveBlur();
16+
17+
/// <summary>
18+
/// Adaptive-blur image with specified blur factor.
19+
/// </summary>
20+
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
21+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
22+
void AdaptiveBlur(double radius);
23+
24+
/// <summary>
25+
/// Adaptive-blur image with specified blur factor.
26+
/// </summary>
27+
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
28+
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
29+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
30+
void AdaptiveBlur(double radius, double sigma);
31+
1132
/// <summary>
1233
/// Resize image to specified size.
1334
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ public IntPtr GetResult()
3030
return result;
3131
}
3232

33+
public void AdaptiveBlur()
34+
=> AdaptiveBlur(0.0, 1.0);
35+
36+
public void AdaptiveBlur(double radius)
37+
=> AdaptiveBlur(radius, 1.0);
38+
39+
public void AdaptiveBlur(double radius, double sigma)
40+
=> SetResult(NativeMagickImage.AdaptiveBlur(radius, sigma));
41+
3342
public void Resize(uint width, uint height)
3443
=> Resize(new MagickGeometry(width, height));
3544

src/Magick.NET/MagickImage.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,15 +904,21 @@ public static IMagickImage<QuantumType> FromBase64(string value)
904904
/// </summary>
905905
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
906906
public void AdaptiveBlur()
907-
=> AdaptiveBlur(0.0, 1.0);
907+
{
908+
using var mutator = new Mutator(_nativeInstance);
909+
mutator.AdaptiveBlur();
910+
}
908911

909912
/// <summary>
910913
/// Adaptive-blur image with specified blur factor.
911914
/// </summary>
912915
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
913916
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
914917
public void AdaptiveBlur(double radius)
915-
=> AdaptiveBlur(radius, 1.0);
918+
{
919+
using var mutator = new Mutator(_nativeInstance);
920+
mutator.AdaptiveBlur(radius);
921+
}
916922

917923
/// <summary>
918924
/// Adaptive-blur image with specified blur factor.
@@ -921,7 +927,10 @@ public void AdaptiveBlur(double radius)
921927
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
922928
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
923929
public void AdaptiveBlur(double radius, double sigma)
924-
=> _nativeInstance.AdaptiveBlur(radius, sigma);
930+
{
931+
using var mutator = new Mutator(_nativeInstance);
932+
mutator.AdaptiveBlur(radius, sigma);
933+
}
925934

926935
/// <summary>
927936
/// Resize using mesh interpolation. It works well for small resizes of less than +/- 50%

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
227227
public partial nuint Width_Get();
228228

229229
[Throws]
230-
[SetInstance]
231-
public partial void AdaptiveBlur(double radius, double sigma);
230+
public partial IntPtr AdaptiveBlur(double radius, double sigma);
232231

233232
[Throws]
234233
[SetInstance]

0 commit comments

Comments
 (0)