mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
refactored some functions to get options
This commit is contained in:
parent
1d1244de0c
commit
cd3cd06829
10 changed files with 98 additions and 63 deletions
|
@ -170,3 +170,13 @@ rb_cvCreateMemStorage(int block_size)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_get_option_table(VALUE klass, const char* table_name, VALUE option)
|
||||
{
|
||||
VALUE table = rb_const_get(klass, rb_intern(table_name));
|
||||
if (NIL_P(option))
|
||||
return table;
|
||||
else
|
||||
return rb_funcall(table, rb_intern("merge"), 1, option);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue