Skip to content

Commit 340502d

Browse files
committed
Moved Charcoal to IMagickImageCreateOperations.
1 parent bbdf723 commit 340502d

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -369,20 +369,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
369369
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
370370
void BrightnessContrast(Percentage brightness, Percentage contrast, Channels channels);
371371

372-
/// <summary>
373-
/// Charcoal effect image (looks like charcoal sketch).
374-
/// </summary>
375-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
376-
void Charcoal();
377-
378-
/// <summary>
379-
/// Charcoal effect image (looks like charcoal sketch).
380-
/// </summary>
381-
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
382-
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
383-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
384-
void Charcoal(double radius, double sigma);
385-
386372
/// <summary>
387373
/// Chop image (remove vertical or horizontal subregion of image) using the specified geometry.
388374
/// </summary>

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,20 @@ public interface IMagickImageCreateOperations
291291
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
292292
void CannyEdge(double radius, double sigma, Percentage lower, Percentage upper);
293293

294+
/// <summary>
295+
/// Charcoal effect image (looks like charcoal sketch).
296+
/// </summary>
297+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
298+
void Charcoal();
299+
300+
/// <summary>
301+
/// Charcoal effect image (looks like charcoal sketch).
302+
/// </summary>
303+
/// <param name="radius">The radius of the Gaussian, in pixels, not counting the center pixel.</param>
304+
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
305+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
306+
void Charcoal(double radius, double sigma);
307+
294308
/// <summary>
295309
/// Resize image to specified size.
296310
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ public void CannyEdge()
147147
public void CannyEdge(double radius, double sigma, Percentage lower, Percentage upper)
148148
=> SetResult(NativeMagickImage.CannyEdge(radius, sigma, lower.ToDouble() / 100, upper.ToDouble() / 100));
149149

150+
public void Charcoal()
151+
=> Charcoal(0.0, 1.0);
152+
153+
public void Charcoal(double radius, double sigma)
154+
=> SetResult(NativeMagickImage.Charcoal(radius, sigma));
155+
150156
public void Resize(uint width, uint height)
151157
=> Resize(new MagickGeometry(width, height));
152158

src/Magick.NET/MagickImage.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,10 @@ public void CannyEdge(double radius, double sigma, Percentage lower, Percentage
14641464
/// </summary>
14651465
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
14661466
public void Charcoal()
1467-
=> Charcoal(0.0, 1.0);
1467+
{
1468+
using var mutator = new Mutator(_nativeInstance);
1469+
mutator.Charcoal();
1470+
}
14681471

14691472
/// <summary>
14701473
/// Charcoal effect image (looks like charcoal sketch).
@@ -1473,7 +1476,10 @@ public void Charcoal()
14731476
/// <param name="sigma">The standard deviation of the Laplacian, in pixels.</param>
14741477
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
14751478
public void Charcoal(double radius, double sigma)
1476-
=> _nativeInstance.Charcoal(radius, sigma);
1479+
{
1480+
using var mutator = new Mutator(_nativeInstance);
1481+
mutator.Charcoal(radius, sigma);
1482+
}
14771483

14781484
/// <summary>
14791485
/// Chop image (remove vertical or horizontal subregion of image) using the specified geometry.

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
286286
public partial nuint ChannelOffset(PixelChannel channel);
287287

288288
[Throws]
289-
[SetInstance]
290-
public partial void Charcoal(double radius, double sigma);
289+
public partial IntPtr Charcoal(double radius, double sigma);
291290

292291
[Throws]
293292
[SetInstance]

0 commit comments

Comments
 (0)