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