diff --git a/src/Magick.NET.Core/IMagickImage.cs b/src/Magick.NET.Core/IMagickImage.cs index e421aa14c3..5f3dc7435a 100644 --- a/src/Magick.NET.Core/IMagickImage.cs +++ b/src/Magick.NET.Core/IMagickImage.cs @@ -972,18 +972,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl /// Thrown when an error is raised by ImageMagick. void Evaluate(Channels channels, IMagickGeometry geometry, EvaluateOperator evaluateOperator, Percentage percentage); - /// - /// Flip image (reflect each scanline in the vertical direction). - /// - /// Thrown when an error is raised by ImageMagick. - void Flip(); - - /// - /// Flop image (reflect each scanline in the horizontal direction). - /// - /// Thrown when an error is raised by ImageMagick. - void Flop(); - /// /// Obtain font metrics for text string given current font, pointsize, and density settings. /// diff --git a/src/Magick.NET.Core/IMagickImageCreateOperations.cs b/src/Magick.NET.Core/IMagickImageCreateOperations.cs index e1b3cf701b..431083fa6f 100644 --- a/src/Magick.NET.Core/IMagickImageCreateOperations.cs +++ b/src/Magick.NET.Core/IMagickImageCreateOperations.cs @@ -494,6 +494,18 @@ public interface IMagickImageCreateOperations /// Thrown when an error is raised by ImageMagick. void Extent(IMagickGeometry geometry, Gravity gravity); + /// + /// Flip image (reflect each scanline in the vertical direction). + /// + /// Thrown when an error is raised by ImageMagick. + void Flip(); + + /// + /// Flop image (reflect each scanline in the horizontal direction). + /// + /// Thrown when an error is raised by ImageMagick. + void Flop(); + /// /// Resize image to specified size. /// diff --git a/src/Magick.NET/MagickImage.CloneMutator.cs b/src/Magick.NET/MagickImage.CloneMutator.cs index 1432ee09c4..9eda28f606 100644 --- a/src/Magick.NET/MagickImage.CloneMutator.cs +++ b/src/Magick.NET/MagickImage.CloneMutator.cs @@ -299,6 +299,12 @@ public void Extent(IMagickGeometry geometry, Gravity gravity, IMagickColor SetResult(NativeMagickImage.Flip()); + + public void Flop() + => SetResult(NativeMagickImage.Flop()); + public void Resize(uint width, uint height) => Resize(new MagickGeometry(width, height)); diff --git a/src/Magick.NET/MagickImage.cs b/src/Magick.NET/MagickImage.cs index 3fc1b31de4..2a8696b45e 100644 --- a/src/Magick.NET/MagickImage.cs +++ b/src/Magick.NET/MagickImage.cs @@ -2887,7 +2887,10 @@ public void Extent(IMagickGeometry geometry, Gravity gravity, IMagickColor /// Thrown when an error is raised by ImageMagick. public void Flip() - => _nativeInstance.Flip(); + { + using var mutator = new Mutator(_nativeInstance); + mutator.Flip(); + } /// /// Floodfill pixels matching color (within fuzz factor) of target pixel(x,y) with replacement @@ -2951,7 +2954,10 @@ public void FloodFill(IMagickImage image, int x, int y, IMagickColo /// /// Thrown when an error is raised by ImageMagick. public void Flop() - => _nativeInstance.Flop(); + { + using var mutator = new Mutator(_nativeInstance); + mutator.Flop(); + } /// /// Obtain font metrics for text string given current font, pointsize, and density settings. diff --git a/src/Magick.NET/Native/MagickImage.cs b/src/Magick.NET/Native/MagickImage.cs index bb87d4aac7..417e62dcbc 100644 --- a/src/Magick.NET/Native/MagickImage.cs +++ b/src/Magick.NET/Native/MagickImage.cs @@ -410,15 +410,13 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM public partial IntPtr Extent(string geometry, Gravity gravity); [Throws] - [SetInstance] - public partial void Flip(); + public partial IntPtr Flip(); [Throws] public partial void FloodFill(DrawingSettings settings, nint x, nint y, IMagickColor? target, bool invert); [Throws] - [SetInstance] - public partial void Flop(); + public partial IntPtr Flop(); [Throws] [Cleanup(Name = "TypeMetric.Dispose")]