mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
added error handling to some methods (2)
Added error handlings to the methods of following classes or modules -CvPoint2D32f -CvPoint3D32f -CvRect -CvScalar -CvSeq -CvSize -CvSize2D32f -CvSlice -CvSURFParams -CvSURFPoint -CvTermCriteria -CvTwoPoints -CvUtils -CvVideoWriter -GUI -IplConvKernel -IplImage -MouseEvent -OpenCV -Trackbar -Window
This commit is contained in:
parent
ea55e0d42e
commit
b3016fc68c
31 changed files with 407 additions and 245 deletions
|
@ -54,7 +54,13 @@ rb_wait_key(int argc, VALUE *argv, VALUE self)
|
|||
VALUE delay;
|
||||
rb_scan_args(argc, argv, "01", &delay);
|
||||
int keycode = 0;
|
||||
return ((keycode = cvWaitKey(IF_INT(delay, 0))) < 0) ? Qnil : INT2FIX(keycode);
|
||||
try {
|
||||
keycode = cvWaitKey(IF_INT(delay, 0));
|
||||
}
|
||||
catch (cv::Exception& e) {
|
||||
raise_cverror(e);
|
||||
}
|
||||
return (keycode < 0) ? Qnil : INT2NUM(keycode);
|
||||
}
|
||||
|
||||
__NAMESPACE_END_GUI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue