woxtu / rust-opencv

Wrapper for OpenCV (WIP, not compilable now)
13 stars 5 forks source link

Ignore the return value of cvNamedWindow #5

Closed yati-sagade closed 9 years ago

yati-sagade commented 9 years ago

I got a panic from highgui::Window::named() because the value returned from cvNamedWindow() was 1. The documentation for namedWindow does not say anything about the return value and the current (C++) API of the library implements cv::namedWindow() like so:

// <opencv-src>/modules/highgui/src/window.cpp
void cv::namedWindow( const string& winname, int flags )
{
    cvNamedWindow( winname.c_str(), flags );
}

Wherein it just ignores the value returned by the lower level cvNamedWindow(). I think we should also do the same here. I've attached a patch, but I'm new to Rust and this project, so please let me know if I missed something. Thanks for the project!

[EDIT] I'm on Linux 64 bit with GTK backend for OpenCV 2.4.3+, if that helps.

woxtu commented 9 years ago

You're right. Thank you for your PR.