mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
fixed VALUE_TO_CVSCALAR in cvscalar.h to allow double values
fixed the following problem [#27088] VALUE_TO_CVSCALAR wont allow float or double value http://rubyforge.org/tracker/index.php?func=detail&aid=27088&group_id=1066&atid=4198
This commit is contained in:
parent
252814b057
commit
411f8ba9da
1 changed files with 4 additions and 4 deletions
|
@ -52,10 +52,10 @@ VALUE_TO_CVSCALAR(VALUE object)
|
|||
{
|
||||
if(FIXNUM_P(object))
|
||||
return cvScalarAll(FIX2INT(object));
|
||||
return cvScalar(NUM2INT(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(0))),
|
||||
NUM2INT(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(1))),
|
||||
NUM2INT(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(2))),
|
||||
NUM2INT(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(3))));
|
||||
return cvScalar(NUM2DBL(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(0))),
|
||||
NUM2DBL(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(1))),
|
||||
NUM2DBL(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(2))),
|
||||
NUM2DBL(rb_funcall(object, rb_intern("[]"), 1, INT2FIX(3))));
|
||||
}
|
||||
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
|
Loading…
Reference in a new issue