opencv-rust icon indicating copy to clipboard operation
opencv-rust copied to clipboard

use bitmasks instead of pure enums where appropriate

Open rursprung opened this issue 9 months ago • 1 comments

i just ran into this with: MouseEventFlags: in most cases the flags parameter will be set to 0 in the callback triggered by highgui::set_mouse_callback. but 0 is not a valid value according to the enum, thus try_from will return an Err.

using something like bitmask-enum (i've never personally used this crate directly) might resolve this, as it'd also correctly allow setting multiple flags at the same time.

rursprung avatar May 18 '25 21:05 rursprung

Thank you for the suggestion, I'll investigate!

twistedfall avatar May 27 '25 07:05 twistedfall

This should now be implemented in v0.96.0

twistedfall avatar Sep 24 '25 20:09 twistedfall