mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
add documents of CvConvexityDefect
This commit is contained in:
parent
9f890573db
commit
c04f68978d
3 changed files with 35 additions and 46 deletions
|
@ -11,15 +11,7 @@
|
||||||
/*
|
/*
|
||||||
* Document-class: OpenCV::CvConvexityDefect
|
* Document-class: OpenCV::CvConvexityDefect
|
||||||
*
|
*
|
||||||
* Convexity.
|
* Convexity defect
|
||||||
* C structure is here.
|
|
||||||
* typedef struct CvConvexityDefect {
|
|
||||||
* CvPoint* start;
|
|
||||||
* CvPoint* end;
|
|
||||||
* CvPoint* depth_point;
|
|
||||||
* float depth;
|
|
||||||
* } CvConvexityDefect;
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
__NAMESPACE_BEGIN_OPENCV
|
__NAMESPACE_BEGIN_OPENCV
|
||||||
__NAMESPACE_BEGIN_CVCONVEXITYDEFECT
|
__NAMESPACE_BEGIN_CVCONVEXITYDEFECT
|
||||||
|
@ -32,16 +24,61 @@ rb_class()
|
||||||
return rb_klass;
|
return rb_klass;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/*
|
||||||
define_ruby_class()
|
* Returns the point of the contour where the defect begins
|
||||||
|
* @overload start
|
||||||
|
* @return [CvPoint] Start point of the contour
|
||||||
|
*/
|
||||||
|
VALUE
|
||||||
|
rb_start(VALUE self)
|
||||||
{
|
{
|
||||||
|
return cCvPoint::new_object(*CVCONVEXITYDEFECT(self)->start);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the point of the contour where the defect ends
|
||||||
|
* @overload end
|
||||||
|
* @return [CvPoint] End point of the contour
|
||||||
|
*/
|
||||||
|
VALUE
|
||||||
|
rb_end(VALUE self)
|
||||||
|
{
|
||||||
|
return cCvPoint::new_object(*CVCONVEXITYDEFECT(self)->end);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the farthest from the convex hull point within the defect
|
||||||
|
* @overload depth_point
|
||||||
|
* @return [CvPoint] The farthest from the convex hull point within the defect
|
||||||
|
*/
|
||||||
|
VALUE
|
||||||
|
rb_depth_point(VALUE self)
|
||||||
|
{
|
||||||
|
return cCvPoint::new_object(*CVCONVEXITYDEFECT(self)->depth_point);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns distance between the farthest point and the convex hull
|
||||||
|
* @overload depth
|
||||||
|
* @return [Number] Distance between the farthest point and the convex hull
|
||||||
|
*/
|
||||||
|
VALUE
|
||||||
|
rb_depth(VALUE self)
|
||||||
|
{
|
||||||
|
return rb_float_new(CVCONVEXITYDEFECT(self)->depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
init_ruby_class()
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
// For documentation using YARD
|
||||||
|
VALUE opencv = rb_define_module("OpenCV");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (rb_klass)
|
if (rb_klass)
|
||||||
return;
|
return;
|
||||||
/*
|
|
||||||
* opencv = rb_define_module("OpenCV");
|
|
||||||
*
|
|
||||||
* note: this comment is used by rdoc.
|
|
||||||
*/
|
|
||||||
VALUE opencv = rb_module_opencv();
|
VALUE opencv = rb_module_opencv();
|
||||||
|
|
||||||
rb_klass = rb_define_class_under(opencv, "CvConvexityDefect", rb_cObject);
|
rb_klass = rb_define_class_under(opencv, "CvConvexityDefect", rb_cObject);
|
||||||
|
@ -51,53 +88,5 @@ define_ruby_class()
|
||||||
rb_define_method(rb_klass, "depth", RUBY_METHOD_FUNC(rb_depth), 0);
|
rb_define_method(rb_klass, "depth", RUBY_METHOD_FUNC(rb_depth), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* start -> cvpoint
|
|
||||||
*
|
|
||||||
* Return start point as CvPoint.
|
|
||||||
*/
|
|
||||||
VALUE
|
|
||||||
rb_start(VALUE self)
|
|
||||||
{
|
|
||||||
return cCvPoint::new_object(*CVCONVEXITYDEFECT(self)->start);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* end -> cvpoint
|
|
||||||
*
|
|
||||||
* Return end point as CvPoint.
|
|
||||||
*/
|
|
||||||
VALUE
|
|
||||||
rb_end(VALUE self)
|
|
||||||
{
|
|
||||||
return cCvPoint::new_object(*CVCONVEXITYDEFECT(self)->end);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* depth_point -> cvpoint
|
|
||||||
*
|
|
||||||
* Return depth point as CvPoint.
|
|
||||||
*/
|
|
||||||
VALUE
|
|
||||||
rb_depth_point(VALUE self)
|
|
||||||
{
|
|
||||||
return cCvPoint::new_object(*CVCONVEXITYDEFECT(self)->depth_point);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* depth -> float
|
|
||||||
*
|
|
||||||
* Return depth.
|
|
||||||
*/
|
|
||||||
VALUE
|
|
||||||
rb_depth(VALUE self)
|
|
||||||
{
|
|
||||||
return rb_float_new(CVCONVEXITYDEFECT(self)->depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
__NAMESPACE_END_CVCONVEXITYDEFECT
|
__NAMESPACE_END_CVCONVEXITYDEFECT
|
||||||
__NAMESPACE_END_OPENCV
|
__NAMESPACE_END_OPENCV
|
||||||
|
|
|
@ -20,7 +20,7 @@ __NAMESPACE_BEGIN_CVCONVEXITYDEFECT
|
||||||
|
|
||||||
VALUE rb_class();
|
VALUE rb_class();
|
||||||
|
|
||||||
void define_ruby_class();
|
void init_ruby_class();
|
||||||
|
|
||||||
VALUE rb_start(VALUE self);
|
VALUE rb_start(VALUE self);
|
||||||
VALUE rb_end(VALUE self);
|
VALUE rb_end(VALUE self);
|
||||||
|
|
|
@ -662,7 +662,7 @@ extern "C" {
|
||||||
mOpenCV::cIplConvKernel::define_ruby_class();
|
mOpenCV::cIplConvKernel::define_ruby_class();
|
||||||
mOpenCV::cCvMoments::define_ruby_class();
|
mOpenCV::cCvMoments::define_ruby_class();
|
||||||
mOpenCV::cCvHuMoments::define_ruby_class();
|
mOpenCV::cCvHuMoments::define_ruby_class();
|
||||||
mOpenCV::cCvConvexityDefect::define_ruby_class();
|
mOpenCV::cCvConvexityDefect::init_ruby_class();
|
||||||
|
|
||||||
mOpenCV::cCvSURFPoint::define_ruby_class();
|
mOpenCV::cCvSURFPoint::define_ruby_class();
|
||||||
mOpenCV::cCvSURFParams::define_ruby_class();
|
mOpenCV::cCvSURFParams::define_ruby_class();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue