Merge pull request #100 from jshrake/add-auto-gamma-auto-level
Add MagickAutoGammaImage and MagickAutoLevelImage
This commit is contained in:
@ -1016,6 +1016,12 @@ impl MagickWand {
|
|||||||
|
|
||||||
/// Applies k-means color reduction to the image.
|
/// Applies k-means color reduction to the image.
|
||||||
MagickKmeansImage => kmeans(number_colors: size_t, max_iterations: size_t, tolerance: f64)
|
MagickKmeansImage => kmeans(number_colors: size_t, max_iterations: size_t, tolerance: f64)
|
||||||
|
|
||||||
|
/// Extracts the 'mean' from the image and adjust the image to try make set its gamma appropriately.
|
||||||
|
MagickAutoGammaImage => auto_gamma()
|
||||||
|
|
||||||
|
/// Adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.
|
||||||
|
MagickAutoLevelImage => auto_level()
|
||||||
);
|
);
|
||||||
|
|
||||||
get!(get_image_colors, MagickGetImageColors, size_t);
|
get!(get_image_colors, MagickGetImageColors, size_t);
|
||||||
|
|||||||
19
tests/lib.rs
19
tests/lib.rs
@ -398,6 +398,25 @@ fn test_resource_limits() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
fn test_auto_level() {
|
||||||
|
START.call_once(|| {
|
||||||
|
magick_wand_genesis();
|
||||||
|
});
|
||||||
|
let wand = MagickWand::new();
|
||||||
|
assert!(wand.read_image("tests/data/IMG_5745.JPG").is_ok());
|
||||||
|
assert!(wand.auto_level().is_ok());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_auto_gamma() {
|
||||||
|
START.call_once(|| {
|
||||||
|
magick_wand_genesis();
|
||||||
|
});
|
||||||
|
let wand = MagickWand::new();
|
||||||
|
assert!(wand.read_image("tests/data/IMG_5745.JPG").is_ok());
|
||||||
|
assert!(wand.auto_gamma().is_ok());
|
||||||
|
}
|
||||||
|
|
||||||
fn test_import_export_pixels_roundtrip() {
|
fn test_import_export_pixels_roundtrip() {
|
||||||
START.call_once(|| {
|
START.call_once(|| {
|
||||||
magick_wand_genesis();
|
magick_wand_genesis();
|
||||||
|
|||||||
Reference in New Issue
Block a user