add some create window options

This commit is contained in:
ser1zw 2014-01-18 20:53:59 +09:00
parent 3a08bc621e
commit efc919fe4c
3 changed files with 8 additions and 1 deletions

View File

@ -320,6 +320,8 @@ init_ruby_module()
/* Flags of window */
rb_define_const(rb_module, "CV_WINDOW_AUTOSIZE", INT2FIX(CV_WINDOW_AUTOSIZE));
rb_define_const(rb_module, "CV_WINDOW_NORMAL", INT2FIX(CV_WINDOW_NORMAL));
rb_define_const(rb_module, "CV_WINDOW_OPENGL", INT2FIX(CV_WINDOW_OPENGL));
/* Object detection mode */
rb_define_const(rb_module, "CV_HAAR_DO_CANNY_PRUNING", INT2FIX(CV_HAAR_DO_CANNY_PRUNING));

View File

@ -61,8 +61,11 @@ window_free(void *ptr)
* @overload new(name, flags = CV_WINDOW_AUTOSIZE)
* @param name [String] Name of the window in the window caption that may be used as a window identifier.
* @param flags [Integer] Flags of the window. The supported flags are:
* * CVWINDOW_AUTOSIZE - If this is set, the window size is automatically adjusted
* * CV_WINDOW_AUTOSIZE - If this is set, the window size is automatically adjusted
* to fit the displayed image, and you cannot change the window size manually.
* * CV_WINDOW_NORMAL - If this is set, the user can resize the window (no constraint).
* * CV_WINDOW_OPENGL - If this is set, the window will be created with OpenGL support.
* @opencv_func cvNamedWindow
*/
VALUE
rb_initialize(int argc, VALUE *argv, VALUE self)

View File

@ -149,7 +149,9 @@ class TestOpenCV < OpenCVTestCase
assert_equal(4, CV_FM_LMEDS)
# Flags of window
assert_equal(0, CV_WINDOW_NORMAL)
assert_equal(1, CV_WINDOW_AUTOSIZE)
assert_equal(4096, CV_WINDOW_OPENGL)
# Object detection mode
assert_equal(1, CV_HAAR_DO_CANNY_PRUNING)