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
|
@ -7,7 +7,7 @@
|
|||
Copyright (C) 2005-2006 Masakazu Yonekura
|
||||
|
||||
************************************************************/
|
||||
#include"iplconvkernel.h"
|
||||
#include "iplconvkernel.h"
|
||||
/*
|
||||
* Document-class: OpenCV::IplConvKernel
|
||||
*
|
||||
|
@ -101,11 +101,16 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
|
|||
num_values = RARRAY_LEN(values);
|
||||
_values = ALLOCA_N(int, num_values);
|
||||
VALUE *values_ptr = RARRAY_PTR(values);
|
||||
for (int i = 0; i < num_values; i++)
|
||||
for (int i = 0; i < num_values; ++i)
|
||||
_values[i] = NUM2INT(values_ptr[i]);
|
||||
}
|
||||
DATA_PTR(self) = rb_cvCreateStructuringElementEx(_cols, _rows, NUM2INT(anchor_x), NUM2INT(anchor_y),
|
||||
shape_type, _values);
|
||||
try {
|
||||
DATA_PTR(self) = rb_cvCreateStructuringElementEx(_cols, _rows, NUM2INT(anchor_x), NUM2INT(anchor_y),
|
||||
shape_type, _values);
|
||||
}
|
||||
catch (cv::Exception& e) {
|
||||
raise_cverror(e);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue