Skip to content

Commit 843abfc

Browse files
committed
Moved Wave to IMagickImageCreateOperations.
1 parent 785cdc7 commit 843abfc

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

src/Magick.NET.Core/IMagickImage.cs

-15
Original file line numberDiff line numberDiff line change
@@ -2220,21 +2220,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
22202220
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
22212221
void Trim(Percentage percentBackground);
22222222

2223-
/// <summary>
2224-
/// Map image pixels to a sine wave.
2225-
/// </summary>
2226-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
2227-
void Wave();
2228-
2229-
/// <summary>
2230-
/// Map image pixels to a sine wave.
2231-
/// </summary>
2232-
/// <param name="method">The pixel interpolate method.</param>
2233-
/// <param name="amplitude">The amplitude.</param>
2234-
/// <param name="length">The length of the wave.</param>
2235-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
2236-
void Wave(PixelInterpolateMethod method, double amplitude, double length);
2237-
22382223
/// <summary>
22392224
/// Removes noise from the image using a wavelet transform.
22402225
/// </summary>

src/Magick.NET.Core/IMagickImageCreateOperations.cs

+15
Original file line numberDiff line numberDiff line change
@@ -1263,4 +1263,19 @@ public interface IMagickImageCreateOperations
12631263
/// <param name="y">the y ellipse offset.</param>
12641264
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
12651265
void Vignette(double radius, double sigma, int x, int y);
1266+
1267+
/// <summary>
1268+
/// Map image pixels to a sine wave.
1269+
/// </summary>
1270+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1271+
void Wave();
1272+
1273+
/// <summary>
1274+
/// Map image pixels to a sine wave.
1275+
/// </summary>
1276+
/// <param name="method">The pixel interpolate method.</param>
1277+
/// <param name="amplitude">The amplitude.</param>
1278+
/// <param name="length">The length of the wave.</param>
1279+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1280+
void Wave(PixelInterpolateMethod method, double amplitude, double length);
12661281
}

src/Magick.NET/MagickImage.CloneMutator.cs

+6
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,12 @@ public void Vignette()
716716
public void Vignette(double radius, double sigma, int x, int y)
717717
=> SetResult(NativeMagickImage.Vignette(radius, sigma, x, y));
718718

719+
public void Wave()
720+
=> Wave(NativeMagickImage.Interpolate_Get(), 25.0, 150.0);
721+
722+
public void Wave(PixelInterpolateMethod method, double amplitude, double length)
723+
=> SetResult(NativeMagickImage.Wave(method, amplitude, length));
724+
719725
protected virtual void SetResult(IntPtr result)
720726
{
721727
if (_result != IntPtr.Zero)

src/Magick.NET/MagickImage.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -6942,7 +6942,10 @@ public void Vignette(double radius, double sigma, int x, int y)
69426942
/// </summary>
69436943
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
69446944
public void Wave()
6945-
=> Wave(Interpolate, 25.0, 150.0);
6945+
{
6946+
using var mutator = new Mutator(_nativeInstance);
6947+
mutator.Wave();
6948+
}
69466949

69476950
/// <summary>
69486951
/// Map image pixels to a sine wave.
@@ -6952,7 +6955,10 @@ public void Wave()
69526955
/// <param name="length">The length of the wave.</param>
69536956
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
69546957
public void Wave(PixelInterpolateMethod method, double amplitude, double length)
6955-
=> _nativeInstance.Wave(method, amplitude, length);
6958+
{
6959+
using var mutator = new Mutator(_nativeInstance);
6960+
mutator.Wave(method, amplitude, length);
6961+
}
69566962

69576963
/// <summary>
69586964
/// Removes noise from the image using a wavelet transform.

src/Magick.NET/Native/MagickImage.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
787787
public partial IntPtr Vignette(double radius, double sigma, nint x, nint y);
788788

789789
[Throws]
790-
[SetInstance]
791-
public partial void Wave(PixelInterpolateMethod method, double amplitude, double length);
790+
public partial IntPtr Wave(PixelInterpolateMethod method, double amplitude, double length);
792791

793792
[Throws]
794793
public partial void WhiteBalance();

0 commit comments

Comments
 (0)