-
-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added InverseContrast to MagickImage.
- Loading branch information
Showing
5 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/Magick.NET.Tests/MagickImageTests/TheContrastMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using ImageMagick; | ||
using Xunit; | ||
|
||
namespace Magick.NET.Tests | ||
{ | ||
public partial class MagickImageTests | ||
{ | ||
public class TheContrastMethod | ||
{ | ||
[Fact] | ||
public void ShouldEnhanceTheImage() | ||
{ | ||
using (var first = new MagickImage(Files.Builtin.Wizard)) | ||
{ | ||
first.Contrast(); | ||
|
||
using (var second = new MagickImage(Files.Builtin.Wizard)) | ||
{ | ||
Assert.InRange(first.Compare(second, ErrorMetric.RootMeanSquared), 0.0174, 0.0175); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/Magick.NET.Tests/MagickImageTests/TheInverseContrastMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using ImageMagick; | ||
using Xunit; | ||
|
||
namespace Magick.NET.Tests | ||
{ | ||
public partial class MagickImageTests | ||
{ | ||
public class TheInverseContrastMethod | ||
{ | ||
[Fact] | ||
public void ShouldInvertContrast() | ||
{ | ||
using (var first = new MagickImage(Files.Builtin.Wizard)) | ||
{ | ||
first.Contrast(); | ||
first.InverseContrast(); | ||
|
||
using (var second = new MagickImage(Files.Builtin.Wizard)) | ||
{ | ||
Assert.InRange(first.Compare(second, ErrorMetric.RootMeanSquared), 0.0031, 0.0034); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |