Skip to content

Commit

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

/// <summary>
/// Converts pixels to cipher-pixels.
/// </summary>
/// <param name="passphrase">The password that to encrypt the image with.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void Encipher(string passphrase);

/// <summary>
/// Applies a histogram equalization to the image.
/// </summary>
Expand Down
7 changes: 0 additions & 7 deletions src/Magick.NET.Core/IMagickImageCreateOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,6 @@ public interface IMagickImageCreateOperations
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void Emboss(double radius, double sigma);

/// <summary>
/// Converts pixels to cipher-pixels.
/// </summary>
/// <param name="passphrase">The password that to encrypt the image with.</param>
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
void Encipher(string passphrase);

/// <summary>
/// Applies a digital filter that improves the quality of a noisy image.
/// </summary>
Expand Down
7 changes: 0 additions & 7 deletions src/Magick.NET/MagickImage.CloneMutator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ public void Emboss()
public void Emboss(double radius, double sigma)
=> SetResult(NativeMagickImage.Emboss(radius, sigma));

public void Encipher(string passphrase)
{
Throw.IfNullOrEmpty(nameof(passphrase), passphrase);

SetResult(NativeMagickImage.Encipher(passphrase));
}

public void Enhance()
=> SetResult(NativeMagickImage.Enhance());

Expand Down
5 changes: 3 additions & 2 deletions src/Magick.NET/MagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2682,8 +2682,9 @@ public void Emboss(double radius, double sigma)
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
public void Encipher(string passphrase)
{
using var mutator = new Mutator(_nativeInstance);
mutator.Encipher(passphrase);
Throw.IfNullOrEmpty(nameof(passphrase), passphrase);

_nativeInstance.Encipher(passphrase);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Magick.NET/Native/MagickImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
public partial IntPtr Emboss(double radius, double sigma);

[Throws]
public partial IntPtr Encipher(string passphrase);
public partial void Encipher(string passphrase);

[Throws]
public partial IntPtr Enhance();
Expand Down

0 comments on commit fac3908

Please sign in to comment.