1
0
Fork 0
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:
ser1zw 2011-10-31 03:28:06 +09:00
parent 1d1244de0c
commit cd3cd06829
10 changed files with 98 additions and 63 deletions

View file

@ -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);
}