2008-08-19 11:01:28 -04:00
|
|
|
/************************************************************
|
|
|
|
|
|
|
|
cvbox2d.h -
|
|
|
|
|
|
|
|
$Author: lsxi $
|
|
|
|
|
|
|
|
Copyright (C) 2005-2006 Masakazu Yonekura
|
|
|
|
|
|
|
|
************************************************************/
|
|
|
|
#ifndef RUBY_OPENCV_CVBOX2D_H
|
|
|
|
#define RUBY_OPENCV_CVBOX2D_H
|
|
|
|
|
2011-08-11 13:26:54 -04:00
|
|
|
#include "opencv.h"
|
2008-08-19 11:01:28 -04:00
|
|
|
|
2011-08-11 13:26:54 -04:00
|
|
|
#define __NAMESPACE_BEGIN_CVBOX2D namespace cCvBox2D {
|
2008-08-19 11:01:28 -04:00
|
|
|
#define __NAMESPACE_END_CVBOX2D }
|
|
|
|
|
|
|
|
__NAMESPACE_BEGIN_OPENCV
|
|
|
|
__NAMESPACE_BEGIN_CVBOX2D
|
|
|
|
|
|
|
|
VALUE rb_class();
|
|
|
|
|
|
|
|
void define_ruby_class();
|
|
|
|
|
|
|
|
VALUE rb_allocate(VALUE klass);
|
|
|
|
|
2011-01-09 14:43:04 -05:00
|
|
|
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_center(VALUE self);
|
2011-01-09 14:43:04 -05:00
|
|
|
VALUE rb_set_center(VALUE self, VALUE value);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_size(VALUE self);
|
2011-01-09 14:43:04 -05:00
|
|
|
VALUE rb_set_size(VALUE self, VALUE value);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_angle(VALUE self);
|
2011-01-09 14:43:04 -05:00
|
|
|
VALUE rb_set_angle(VALUE self, VALUE value);
|
2008-08-19 11:01:28 -04:00
|
|
|
VALUE rb_points(VALUE self);
|
|
|
|
|
|
|
|
VALUE new_object();
|
|
|
|
VALUE new_object(CvBox2D box);
|
|
|
|
|
|
|
|
__NAMESPACE_END_CVBOX2D
|
|
|
|
|
2011-07-03 01:16:38 -04:00
|
|
|
inline CvBox2D*
|
|
|
|
CVBOX2D(VALUE object){
|
2008-08-19 11:01:28 -04:00
|
|
|
CvBox2D *ptr;
|
|
|
|
Data_Get_Struct(object, CvBox2D, ptr);
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
2011-07-03 01:16:38 -04:00
|
|
|
inline CvBox2D
|
|
|
|
VALUE_TO_CVBOX2D(VALUE object){
|
|
|
|
if (rb_obj_is_kind_of(object, cCvBox2D::rb_class())) {
|
2008-08-19 11:01:28 -04:00
|
|
|
return *CVBOX2D(object);
|
2011-07-03 01:16:38 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
raise_typeerror(object, cCvBox2D::rb_class());
|
2008-08-19 11:01:28 -04:00
|
|
|
}
|
2011-12-27 09:47:08 -05:00
|
|
|
throw "Should never reach here";
|
2008-08-19 11:01:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
__NAMESPACE_END_OPENCV
|
|
|
|
|
|
|
|
#endif // RUBY_OPENCV_CVBOX2D_H
|