ruby-opencv 0.0.9-x86-mswin32 → 0.0.10.pre-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/History.txt +5 -5
- data/README.md +1 -1
- data/examples/contours/contour_retrieval_modes.rb +139 -139
- data/examples/face_detect.rb +20 -20
- data/examples/houghcircle.rb +22 -22
- data/examples/paint.rb +70 -70
- data/examples/snake.rb +43 -43
- data/ext/opencv/cvcondensation.cpp +282 -282
- data/ext/opencv/cvcondensation.h +49 -49
- data/ext/opencv/cvmat.cpp +6 -6
- data/ext/opencv/cvmatnd.cpp +44 -44
- data/ext/opencv/cvmatnd.h +28 -28
- data/ext/opencv/cvmemstorage.cpp +68 -68
- data/ext/opencv/cvmemstorage.h +53 -53
- data/ext/opencv/cvmoments.h +75 -75
- data/ext/opencv/cvpoint.h +64 -64
- data/ext/opencv/cvpoint2d32f.h +63 -63
- data/ext/opencv/cvpoint3d32f.h +66 -66
- data/ext/opencv/cvrect.h +79 -79
- data/ext/opencv/cvscalar.h +71 -71
- data/ext/opencv/cvsize.h +65 -65
- data/ext/opencv/cvsize2d32f.h +64 -64
- data/ext/opencv/cvslice.h +61 -61
- data/ext/opencv/cvsparsemat.cpp +44 -44
- data/ext/opencv/cvsparsemat.h +28 -28
- data/ext/opencv/cvsurfparams.h +58 -58
- data/ext/opencv/cvsurfpoint.h +52 -52
- data/ext/opencv/cvtermcriteria.h +71 -71
- data/ext/opencv/cvtwopoints.cpp +116 -116
- data/ext/opencv/cvtwopoints.h +51 -51
- data/ext/opencv/cvvideowriter.h +43 -43
- data/ext/opencv/gui.cpp +68 -68
- data/ext/opencv/gui.h +30 -30
- data/ext/opencv/iplconvkernel.h +71 -71
- data/ext/opencv/mouseevent.cpp +181 -181
- data/ext/opencv/mouseevent.h +56 -56
- data/ext/opencv/opencv.cpp +5 -0
- data/ext/opencv/trackbar.h +69 -69
- data/ext/opencv/window.h +66 -66
- data/lib/opencv/version.rb +1 -1
- data/ruby-opencv.gemspec +7 -7
- data/test/test_cvmat_imageprocessing.rb +15 -25
- data/test/test_opencv.rb +7 -2
- metadata +7 -7
data/ext/opencv/cvrect.h
CHANGED
@@ -1,79 +1,79 @@
|
|
1
|
-
/************************************************************
|
2
|
-
|
3
|
-
cvrect.h -
|
4
|
-
|
5
|
-
$Author: lsxi $
|
6
|
-
|
7
|
-
Copyright (C) 2005-2006 Masakazu Yonekura
|
8
|
-
|
9
|
-
************************************************************/
|
10
|
-
#ifndef RUBY_OPENCV_CVRECT_H
|
11
|
-
#define RUBY_OPENCV_CVRECT_H
|
12
|
-
|
13
|
-
#include "opencv.h"
|
14
|
-
|
15
|
-
#define __NAMESPACE_BEGIN_CVRECT namespace cCvRect {
|
16
|
-
#define __NAMESPACE_END_CVRECT }
|
17
|
-
|
18
|
-
__NAMESPACE_BEGIN_OPENCV
|
19
|
-
__NAMESPACE_BEGIN_CVRECT
|
20
|
-
|
21
|
-
VALUE rb_class();
|
22
|
-
|
23
|
-
void define_ruby_class();
|
24
|
-
|
25
|
-
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
-
VALUE rb_max_rect(VALUE klass, VALUE rect1, VALUE rect2);
|
27
|
-
|
28
|
-
VALUE rb_allocate(VALUE klass);
|
29
|
-
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
30
|
-
VALUE rb_x(VALUE self);
|
31
|
-
VALUE rb_set_x(VALUE self, VALUE x);
|
32
|
-
VALUE rb_y(VALUE self);
|
33
|
-
VALUE rb_set_y(VALUE self, VALUE y);
|
34
|
-
VALUE rb_width(VALUE self);
|
35
|
-
VALUE rb_set_width(VALUE self, VALUE width);
|
36
|
-
VALUE rb_height(VALUE self);
|
37
|
-
VALUE rb_set_height(VALUE self, VALUE height);
|
38
|
-
|
39
|
-
VALUE rb_center(VALUE self);
|
40
|
-
VALUE rb_points(VALUE self);
|
41
|
-
VALUE rb_top_left(VALUE self);
|
42
|
-
VALUE rb_set_top_left(VALUE self, VALUE point);
|
43
|
-
VALUE rb_top_right(VALUE self);
|
44
|
-
VALUE rb_set_top_right(VALUE self, VALUE point);
|
45
|
-
VALUE rb_bottom_left(VALUE self);
|
46
|
-
VALUE rb_set_bottom_left(VALUE self, VALUE point);
|
47
|
-
VALUE rb_bottom_right(VALUE self);
|
48
|
-
VALUE rb_set_bottom_right(VALUE self, VALUE point);
|
49
|
-
|
50
|
-
VALUE new_object(CvRect rect);
|
51
|
-
|
52
|
-
__NAMESPACE_END_CVRECT
|
53
|
-
|
54
|
-
inline CvRect*
|
55
|
-
CVRECT(VALUE object)
|
56
|
-
{
|
57
|
-
CvRect *ptr;
|
58
|
-
Data_Get_Struct(object, CvRect, ptr);
|
59
|
-
return ptr;
|
60
|
-
}
|
61
|
-
|
62
|
-
inline CvRect
|
63
|
-
VALUE_TO_CVRECT(VALUE object)
|
64
|
-
{
|
65
|
-
if (cCvRect::rb_compatible_q(cCvRect::rb_class(), object)) {
|
66
|
-
return cvRect(NUM2INT(rb_funcall(object, rb_intern("x"), 0)),
|
67
|
-
NUM2INT(rb_funcall(object, rb_intern("y"), 0)),
|
68
|
-
NUM2INT(rb_funcall(object, rb_intern("width"), 0)),
|
69
|
-
NUM2INT(rb_funcall(object, rb_intern("height"), 0)));
|
70
|
-
}
|
71
|
-
else {
|
72
|
-
raise_compatible_typeerror(object, cCvRect::rb_class());
|
73
|
-
}
|
74
|
-
throw "Should never reach here";
|
75
|
-
}
|
76
|
-
|
77
|
-
__NAMESPACE_END_OPENCV
|
78
|
-
|
79
|
-
#endif // RUBY_OPENCV_CVRECT_H
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvrect.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005-2006 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVRECT_H
|
11
|
+
#define RUBY_OPENCV_CVRECT_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
#define __NAMESPACE_BEGIN_CVRECT namespace cCvRect {
|
16
|
+
#define __NAMESPACE_END_CVRECT }
|
17
|
+
|
18
|
+
__NAMESPACE_BEGIN_OPENCV
|
19
|
+
__NAMESPACE_BEGIN_CVRECT
|
20
|
+
|
21
|
+
VALUE rb_class();
|
22
|
+
|
23
|
+
void define_ruby_class();
|
24
|
+
|
25
|
+
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
+
VALUE rb_max_rect(VALUE klass, VALUE rect1, VALUE rect2);
|
27
|
+
|
28
|
+
VALUE rb_allocate(VALUE klass);
|
29
|
+
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
30
|
+
VALUE rb_x(VALUE self);
|
31
|
+
VALUE rb_set_x(VALUE self, VALUE x);
|
32
|
+
VALUE rb_y(VALUE self);
|
33
|
+
VALUE rb_set_y(VALUE self, VALUE y);
|
34
|
+
VALUE rb_width(VALUE self);
|
35
|
+
VALUE rb_set_width(VALUE self, VALUE width);
|
36
|
+
VALUE rb_height(VALUE self);
|
37
|
+
VALUE rb_set_height(VALUE self, VALUE height);
|
38
|
+
|
39
|
+
VALUE rb_center(VALUE self);
|
40
|
+
VALUE rb_points(VALUE self);
|
41
|
+
VALUE rb_top_left(VALUE self);
|
42
|
+
VALUE rb_set_top_left(VALUE self, VALUE point);
|
43
|
+
VALUE rb_top_right(VALUE self);
|
44
|
+
VALUE rb_set_top_right(VALUE self, VALUE point);
|
45
|
+
VALUE rb_bottom_left(VALUE self);
|
46
|
+
VALUE rb_set_bottom_left(VALUE self, VALUE point);
|
47
|
+
VALUE rb_bottom_right(VALUE self);
|
48
|
+
VALUE rb_set_bottom_right(VALUE self, VALUE point);
|
49
|
+
|
50
|
+
VALUE new_object(CvRect rect);
|
51
|
+
|
52
|
+
__NAMESPACE_END_CVRECT
|
53
|
+
|
54
|
+
inline CvRect*
|
55
|
+
CVRECT(VALUE object)
|
56
|
+
{
|
57
|
+
CvRect *ptr;
|
58
|
+
Data_Get_Struct(object, CvRect, ptr);
|
59
|
+
return ptr;
|
60
|
+
}
|
61
|
+
|
62
|
+
inline CvRect
|
63
|
+
VALUE_TO_CVRECT(VALUE object)
|
64
|
+
{
|
65
|
+
if (cCvRect::rb_compatible_q(cCvRect::rb_class(), object)) {
|
66
|
+
return cvRect(NUM2INT(rb_funcall(object, rb_intern("x"), 0)),
|
67
|
+
NUM2INT(rb_funcall(object, rb_intern("y"), 0)),
|
68
|
+
NUM2INT(rb_funcall(object, rb_intern("width"), 0)),
|
69
|
+
NUM2INT(rb_funcall(object, rb_intern("height"), 0)));
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
raise_compatible_typeerror(object, cCvRect::rb_class());
|
73
|
+
}
|
74
|
+
throw "Should never reach here";
|
75
|
+
}
|
76
|
+
|
77
|
+
__NAMESPACE_END_OPENCV
|
78
|
+
|
79
|
+
#endif // RUBY_OPENCV_CVRECT_H
|
data/ext/opencv/cvscalar.h
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
/************************************************************
|
2
|
-
|
3
|
-
cvscalar.h -
|
4
|
-
|
5
|
-
$Author: lsxi $
|
6
|
-
|
7
|
-
Copyright (C) 2005 Masakazu Yonekura
|
8
|
-
|
9
|
-
************************************************************/
|
10
|
-
#ifndef RUBY_OPENCV_CVSCALAR_H
|
11
|
-
#define RUBY_OPENCV_CVSCALAR_H
|
12
|
-
|
13
|
-
#include "opencv.h"
|
14
|
-
|
15
|
-
#define __NAMESPACE_BEGIN_CVSCALAR namespace cCvScalar {
|
16
|
-
#define __NAMESPACE_END_CVSCALAR }
|
17
|
-
|
18
|
-
__NAMESPACE_BEGIN_OPENCV
|
19
|
-
__NAMESPACE_BEGIN_CVSCALAR
|
20
|
-
|
21
|
-
VALUE rb_class();
|
22
|
-
|
23
|
-
void define_ruby_class();
|
24
|
-
|
25
|
-
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
-
|
27
|
-
VALUE rb_allocate(VALUE klass);
|
28
|
-
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
29
|
-
|
30
|
-
VALUE rb_aref(VALUE self, VALUE index);
|
31
|
-
VALUE rb_aset(VALUE self, VALUE index, VALUE value);
|
32
|
-
VALUE rb_sub(int argc, VALUE *argv, VALUE self);
|
33
|
-
|
34
|
-
VALUE rb_to_s(VALUE self);
|
35
|
-
VALUE rb_to_ary(VALUE self);
|
36
|
-
|
37
|
-
VALUE new_object();
|
38
|
-
VALUE new_object(CvScalar scalar);
|
39
|
-
|
40
|
-
__NAMESPACE_END_CVSCALAR
|
41
|
-
|
42
|
-
inline CvScalar*
|
43
|
-
CVSCALAR(VALUE object)
|
44
|
-
{
|
45
|
-
CvScalar *ptr;
|
46
|
-
Data_Get_Struct(object, CvScalar, ptr);
|
47
|
-
return ptr;
|
48
|
-
}
|
49
|
-
|
50
|
-
inline CvScalar
|
51
|
-
VALUE_TO_CVSCALAR(VALUE object)
|
52
|
-
{
|
53
|
-
ID aref_id;
|
54
|
-
if (FIXNUM_P(object)) {
|
55
|
-
return cvScalarAll(FIX2INT(object));
|
56
|
-
}
|
57
|
-
else if (rb_respond_to(object, (aref_id = rb_intern("[]")))) {
|
58
|
-
return cvScalar(NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(0))),
|
59
|
-
NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(1))),
|
60
|
-
NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(2))),
|
61
|
-
NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(3))));
|
62
|
-
}
|
63
|
-
else {
|
64
|
-
raise_compatible_typeerror(object, cCvScalar::rb_class());
|
65
|
-
}
|
66
|
-
throw "Should never reach here";
|
67
|
-
}
|
68
|
-
|
69
|
-
__NAMESPACE_END_OPENCV
|
70
|
-
|
71
|
-
#endif // RUBY_OPENCV_CVSCALAR_H
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvscalar.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVSCALAR_H
|
11
|
+
#define RUBY_OPENCV_CVSCALAR_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
#define __NAMESPACE_BEGIN_CVSCALAR namespace cCvScalar {
|
16
|
+
#define __NAMESPACE_END_CVSCALAR }
|
17
|
+
|
18
|
+
__NAMESPACE_BEGIN_OPENCV
|
19
|
+
__NAMESPACE_BEGIN_CVSCALAR
|
20
|
+
|
21
|
+
VALUE rb_class();
|
22
|
+
|
23
|
+
void define_ruby_class();
|
24
|
+
|
25
|
+
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
+
|
27
|
+
VALUE rb_allocate(VALUE klass);
|
28
|
+
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
29
|
+
|
30
|
+
VALUE rb_aref(VALUE self, VALUE index);
|
31
|
+
VALUE rb_aset(VALUE self, VALUE index, VALUE value);
|
32
|
+
VALUE rb_sub(int argc, VALUE *argv, VALUE self);
|
33
|
+
|
34
|
+
VALUE rb_to_s(VALUE self);
|
35
|
+
VALUE rb_to_ary(VALUE self);
|
36
|
+
|
37
|
+
VALUE new_object();
|
38
|
+
VALUE new_object(CvScalar scalar);
|
39
|
+
|
40
|
+
__NAMESPACE_END_CVSCALAR
|
41
|
+
|
42
|
+
inline CvScalar*
|
43
|
+
CVSCALAR(VALUE object)
|
44
|
+
{
|
45
|
+
CvScalar *ptr;
|
46
|
+
Data_Get_Struct(object, CvScalar, ptr);
|
47
|
+
return ptr;
|
48
|
+
}
|
49
|
+
|
50
|
+
inline CvScalar
|
51
|
+
VALUE_TO_CVSCALAR(VALUE object)
|
52
|
+
{
|
53
|
+
ID aref_id;
|
54
|
+
if (FIXNUM_P(object)) {
|
55
|
+
return cvScalarAll(FIX2INT(object));
|
56
|
+
}
|
57
|
+
else if (rb_respond_to(object, (aref_id = rb_intern("[]")))) {
|
58
|
+
return cvScalar(NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(0))),
|
59
|
+
NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(1))),
|
60
|
+
NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(2))),
|
61
|
+
NUM2DBL(rb_funcall(object, aref_id, 1, INT2FIX(3))));
|
62
|
+
}
|
63
|
+
else {
|
64
|
+
raise_compatible_typeerror(object, cCvScalar::rb_class());
|
65
|
+
}
|
66
|
+
throw "Should never reach here";
|
67
|
+
}
|
68
|
+
|
69
|
+
__NAMESPACE_END_OPENCV
|
70
|
+
|
71
|
+
#endif // RUBY_OPENCV_CVSCALAR_H
|
data/ext/opencv/cvsize.h
CHANGED
@@ -1,65 +1,65 @@
|
|
1
|
-
/************************************************************
|
2
|
-
|
3
|
-
cvsize.h -
|
4
|
-
|
5
|
-
$Author: lsxi $
|
6
|
-
|
7
|
-
Copyright (C) 2005-2006 Masakazu Yonekura
|
8
|
-
|
9
|
-
************************************************************/
|
10
|
-
#ifndef RUBY_OPENCV_CVSIZE_H
|
11
|
-
#define RUBY_OPENCV_CVSIZE_H
|
12
|
-
|
13
|
-
#include "opencv.h"
|
14
|
-
|
15
|
-
#define __NAMESPACE_BEGIN_CVSIZE namespace cCvSize {
|
16
|
-
#define __NAMESPACE_END_CVSIZE }
|
17
|
-
|
18
|
-
__NAMESPACE_BEGIN_OPENCV
|
19
|
-
__NAMESPACE_BEGIN_CVSIZE
|
20
|
-
|
21
|
-
VALUE rb_class();
|
22
|
-
|
23
|
-
void define_ruby_class();
|
24
|
-
|
25
|
-
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
-
|
27
|
-
VALUE rb_allocate(VALUE klass);
|
28
|
-
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
29
|
-
VALUE rb_width(VALUE self);
|
30
|
-
VALUE rb_set_width(VALUE self, VALUE width);
|
31
|
-
VALUE rb_height(VALUE self);
|
32
|
-
VALUE rb_set_height(VALUE self, VALUE height);
|
33
|
-
|
34
|
-
VALUE rb_to_s(VALUE self);
|
35
|
-
VALUE rb_to_ary(VALUE self);
|
36
|
-
|
37
|
-
VALUE new_object();
|
38
|
-
VALUE new_object(CvSize size);
|
39
|
-
|
40
|
-
__NAMESPACE_END_CVSIZE
|
41
|
-
|
42
|
-
inline CvSize*
|
43
|
-
CVSIZE(VALUE object)
|
44
|
-
{
|
45
|
-
CvSize *ptr;
|
46
|
-
Data_Get_Struct(object, CvSize, ptr);
|
47
|
-
return ptr;
|
48
|
-
}
|
49
|
-
|
50
|
-
inline CvSize
|
51
|
-
VALUE_TO_CVSIZE(VALUE object)
|
52
|
-
{
|
53
|
-
if (cCvSize::rb_compatible_q(cCvSize::rb_class(), object)) {
|
54
|
-
return cvSize(NUM2INT(rb_funcall(object, rb_intern("width"), 0)),
|
55
|
-
NUM2INT(rb_funcall(object, rb_intern("height"), 0)));
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
raise_compatible_typeerror(object, cCvSize::rb_class());
|
59
|
-
}
|
60
|
-
throw "Should never reach here";
|
61
|
-
}
|
62
|
-
|
63
|
-
__NAMESPACE_END_OPENCV
|
64
|
-
|
65
|
-
#endif // RUBY_OPENCV_CVSIZE_H
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvsize.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005-2006 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVSIZE_H
|
11
|
+
#define RUBY_OPENCV_CVSIZE_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
#define __NAMESPACE_BEGIN_CVSIZE namespace cCvSize {
|
16
|
+
#define __NAMESPACE_END_CVSIZE }
|
17
|
+
|
18
|
+
__NAMESPACE_BEGIN_OPENCV
|
19
|
+
__NAMESPACE_BEGIN_CVSIZE
|
20
|
+
|
21
|
+
VALUE rb_class();
|
22
|
+
|
23
|
+
void define_ruby_class();
|
24
|
+
|
25
|
+
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
+
|
27
|
+
VALUE rb_allocate(VALUE klass);
|
28
|
+
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
29
|
+
VALUE rb_width(VALUE self);
|
30
|
+
VALUE rb_set_width(VALUE self, VALUE width);
|
31
|
+
VALUE rb_height(VALUE self);
|
32
|
+
VALUE rb_set_height(VALUE self, VALUE height);
|
33
|
+
|
34
|
+
VALUE rb_to_s(VALUE self);
|
35
|
+
VALUE rb_to_ary(VALUE self);
|
36
|
+
|
37
|
+
VALUE new_object();
|
38
|
+
VALUE new_object(CvSize size);
|
39
|
+
|
40
|
+
__NAMESPACE_END_CVSIZE
|
41
|
+
|
42
|
+
inline CvSize*
|
43
|
+
CVSIZE(VALUE object)
|
44
|
+
{
|
45
|
+
CvSize *ptr;
|
46
|
+
Data_Get_Struct(object, CvSize, ptr);
|
47
|
+
return ptr;
|
48
|
+
}
|
49
|
+
|
50
|
+
inline CvSize
|
51
|
+
VALUE_TO_CVSIZE(VALUE object)
|
52
|
+
{
|
53
|
+
if (cCvSize::rb_compatible_q(cCvSize::rb_class(), object)) {
|
54
|
+
return cvSize(NUM2INT(rb_funcall(object, rb_intern("width"), 0)),
|
55
|
+
NUM2INT(rb_funcall(object, rb_intern("height"), 0)));
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
raise_compatible_typeerror(object, cCvSize::rb_class());
|
59
|
+
}
|
60
|
+
throw "Should never reach here";
|
61
|
+
}
|
62
|
+
|
63
|
+
__NAMESPACE_END_OPENCV
|
64
|
+
|
65
|
+
#endif // RUBY_OPENCV_CVSIZE_H
|
data/ext/opencv/cvsize2d32f.h
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
/************************************************************
|
2
|
-
|
3
|
-
cvsize2d32f.h -
|
4
|
-
|
5
|
-
$Author: lsxi $
|
6
|
-
|
7
|
-
Copyright (C) 2005-2006 Masakazu Yonekura
|
8
|
-
|
9
|
-
************************************************************/
|
10
|
-
#ifndef RUBY_OPENCV_CVSIZE2D32F_H
|
11
|
-
#define RUBY_OPENCV_CVSIZE2D32F_H
|
12
|
-
|
13
|
-
#include "opencv.h"
|
14
|
-
|
15
|
-
#define __NAMESPACE_BEGIN_CVSIZE2D32F namespace cCvSize2D32f {
|
16
|
-
#define __NAMESPACE_END_CVSIZE2D32F }
|
17
|
-
|
18
|
-
__NAMESPACE_BEGIN_OPENCV
|
19
|
-
__NAMESPACE_BEGIN_CVSIZE2D32F
|
20
|
-
|
21
|
-
VALUE rb_class();
|
22
|
-
|
23
|
-
void define_ruby_class();
|
24
|
-
|
25
|
-
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
-
|
27
|
-
VALUE rb_allocate(VALUE klass);
|
28
|
-
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
29
|
-
VALUE rb_width(VALUE self);
|
30
|
-
VALUE rb_set_width(VALUE self, VALUE width);
|
31
|
-
VALUE rb_height(VALUE self);
|
32
|
-
VALUE rb_set_height(VALUE self, VALUE height);
|
33
|
-
|
34
|
-
VALUE rb_to_s(VALUE self);
|
35
|
-
VALUE rb_to_ary(VALUE self);
|
36
|
-
|
37
|
-
VALUE new_object(CvSize2D32f size);
|
38
|
-
|
39
|
-
__NAMESPACE_END_CVSIZE2D32F
|
40
|
-
|
41
|
-
inline CvSize2D32f*
|
42
|
-
CVSIZE2D32F(VALUE object)
|
43
|
-
{
|
44
|
-
CvSize2D32f *ptr;
|
45
|
-
Data_Get_Struct(object, CvSize2D32f, ptr);
|
46
|
-
return ptr;
|
47
|
-
}
|
48
|
-
|
49
|
-
inline CvSize2D32f
|
50
|
-
VALUE_TO_CVSIZE2D32F(VALUE object)
|
51
|
-
{
|
52
|
-
if (cCvSize2D32f::rb_compatible_q(cCvSize2D32f::rb_class(), object)) {
|
53
|
-
return cvSize2D32f(NUM2DBL(rb_funcall(object, rb_intern("width"), 0)),
|
54
|
-
NUM2DBL(rb_funcall(object, rb_intern("height"), 0)));
|
55
|
-
}
|
56
|
-
else {
|
57
|
-
raise_compatible_typeerror(object, cCvSize2D32f::rb_class());
|
58
|
-
}
|
59
|
-
throw "Should never reach here";
|
60
|
-
}
|
61
|
-
|
62
|
-
__NAMESPACE_END_OPENCV
|
63
|
-
|
64
|
-
#endif // RUBY_OPENCV_CVSIZE2D32F_H
|
1
|
+
/************************************************************
|
2
|
+
|
3
|
+
cvsize2d32f.h -
|
4
|
+
|
5
|
+
$Author: lsxi $
|
6
|
+
|
7
|
+
Copyright (C) 2005-2006 Masakazu Yonekura
|
8
|
+
|
9
|
+
************************************************************/
|
10
|
+
#ifndef RUBY_OPENCV_CVSIZE2D32F_H
|
11
|
+
#define RUBY_OPENCV_CVSIZE2D32F_H
|
12
|
+
|
13
|
+
#include "opencv.h"
|
14
|
+
|
15
|
+
#define __NAMESPACE_BEGIN_CVSIZE2D32F namespace cCvSize2D32f {
|
16
|
+
#define __NAMESPACE_END_CVSIZE2D32F }
|
17
|
+
|
18
|
+
__NAMESPACE_BEGIN_OPENCV
|
19
|
+
__NAMESPACE_BEGIN_CVSIZE2D32F
|
20
|
+
|
21
|
+
VALUE rb_class();
|
22
|
+
|
23
|
+
void define_ruby_class();
|
24
|
+
|
25
|
+
VALUE rb_compatible_q(VALUE klass, VALUE object);
|
26
|
+
|
27
|
+
VALUE rb_allocate(VALUE klass);
|
28
|
+
VALUE rb_initialize(int argc, VALUE *argv, VALUE self);
|
29
|
+
VALUE rb_width(VALUE self);
|
30
|
+
VALUE rb_set_width(VALUE self, VALUE width);
|
31
|
+
VALUE rb_height(VALUE self);
|
32
|
+
VALUE rb_set_height(VALUE self, VALUE height);
|
33
|
+
|
34
|
+
VALUE rb_to_s(VALUE self);
|
35
|
+
VALUE rb_to_ary(VALUE self);
|
36
|
+
|
37
|
+
VALUE new_object(CvSize2D32f size);
|
38
|
+
|
39
|
+
__NAMESPACE_END_CVSIZE2D32F
|
40
|
+
|
41
|
+
inline CvSize2D32f*
|
42
|
+
CVSIZE2D32F(VALUE object)
|
43
|
+
{
|
44
|
+
CvSize2D32f *ptr;
|
45
|
+
Data_Get_Struct(object, CvSize2D32f, ptr);
|
46
|
+
return ptr;
|
47
|
+
}
|
48
|
+
|
49
|
+
inline CvSize2D32f
|
50
|
+
VALUE_TO_CVSIZE2D32F(VALUE object)
|
51
|
+
{
|
52
|
+
if (cCvSize2D32f::rb_compatible_q(cCvSize2D32f::rb_class(), object)) {
|
53
|
+
return cvSize2D32f(NUM2DBL(rb_funcall(object, rb_intern("width"), 0)),
|
54
|
+
NUM2DBL(rb_funcall(object, rb_intern("height"), 0)));
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
raise_compatible_typeerror(object, cCvSize2D32f::rb_class());
|
58
|
+
}
|
59
|
+
throw "Should never reach here";
|
60
|
+
}
|
61
|
+
|
62
|
+
__NAMESPACE_END_OPENCV
|
63
|
+
|
64
|
+
#endif // RUBY_OPENCV_CVSIZE2D32F_H
|