Skip to content

Commit cb4c521

Browse files
committed
Moved WaveletDenoise to IMagickImageCreateOperations.
1 parent 843abfc commit cb4c521

7 files changed

+56
-33
lines changed

src/Magick.NET.Core/IMagickImage.cs

-13
Original file line numberDiff line numberDiff line change
@@ -2220,19 +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-
/// Removes noise from the image using a wavelet transform.
2225-
/// </summary>
2226-
/// <param name="thresholdPercentage">The threshold for smoothing.</param>
2227-
void WaveletDenoise(Percentage thresholdPercentage);
2228-
2229-
/// <summary>
2230-
/// Removes noise from the image using a wavelet transform.
2231-
/// </summary>
2232-
/// <param name="thresholdPercentage">The threshold for smoothing.</param>
2233-
/// <param name="softness">Attenuate the smoothing threshold.</param>
2234-
void WaveletDenoise(Percentage thresholdPercentage, double softness);
2235-
22362223
/// <summary>
22372224
/// Apply a white balancing to an image according to a grayworld assumption in the LAB colorspace.
22382225
/// </summary>

src/Magick.NET.Core/IMagickImageCreateOperations.cs

+13
Original file line numberDiff line numberDiff line change
@@ -1278,4 +1278,17 @@ public interface IMagickImageCreateOperations
12781278
/// <param name="length">The length of the wave.</param>
12791279
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
12801280
void Wave(PixelInterpolateMethod method, double amplitude, double length);
1281+
1282+
/// <summary>
1283+
/// Removes noise from the image using a wavelet transform.
1284+
/// </summary>
1285+
/// <param name="thresholdPercentage">The threshold for smoothing.</param>
1286+
void WaveletDenoise(Percentage thresholdPercentage);
1287+
1288+
/// <summary>
1289+
/// Removes noise from the image using a wavelet transform.
1290+
/// </summary>
1291+
/// <param name="thresholdPercentage">The threshold for smoothing.</param>
1292+
/// <param name="softness">Attenuate the smoothing threshold.</param>
1293+
void WaveletDenoise(Percentage thresholdPercentage, double softness);
12811294
}

src/Magick.NET.Core/IMagickImageCreateOperations{TQuantumType}.cs

+13
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,17 @@ public interface IMagickImageCreateOperations<TQuantumType> : IMagickImageCreate
133133
/// <param name="color">A color value used for tinting.</param>
134134
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
135135
void Tint(IMagickGeometry opacity, IMagickColor<TQuantumType> color);
136+
137+
/// <summary>
138+
/// Removes noise from the image using a wavelet transform.
139+
/// </summary>
140+
/// <param name="threshold">The threshold for smoothing.</param>
141+
void WaveletDenoise(TQuantumType threshold);
142+
143+
/// <summary>
144+
/// Removes noise from the image using a wavelet transform.
145+
/// </summary>
146+
/// <param name="threshold">The threshold for smoothing.</param>
147+
/// <param name="softness">Attenuate the smoothing threshold.</param>
148+
void WaveletDenoise(TQuantumType threshold, double softness);
136149
}

src/Magick.NET.Core/IMagickImage{TQuantumType}.cs

-13
Original file line numberDiff line numberDiff line change
@@ -926,17 +926,4 @@ public partial interface IMagickImage<TQuantumType> : IMagickImageCreateOperatio
926926
/// <returns>The unique colors of an image.</returns>
927927
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
928928
IMagickImage<TQuantumType>? UniqueColors();
929-
930-
/// <summary>
931-
/// Removes noise from the image using a wavelet transform.
932-
/// </summary>
933-
/// <param name="threshold">The threshold for smoothing.</param>
934-
void WaveletDenoise(TQuantumType threshold);
935-
936-
/// <summary>
937-
/// Removes noise from the image using a wavelet transform.
938-
/// </summary>
939-
/// <param name="threshold">The threshold for smoothing.</param>
940-
/// <param name="softness">Attenuate the smoothing threshold.</param>
941-
void WaveletDenoise(TQuantumType threshold, double softness);
942929
}

src/Magick.NET/MagickImage.CloneMutator.cs

+12
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,18 @@ public void Wave()
722722
public void Wave(PixelInterpolateMethod method, double amplitude, double length)
723723
=> SetResult(NativeMagickImage.Wave(method, amplitude, length));
724724

725+
public void WaveletDenoise(QuantumType threshold)
726+
=> WaveletDenoise(threshold, 0.0);
727+
728+
public void WaveletDenoise(QuantumType threshold, double softness)
729+
=> SetResult(NativeMagickImage.WaveletDenoise(threshold, softness));
730+
731+
public void WaveletDenoise(Percentage thresholdPercentage)
732+
=> WaveletDenoise(PercentageHelper.ToQuantumType(nameof(thresholdPercentage), thresholdPercentage));
733+
734+
public void WaveletDenoise(Percentage thresholdPercentage, double softness)
735+
=> WaveletDenoise(PercentageHelper.ToQuantumType(nameof(thresholdPercentage), thresholdPercentage), softness);
736+
725737
protected virtual void SetResult(IntPtr result)
726738
{
727739
if (_result != IntPtr.Zero)

src/Magick.NET/MagickImage.cs

+16-4
Original file line numberDiff line numberDiff line change
@@ -6965,30 +6965,42 @@ public void Wave(PixelInterpolateMethod method, double amplitude, double length)
69656965
/// </summary>
69666966
/// <param name="threshold">The threshold for smoothing.</param>
69676967
public void WaveletDenoise(QuantumType threshold)
6968-
=> WaveletDenoise(threshold, 0.0);
6968+
{
6969+
using var mutator = new Mutator(_nativeInstance);
6970+
mutator.WaveletDenoise(threshold);
6971+
}
69696972

69706973
/// <summary>
69716974
/// Removes noise from the image using a wavelet transform.
69726975
/// </summary>
69736976
/// <param name="threshold">The threshold for smoothing.</param>
69746977
/// <param name="softness">Attenuate the smoothing threshold.</param>
69756978
public void WaveletDenoise(QuantumType threshold, double softness)
6976-
=> _nativeInstance.WaveletDenoise(threshold, softness);
6979+
{
6980+
using var mutator = new Mutator(_nativeInstance);
6981+
mutator.WaveletDenoise(threshold, softness);
6982+
}
69776983

69786984
/// <summary>
69796985
/// Removes noise from the image using a wavelet transform.
69806986
/// </summary>
69816987
/// <param name="thresholdPercentage">The threshold for smoothing.</param>
69826988
public void WaveletDenoise(Percentage thresholdPercentage)
6983-
=> WaveletDenoise(PercentageHelper.ToQuantumType(nameof(thresholdPercentage), thresholdPercentage));
6989+
{
6990+
using var mutator = new Mutator(_nativeInstance);
6991+
mutator.WaveletDenoise(thresholdPercentage);
6992+
}
69846993

69856994
/// <summary>
69866995
/// Removes noise from the image using a wavelet transform.
69876996
/// </summary>
69886997
/// <param name="thresholdPercentage">The threshold for smoothing.</param>
69896998
/// <param name="softness">Attenuate the smoothing threshold.</param>
69906999
public void WaveletDenoise(Percentage thresholdPercentage, double softness)
6991-
=> WaveletDenoise(PercentageHelper.ToQuantumType(nameof(thresholdPercentage), thresholdPercentage), softness);
7000+
{
7001+
using var mutator = new Mutator(_nativeInstance);
7002+
mutator.WaveletDenoise(thresholdPercentage, softness);
7003+
}
69927004

69937005
/// <summary>
69947006
/// Apply a white balancing to an image according to a grayworld assumption in the LAB colorspace.

src/Magick.NET/Native/MagickImage.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,10 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
790790
public partial IntPtr Wave(PixelInterpolateMethod method, double amplitude, double length);
791791

792792
[Throws]
793-
public partial void WhiteBalance();
793+
public partial IntPtr WaveletDenoise(double threshold, double softness);
794794

795795
[Throws]
796-
[SetInstance]
797-
public partial void WaveletDenoise(double threshold, double softness);
796+
public partial void WhiteBalance();
798797

799798
[Throws]
800799
public partial void WhiteThreshold(string threshold, Channels channels);

0 commit comments

Comments
 (0)