mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
modified comments and styles
This commit is contained in:
parent
fa1fb03417
commit
ff3351ea64
3 changed files with 12 additions and 11 deletions
|
@ -3193,7 +3193,7 @@ rb_good_features_to_track(int argc, VALUE *argv, VALUE self)
|
|||
rb_raise(rb_eArgError, "option :max should be positive value.");
|
||||
CvPoint2D32f *p32 = (CvPoint2D32f*)cvAlloc(sizeof(CvPoint2D32f) * np);
|
||||
if(!p32)
|
||||
rb_raise(rb_eNoMemError, "failed allocate memory.");
|
||||
rb_raise(rb_eNoMemError, "failed to allocate memory.");
|
||||
cvGoodFeaturesToTrack(src, &eigen, &tmp, p32, &np, NUM2DBL(quality_level), NUM2DBL(min_distance),
|
||||
GF_MASK(good_features_to_track_option),
|
||||
GF_BLOCK_SIZE(good_features_to_track_option),
|
||||
|
@ -4152,7 +4152,7 @@ rb_flood_fill_bang(int argc, VALUE *argv, VALUE self)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* find_contours([find_contours_options]) -> cvchain or chcontour or nil
|
||||
* find_contours([find_contours_options]) -> cvchain or cvcontour or nil
|
||||
*
|
||||
* Finds contours in binary image, and return contours as CvContour or CvChain.
|
||||
* If contours not found, return nil.
|
||||
|
|
|
@ -110,10 +110,11 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
|
|||
break;
|
||||
case 1:
|
||||
obj = argv[0];
|
||||
if(rb_compatible_q(rb_klass, obj)) {
|
||||
if (rb_compatible_q(rb_klass, obj)) {
|
||||
CVPOINT2D32F(self)->x = NUM2DBL(rb_funcall(rb_funcall(obj, rb_intern("x"), 0), rb_intern("to_f"), 0));
|
||||
CVPOINT2D32F(self)->y = NUM2DBL(rb_funcall(rb_funcall(obj, rb_intern("y"), 0), rb_intern("to_f"), 0));
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
rb_raise(rb_eArgError, "object is not compatible %s.", rb_class2name(rb_klass));
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -58,7 +58,7 @@ void
|
|||
mark_root_object(void *ptr)
|
||||
{
|
||||
VALUE value;
|
||||
if(ptr && st_lookup(root_table, (st_data_t)ptr, (st_data_t*)&value)){
|
||||
if (ptr && st_lookup(root_table, (st_data_t)ptr, (st_data_t*)&value)) {
|
||||
rb_gc_mark(value);
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ VALUE
|
|||
lookup_root_object(void *ptr)
|
||||
{
|
||||
VALUE value = 0;
|
||||
if(ptr)
|
||||
if (ptr)
|
||||
st_lookup(root_table, (st_data_t)ptr, (st_data_t*)&value);
|
||||
return value;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ unresist_object(void *ptr)
|
|||
void
|
||||
free_object(void *ptr)
|
||||
{
|
||||
if(ptr){
|
||||
if (ptr) {
|
||||
unresist_object(ptr);
|
||||
cvFree(&ptr);
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ free_object(void *ptr)
|
|||
void
|
||||
release_object(void *ptr)
|
||||
{
|
||||
if(ptr){
|
||||
if (ptr) {
|
||||
unresist_object(ptr);
|
||||
cvRelease(&ptr);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ release_object(void *ptr)
|
|||
void
|
||||
release_iplconvkernel_object(void *ptr)
|
||||
{
|
||||
if(ptr){
|
||||
if (ptr) {
|
||||
unresist_object(ptr);
|
||||
cvReleaseStructuringElement((IplConvKernel**)(&ptr));
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ error_callback(int status,
|
|||
void *user_data)
|
||||
{
|
||||
int error_code = (CvStatus)cvGetErrStatus();
|
||||
if(error_code){
|
||||
if (error_code) {
|
||||
OPENCV_RSTERR(); // = CV_StsOk
|
||||
rb_warn("OpenCV error code (%d) : %s (%d in %s)", error_code, function_name, line, file_name);
|
||||
rb_raise(mCvError::by_code(error_code), "%s", error_message);
|
||||
|
@ -161,7 +161,7 @@ error_callback(int status,
|
|||
void
|
||||
define_ruby_module()
|
||||
{
|
||||
if(rb_module)
|
||||
if (rb_module)
|
||||
return;
|
||||
rb_module = rb_define_module("OpenCV");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue