Skip to content

Commit

Permalink
Moved HoughLine to IMagickImageCreateOperations.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Nov 22, 2024
1 parent b3f2293 commit d4bb696
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
15 changes: 0 additions & 15 deletions src/Magick.NET.Core/IMagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,21 +1135,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
/// <returns>A value indicating whether a profile with the specified name already exists on the image.</returns>
bool HasProfile(string name);

/// <summary>
/// Identifies lines in the image.
/// </summary>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void HoughLine();

/// <summary>
/// Identifies lines in the image.
/// </summary>
/// <param name="width">The width of the neighborhood.</param>
/// <param name="height">The height of the neighborhood.</param>
/// <param name="threshold">The line count threshold.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void HoughLine(uint width, uint height, uint threshold);

/// <summary>
/// Implode image (special effect).
/// </summary>
Expand Down
15 changes: 15 additions & 0 deletions src/Magick.NET.Core/IMagickImageCreateOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,21 @@ public interface IMagickImageCreateOperations
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void GaussianBlur(double radius, double sigma, Channels channels);

/// <summary>
/// Identifies lines in the image.
/// </summary>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void HoughLine();

/// <summary>
/// Identifies lines in the image.
/// </summary>
/// <param name="width">The width of the neighborhood.</param>
/// <param name="height">The height of the neighborhood.</param>
/// <param name="threshold">The line count threshold.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void HoughLine(uint width, uint height, uint threshold);

/// <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 @@ -329,6 +329,12 @@ public void GaussianBlur(double radius, double sigma)
public void GaussianBlur(double radius, double sigma, Channels channels)
=> SetResult(NativeMagickImage.GaussianBlur(radius, sigma, channels));

public void HoughLine()
=> HoughLine(0, 0, 40);

public void HoughLine(uint width, uint height, uint threshold)
=> SetResult(NativeMagickImage.HoughLine(width, height, threshold));

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 @@ -3387,7 +3387,10 @@ public IReadOnlyDictionary<IMagickColor<QuantumType>, uint> Histogram()
/// </summary>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void HoughLine()
=> HoughLine(0, 0, 40);
{
using var mutator = new Mutator(_nativeInstance);
mutator.HoughLine();
}

/// <summary>
/// Identifies lines in the image.
Expand All @@ -3397,7 +3400,10 @@ public void HoughLine()
/// <param name="threshold">The line count threshold.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void HoughLine(uint width, uint height, uint threshold)
=> _nativeInstance.HoughLine(width, height, threshold);
{
using var mutator = new Mutator(_nativeInstance);
mutator.HoughLine(width, height, threshold);
}

/// <summary>
/// Implode image (special effect).
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 @@ -475,8 +475,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
public partial IntPtr Histogram(out nuint length);

[Throws]
[SetInstance]
public partial void HoughLine(nuint width, nuint height, nuint threshold);
public partial IntPtr HoughLine(nuint width, nuint height, nuint threshold);

[Throws]
[SetInstance]
Expand Down

0 comments on commit d4bb696

Please sign in to comment.