mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
fix some codes for YARD 0.8
This commit is contained in:
parent
c9c7975cf0
commit
9f890573db
17 changed files with 276 additions and 266 deletions
|
@ -24,23 +24,6 @@ rb_class()
|
|||
return rb_klass;
|
||||
}
|
||||
|
||||
void
|
||||
define_ruby_class()
|
||||
{
|
||||
if (rb_klass)
|
||||
return;
|
||||
/*
|
||||
* opencv = rb_define_module("OpenCV");
|
||||
* cvrect = rb_define_class_under(opencv, "CvRect", rb_cObject);
|
||||
*
|
||||
* note: this comment is used by rdoc.
|
||||
*/
|
||||
VALUE opencv = rb_module_opencv(), cvrect = cCvRect::rb_class();
|
||||
rb_klass = rb_define_class_under(opencv, "CvAvgComp", cvrect);
|
||||
rb_define_alloc_func(rb_klass, rb_allocate);
|
||||
rb_define_method(rb_klass, "neighbors", RUBY_METHOD_FUNC(rb_neighbors), 0);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_allocate(VALUE klass)
|
||||
{
|
||||
|
@ -59,5 +42,23 @@ rb_neighbors(VALUE self)
|
|||
return INT2NUM(CVAVGCOMP(self)->neighbors);
|
||||
}
|
||||
|
||||
void
|
||||
init_ruby_class()
|
||||
{
|
||||
#if 0
|
||||
// For documentation using YARD
|
||||
VALUE opencv = rb_define_module("OpenCV");
|
||||
VALUE cvrect = rb_define_class_under(opencv, "CvRect", rb_cObject);
|
||||
#endif
|
||||
|
||||
if (rb_klass)
|
||||
return;
|
||||
|
||||
VALUE opencv = rb_module_opencv(), cvrect = cCvRect::rb_class();
|
||||
rb_klass = rb_define_class_under(opencv, "CvAvgComp", cvrect);
|
||||
rb_define_alloc_func(rb_klass, rb_allocate);
|
||||
rb_define_method(rb_klass, "neighbors", RUBY_METHOD_FUNC(rb_neighbors), 0);
|
||||
}
|
||||
|
||||
__NAMESPACE_END_AVGCOMP
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue