1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

add OpenCV::build_information (wrapper of cv::getBuildInformation())

This commit is contained in:
ser1zw 2012-05-23 02:09:02 +09:00
parent 0cd12f6f67
commit 56b33ca03d
3 changed files with 17 additions and 0 deletions

View file

@ -527,6 +527,8 @@ define_ruby_module()
rb_define_module_function(rb_module, "Luv2RGB", RUBY_METHOD_FUNC(rb_Luv2RGB), 1);
rb_define_module_function(rb_module, "HLS2BGR", RUBY_METHOD_FUNC(rb_HLS2BGR), 1);
rb_define_module_function(rb_module, "HLS2RGB", RUBY_METHOD_FUNC(rb_HLS2RGB), 1);
rb_define_module_function(rb_module, "build_information", RUBY_METHOD_FUNC(rb_build_information), 0);
}
#define CREATE_CVTCOLOR_FUNC(rb_func_name, c_const_name, src_cn, dest_cn) \
@ -620,6 +622,13 @@ CREATE_CVTCOLOR_FUNC(rb_Luv2RGB, CV_Luv2RGB, 3, 3);
CREATE_CVTCOLOR_FUNC(rb_HLS2BGR, CV_HLS2BGR, 3, 3);
CREATE_CVTCOLOR_FUNC(rb_HLS2RGB, CV_HLS2RGB, 3, 3);
VALUE
rb_build_information(VALUE klass)
{
return rb_str_new_cstr(cv::getBuildInformation().c_str());
}
int
error_callback(int status, const char *function_name, const char *error_message,
const char *file_name, int line, void *user_data)

View file

@ -393,6 +393,8 @@ VALUE rb_Luv2RGB(VALUE klass, VALUE image);
VALUE rb_HLS2BGR(VALUE klass, VALUE image);
VALUE rb_HLS2RGB(VALUE klass, VALUE image);
VALUE rb_build_information(VALUE klass);
__NAMESPACE_END_OPENCV
#endif // RUBY_OPENCV_H

View file

@ -329,6 +329,12 @@ class TestOpenCV < OpenCVTestCase
flunk('FIXME: Most cvtColor functions are not tested yet.')
end
def test_build_information
s = build_information
assert_equal(String, s.class)
assert(s =~ /^\s+General configuration for OpenCV #{CV_VERSION}/)
end
end