Skip to content

Commit

Permalink
Moved Convolve to IMagickImageCreateOperations.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Nov 13, 2024
1 parent 31dff67 commit 1ac655b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
7 changes: 0 additions & 7 deletions src/Magick.NET.Core/IMagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -798,13 +798,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
IEnumerable<PointD> ConvexHull();

/// <summary>
/// Convolve image. Applies a user-specified convolution to the image.
/// </summary>
/// <param name="matrix">The convolution matrix.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void Convolve(IConvolveMatrix matrix);

/// <summary>
/// Copies pixels from the source image to the destination image.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions src/Magick.NET.Core/IMagickImageCreateOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ public interface IMagickImageCreateOperations
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void ColorMatrix(IMagickColorMatrix matrix);

/// <summary>
/// Convolve image. Applies a user-specified convolution to the image.
/// </summary>
/// <param name="matrix">The convolution matrix.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void Convolve(IConvolveMatrix matrix);

/// <summary>
/// Resize image to specified size.
/// <para />
Expand Down
7 changes: 7 additions & 0 deletions src/Magick.NET/MagickImage.CloneMutator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ public void ColorMatrix(IMagickColorMatrix matrix)
SetResult(NativeMagickImage.ColorMatrix(matrix));
}

public void Convolve(IConvolveMatrix matrix)
{
Throw.IfNull(nameof(matrix), matrix);

SetResult(NativeMagickImage.Convolve(matrix));
}

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

Expand Down
5 changes: 2 additions & 3 deletions src/Magick.NET/MagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2341,9 +2341,8 @@ public IEnumerable<PointD> ConvexHull()
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void Convolve(IConvolveMatrix matrix)
{
Throw.IfNull(nameof(matrix), matrix);

_nativeInstance.Convolve(matrix);
using var mutator = new Mutator(_nativeInstance);
mutator.Convolve(matrix);
}

/// <summary>
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 @@ -347,8 +347,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
public partial IntPtr ConvexHull(out nuint length);

[Throws]
[SetInstance]
public partial void Convolve(IDoubleMatrix matrix);
public partial IntPtr Convolve(IDoubleMatrix matrix);

[Throws]
public partial void CopyPixels(IMagickImage image, MagickRectangle geometry, OffsetInfo offset, Channels channels);
Expand Down

0 comments on commit 1ac655b

Please sign in to comment.