bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.44k stars 1.57k forks source link

Operator Overloading #706

Open csolorio opened 7 years ago

csolorio commented 7 years ago

Hi everyone.

I was checking the official docs of the java bindings in OpenCV and saw that there were some objects with overloaded operators. For instance, & or | in Rect types for intersection or union operations. I tried such thing in JavaCV but it seems such operations haven't been implemented as an operator overload. Is there a way to perform an intersection between 2 Rect objects?

Best regards.

saudet commented 7 years ago

I see those are template functions. We would need to add some Info for those, something similar to what is already done for cv::randu here: https://github.com/bytedeco/javacpp-presets/blob/master/opencv/src/main/java/org/bytedeco/javacpp/presets/opencv_core.java#L164