mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
fix for YARD 0.8 (experimental)
This commit is contained in:
parent
7d9901d057
commit
f9e6939fa1
4 changed files with 23 additions and 23 deletions
2
Gemfile
2
Gemfile
|
@ -4,4 +4,4 @@ gem "hoe"
|
|||
gem "hoe-gemspec"
|
||||
gem "rspec"
|
||||
gem "rake-compiler"
|
||||
gem "yard", "0.7.5"
|
||||
gem "yard"
|
|
@ -12,6 +12,7 @@
|
|||
* Document-class: OpenCV::CvContourTree
|
||||
*
|
||||
* Contour tree
|
||||
*
|
||||
* @see CvContour#create_tree
|
||||
*/
|
||||
__NAMESPACE_BEGIN_OPENCV
|
||||
|
@ -25,26 +26,6 @@ rb_class()
|
|||
return rb_klass;
|
||||
}
|
||||
|
||||
void
|
||||
define_ruby_class()
|
||||
{
|
||||
if (rb_klass)
|
||||
return;
|
||||
/*
|
||||
* opencv = rb_define_module("OpenCV");
|
||||
* cvseq = rb_define_class_under(opencv, "CvSeq");
|
||||
*
|
||||
* note: this comment is used by rdoc.
|
||||
*/
|
||||
VALUE opencv = rb_module_opencv();
|
||||
VALUE cvseq = cCvSeq::rb_class();
|
||||
|
||||
rb_klass = rb_define_class_under(opencv, "CvContourTree", cvseq);
|
||||
rb_define_method(rb_klass, "p1", RUBY_METHOD_FUNC(rb_p1), 0);
|
||||
rb_define_method(rb_klass, "p2", RUBY_METHOD_FUNC(rb_p2), 0);
|
||||
rb_define_method(rb_klass, "contour", RUBY_METHOD_FUNC(rb_contour), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the first point of the binary tree root segment
|
||||
* @overload p1
|
||||
|
@ -92,5 +73,24 @@ rb_contour(VALUE self, VALUE criteria)
|
|||
return cCvSeq::new_sequence(cCvContour::rb_class(), contour, cCvPoint::rb_class(), storage);
|
||||
}
|
||||
|
||||
void
|
||||
init_ruby_class()
|
||||
{
|
||||
#if 0
|
||||
// For documentation using YARD
|
||||
VALUE opencv = rb_define_module("OpenCV");
|
||||
VALUE cvseq = rb_define_class_under(opencv, "CvSeq");
|
||||
#endif
|
||||
if (rb_klass)
|
||||
return;
|
||||
VALUE opencv = rb_module_opencv();
|
||||
VALUE cvseq = cCvSeq::rb_class();
|
||||
|
||||
rb_klass = rb_define_class_under(opencv, "CvContourTree", cvseq);
|
||||
rb_define_method(rb_klass, "p1", RUBY_METHOD_FUNC(rb_p1), 0);
|
||||
rb_define_method(rb_klass, "p2", RUBY_METHOD_FUNC(rb_p2), 0);
|
||||
rb_define_method(rb_klass, "contour", RUBY_METHOD_FUNC(rb_contour), 1);
|
||||
}
|
||||
|
||||
__NAMESPACE_END_CVCONTOURTREE
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
|
|
@ -19,7 +19,7 @@ __NAMESPACE_BEGIN_CVCONTOURTREE
|
|||
|
||||
VALUE rb_class();
|
||||
|
||||
void define_ruby_class();
|
||||
void init_ruby_class();
|
||||
|
||||
VALUE rb_p1(VALUE self);
|
||||
VALUE rb_p2(VALUE self);
|
||||
|
|
|
@ -665,7 +665,7 @@ extern "C" {
|
|||
mOpenCV::mPointSet::define_ruby_module();
|
||||
mOpenCV::cCvChain::define_ruby_class();
|
||||
mOpenCV::cCvContour::define_ruby_class();
|
||||
mOpenCV::cCvContourTree::define_ruby_class();
|
||||
mOpenCV::cCvContourTree::init_ruby_class();
|
||||
|
||||
mOpenCV::cCvMat::define_ruby_class();
|
||||
mOpenCV::cIplImage::define_ruby_class();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue