Skip to content

Commit

Permalink
Moved OilPaint to IMagickImageCreateOperations.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Dec 23, 2024
1 parent 04146e0 commit 8323cef
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
14 changes: 0 additions & 14 deletions src/Magick.NET.Core/IMagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1395,20 +1395,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void Normalize();

/// <summary>
/// Oilpaint image (image looks like oil painting).
/// </summary>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void OilPaint();

/// <summary>
/// Oilpaint image (image looks like oil painting).
/// </summary>
/// <param name="radius">The radius of the circular neighborhood.</param>
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void OilPaint(double radius, double sigma);

/// <summary>
/// Perform a ordered dither based on a number of pre-defined dithering threshold maps, but over
/// multiple intensity levels.
Expand Down
14 changes: 14 additions & 0 deletions src/Magick.NET.Core/IMagickImageCreateOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,20 @@ public interface IMagickImageCreateOperations
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void MotionBlur(double radius, double sigma, double angle);

/// <summary>
/// Oilpaint image (image looks like oil painting).
/// </summary>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void OilPaint();

/// <summary>
/// Oilpaint image (image looks like oil painting).
/// </summary>
/// <param name="radius">The radius of the circular neighborhood.</param>
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void OilPaint(double radius, double sigma);

/// <summary>
/// Resize image to specified size.
/// <para />
Expand Down
6 changes: 6 additions & 0 deletions src/Magick.NET/MagickImage.CloneMutator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ public void Morphology(IMorphologySettings settings)
public void MotionBlur(double radius, double sigma, double angle)
=> SetResult(NativeMagickImage.MotionBlur(radius, sigma, angle));

public void OilPaint()
=> OilPaint(3.0, 1.0);

public void OilPaint(double radius, double sigma)
=> SetResult(NativeMagickImage.OilPaint(radius, sigma));

public void Resize(uint width, uint height)
=> Resize(new MagickGeometry(width, height));

Expand Down
10 changes: 8 additions & 2 deletions src/Magick.NET/MagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4271,7 +4271,10 @@ public void Normalize()
/// </summary>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void OilPaint()
=> OilPaint(3.0, 1.0);
{
using var mutator = new Mutator(_nativeInstance);
mutator.OilPaint();
}

/// <summary>
/// Oilpaint image (image looks like oil painting).
Expand All @@ -4280,7 +4283,10 @@ public void OilPaint()
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void OilPaint(double radius, double sigma)
=> _nativeInstance.OilPaint(radius, sigma);
{
using var mutator = new Mutator(_nativeInstance);
mutator.OilPaint(radius, sigma);
}

/// <summary>
/// Changes any pixel that matches target with the color defined by fill.
Expand Down
3 changes: 1 addition & 2 deletions src/Magick.NET/Native/MagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
public partial void Normalize();

[Throws]
[SetInstance]
public partial void OilPaint(double radius, double sigma);
public partial IntPtr OilPaint(double radius, double sigma);

[Throws]
public partial void Opaque(IMagickColor<QuantumType>? target, IMagickColor<QuantumType>? fill, bool invert);
Expand Down

0 comments on commit 8323cef

Please sign in to comment.