1
0
Fork 0
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:
ser1zw 2011-01-01 17:32:38 +09:00
parent 252814b057
commit 411f8ba9da

View file

@ -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