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:
parent
0cd12f6f67
commit
56b33ca03d
3 changed files with 17 additions and 0 deletions
|
@ -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, "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, "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, "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) \
|
#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_HLS2BGR, CV_HLS2BGR, 3, 3);
|
||||||
CREATE_CVTCOLOR_FUNC(rb_HLS2RGB, CV_HLS2RGB, 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
|
int
|
||||||
error_callback(int status, const char *function_name, const char *error_message,
|
error_callback(int status, const char *function_name, const char *error_message,
|
||||||
const char *file_name, int line, void *user_data)
|
const char *file_name, int line, void *user_data)
|
||||||
|
|
|
@ -393,6 +393,8 @@ VALUE rb_Luv2RGB(VALUE klass, VALUE image);
|
||||||
VALUE rb_HLS2BGR(VALUE klass, VALUE image);
|
VALUE rb_HLS2BGR(VALUE klass, VALUE image);
|
||||||
VALUE rb_HLS2RGB(VALUE klass, VALUE image);
|
VALUE rb_HLS2RGB(VALUE klass, VALUE image);
|
||||||
|
|
||||||
|
VALUE rb_build_information(VALUE klass);
|
||||||
|
|
||||||
__NAMESPACE_END_OPENCV
|
__NAMESPACE_END_OPENCV
|
||||||
|
|
||||||
#endif // RUBY_OPENCV_H
|
#endif // RUBY_OPENCV_H
|
||||||
|
|
|
@ -329,6 +329,12 @@ class TestOpenCV < OpenCVTestCase
|
||||||
|
|
||||||
flunk('FIXME: Most cvtColor functions are not tested yet.')
|
flunk('FIXME: Most cvtColor functions are not tested yet.')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_build_information
|
||||||
|
s = build_information
|
||||||
|
assert_equal(String, s.class)
|
||||||
|
assert(s =~ /^\s+General configuration for OpenCV #{CV_VERSION}/)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue