fix: black and white point should be set relative to quantum range
This commit is contained in:
@ -257,8 +257,14 @@ impl MagickWand {
|
|||||||
gamma: f64,
|
gamma: f64,
|
||||||
white_point: f64,
|
white_point: f64,
|
||||||
) -> Result<(), &'static str> {
|
) -> Result<(), &'static str> {
|
||||||
let result =
|
let result = unsafe {
|
||||||
unsafe { bindings::MagickLevelImage(self.wand, black_point, gamma, white_point) };
|
bindings::MagickLevelImage(
|
||||||
|
self.wand,
|
||||||
|
black_point * bindings::QuantumRange,
|
||||||
|
gamma,
|
||||||
|
white_point * bindings::QuantumRange,
|
||||||
|
)
|
||||||
|
};
|
||||||
match result {
|
match result {
|
||||||
bindings::MagickBooleanType_MagickTrue => Ok(()),
|
bindings::MagickBooleanType_MagickTrue => Ok(()),
|
||||||
_ => Err("failed to set size of wand"),
|
_ => Err("failed to set size of wand"),
|
||||||
|
|||||||
Reference in New Issue
Block a user