Skip to content

Commit 68b09fd

Browse files
committed
Moved Frame back to IMagickImage.
1 parent e9f136c commit 68b09fd

File tree

5 files changed

+60
-37
lines changed

5 files changed

+60
-37
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -997,37 +997,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
997997
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
998998
string? FormatExpression(string expression);
999999

1000-
/// <summary>
1001-
/// Frame image with the default geometry (25x25+6+6).
1002-
/// </summary>
1003-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1004-
void Frame();
1005-
1006-
/// <summary>
1007-
/// Frame image with the specified geometry.
1008-
/// </summary>
1009-
/// <param name="geometry">The geometry of the frame.</param>
1010-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1011-
void Frame(IMagickGeometry geometry);
1012-
1013-
/// <summary>
1014-
/// Frame image with the specified with and height.
1015-
/// </summary>
1016-
/// <param name="width">The width of the frame.</param>
1017-
/// <param name="height">The height of the frame.</param>
1018-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1019-
void Frame(uint width, uint height);
1020-
1021-
/// <summary>
1022-
/// Frame image with the specified with, height, innerBevel and outerBevel.
1023-
/// </summary>
1024-
/// <param name="width">The width of the frame.</param>
1025-
/// <param name="height">The height of the frame.</param>
1026-
/// <param name="innerBevel">The inner bevel of the frame.</param>
1027-
/// <param name="outerBevel">The outer bevel of the frame.</param>
1028-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1029-
void Frame(uint width, uint height, int innerBevel, int outerBevel);
1030-
10311000
/// <summary>
10321001
/// Applies a mathematical expression to the image.
10331002
/// </summary>

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,37 @@ public interface IMagickImageCreateOperations
506506
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
507507
void Flop();
508508

509+
/// <summary>
510+
/// Frame image with the default geometry (25x25+6+6).
511+
/// </summary>
512+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
513+
void Frame();
514+
515+
/// <summary>
516+
/// Frame image with the specified geometry.
517+
/// </summary>
518+
/// <param name="geometry">The geometry of the frame.</param>
519+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
520+
void Frame(IMagickGeometry geometry);
521+
522+
/// <summary>
523+
/// Frame image with the specified with and height.
524+
/// </summary>
525+
/// <param name="width">The width of the frame.</param>
526+
/// <param name="height">The height of the frame.</param>
527+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
528+
void Frame(uint width, uint height);
529+
530+
/// <summary>
531+
/// Frame image with the specified with, height, innerBevel and outerBevel.
532+
/// </summary>
533+
/// <param name="width">The width of the frame.</param>
534+
/// <param name="height">The height of the frame.</param>
535+
/// <param name="innerBevel">The inner bevel of the frame.</param>
536+
/// <param name="outerBevel">The outer bevel of the frame.</param>
537+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
538+
void Frame(uint width, uint height, int innerBevel, int outerBevel);
539+
509540
/// <summary>
510541
/// Resize image to specified size.
511542
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,18 @@ public void Flip()
305305
public void Flop()
306306
=> SetResult(NativeMagickImage.Flop());
307307

308+
public void Frame()
309+
=> Frame(new MagickGeometry(6, 6, 25, 25));
310+
311+
public void Frame(IMagickGeometry geometry)
312+
=> SetResult(NativeMagickImage.Frame(MagickRectangle.FromGeometry(geometry, (uint)NativeMagickImage.Width_Get(), (uint)NativeMagickImage.Height_Get())));
313+
314+
public void Frame(uint width, uint height)
315+
=> Frame(new MagickGeometry(6, 6, width, height));
316+
317+
public void Frame(uint width, uint height, int innerBevel, int outerBevel)
318+
=> Frame(new MagickGeometry(innerBevel, outerBevel, width, height));
319+
308320
public void Resize(uint width, uint height)
309321
=> Resize(new MagickGeometry(width, height));
310322

src/Magick.NET/MagickImage.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,15 +3005,21 @@ public void Flop()
30053005
/// </summary>
30063006
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
30073007
public void Frame()
3008-
=> Frame(new MagickGeometry(6, 6, 25, 25));
3008+
{
3009+
using var mutator = new Mutator(_nativeInstance);
3010+
mutator.Frame();
3011+
}
30093012

30103013
/// <summary>
30113014
/// Frame image with the specified geometry.
30123015
/// </summary>
30133016
/// <param name="geometry">The geometry of the frame.</param>
30143017
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
30153018
public void Frame(IMagickGeometry geometry)
3016-
=> _nativeInstance.Frame(MagickRectangle.FromGeometry(geometry, this));
3019+
{
3020+
using var mutator = new Mutator(_nativeInstance);
3021+
mutator.Frame(geometry);
3022+
}
30173023

30183024
/// <summary>
30193025
/// Frame image with the specified with and height.
@@ -3022,7 +3028,10 @@ public void Frame(IMagickGeometry geometry)
30223028
/// <param name="height">The height of the frame.</param>
30233029
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
30243030
public void Frame(uint width, uint height)
3025-
=> Frame(new MagickGeometry(6, 6, width, height));
3031+
{
3032+
using var mutator = new Mutator(_nativeInstance);
3033+
mutator.Frame(width, height);
3034+
}
30263035

30273036
/// <summary>
30283037
/// Frame image with the specified with, height, innerBevel and outerBevel.
@@ -3033,7 +3042,10 @@ public void Frame(uint width, uint height)
30333042
/// <param name="outerBevel">The outer bevel of the frame.</param>
30343043
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
30353044
public void Frame(uint width, uint height, int innerBevel, int outerBevel)
3036-
=> Frame(new MagickGeometry(innerBevel, outerBevel, width, height));
3045+
{
3046+
using var mutator = new Mutator(_nativeInstance);
3047+
mutator.Frame(width, height, innerBevel, outerBevel);
3048+
}
30373049

30383050
/// <summary>
30393051
/// Applies a mathematical expression to the image.

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
426426
public partial string? FormatExpression(IMagickSettings<QuantumType>? settings, string expression);
427427

428428
[Throws]
429-
[SetInstance]
430-
public partial void Frame(MagickRectangle geometry);
429+
public partial IntPtr Frame(MagickRectangle geometry);
431430

432431
[Throws]
433432
public partial IntPtr Fx(string expression, Channels channels);

0 commit comments

Comments
 (0)