diff --git a/ext/opencv/cvcapture.cpp b/ext/opencv/cvcapture.cpp index 36d6146..cdac3e9 100644 --- a/ext/opencv/cvcapture.cpp +++ b/ext/opencv/cvcapture.cpp @@ -39,7 +39,7 @@ cvcapture_free(void *ptr) * Open video file or a capturing device for video capturing * @scope class * @overload open(dev = nil) - * @param dev [String,Fixnum,Simbol,nil] Video capturing device + * @param dev [String,Integer,Simbol,nil] Video capturing device * * If dev is a string (i.e "stream.avi"), reads video stream from a file. * * If dev is a number or symbol (included in CvCapture::INTERFACE), reads video stream from a device. * * If dev is a nil, same as CvCapture.open(:any) diff --git a/ext/opencv/cvchain.cpp b/ext/opencv/cvchain.cpp index ccec7d4..9fdc53b 100644 --- a/ext/opencv/cvchain.cpp +++ b/ext/opencv/cvchain.cpp @@ -62,7 +62,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self) raise_cverror(e); } CvSeq* self_ptr = CVSEQ(self); - cCvSeq::register_elem_class(self_ptr, rb_cFixnum); + cCvSeq::register_elem_class(self_ptr, rb_cInteger); register_root_object(self_ptr, storage_value); return self; @@ -95,7 +95,7 @@ rb_set_origin(VALUE self, VALUE origin) /* * Returns the chain codes * @overload codes - * @return [Array] Chain codes + * @return [Array] Chain codes * @opencv_func cvStartReadChainPoints * @opencv_func CV_READ_SEQ_ELEM */ diff --git a/ext/opencv/cvcontour.cpp b/ext/opencv/cvcontour.cpp index 95dae21..f11f330 100644 --- a/ext/opencv/cvcontour.cpp +++ b/ext/opencv/cvcontour.cpp @@ -44,14 +44,14 @@ rb_allocate(VALUE klass) * Constructor * * @overload new(seq_flags = CV_SEQ_ELTYPE_POINT | CV_SEQ_KIND_GENERIC, storage = nil) - * @param [Fixnum] seq_flags Flags of the created sequence, which are combinations of + * @param [Integer] seq_flags Flags of the created sequence, which are combinations of * the element types and sequence types. * - Element type: * - CV_SEQ_ELTYPE_POINT: {CvPoint} * - CV_32FC2: {CvPoint2D32f} * - CV_SEQ_ELTYPE_POINT3D: {CvPoint3D32f} - * - CV_SEQ_ELTYPE_INDEX: Fixnum - * - CV_SEQ_ELTYPE_CODE: Fixnum (Freeman code) + * - CV_SEQ_ELTYPE_INDEX: Integer + * - CV_SEQ_ELTYPE_CODE: Integer (Freeman code) * - Sequence type: * - CV_SEQ_KIND_GENERIC: Generic sequence * - CV_SEQ_KIND_CURVE: Curve diff --git a/ext/opencv/cvfont.cpp b/ext/opencv/cvfont.cpp index 236593a..37ea75c 100644 --- a/ext/opencv/cvfont.cpp +++ b/ext/opencv/cvfont.cpp @@ -108,7 +108,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self) /* * Returns font face * @overload face - * @return [Fixnum] Font face + * @return [Integer] Font face */ VALUE rb_face(VALUE self) @@ -152,7 +152,7 @@ rb_shear(VALUE self) /* * Returns thickness * @overload thickness - * @return [Fixnum] thickness + * @return [Integer] thickness */ VALUE rb_thickness(VALUE self) @@ -163,7 +163,7 @@ rb_thickness(VALUE self) /* * Returns line type * @overload line_type - * @return [Fixnum] line_type + * @return [Integer] line_type */ VALUE rb_line_type(VALUE self) diff --git a/ext/opencv/cvpoint.cpp b/ext/opencv/cvpoint.cpp index 99fe431..4252f6f 100644 --- a/ext/opencv/cvpoint.cpp +++ b/ext/opencv/cvpoint.cpp @@ -12,7 +12,7 @@ * Document-class: OpenCV::CvPoint * * This class means one point on X axis Y axis. - * X and Y takes the value of the Fixnum. see also CvPoint2D32F + * X and Y takes the value of the Integer. see also CvPoint2D32F * * C structure is here, very simple. * typdef struct CvPoint { diff --git a/ext/opencv/cvscalar.cpp b/ext/opencv/cvscalar.cpp index 55565a5..14ccf11 100644 --- a/ext/opencv/cvscalar.cpp +++ b/ext/opencv/cvscalar.cpp @@ -53,7 +53,7 @@ rb_allocate(VALUE klass) * call-seq: * new([d1][,d2][,d3][,d4]) * - * Create new Scalar. Argument should be Fixnum (or nil as 0). + * Create new Scalar. Argument should be Integer (or nil as 0). */ VALUE rb_initialize(int argc, VALUE *argv, VALUE self) diff --git a/ext/opencv/cvseq.cpp b/ext/opencv/cvseq.cpp index 4c1e783..ac36222 100644 --- a/ext/opencv/cvseq.cpp +++ b/ext/opencv/cvseq.cpp @@ -43,7 +43,7 @@ eltype2class(int eltype, VALUE* ret) { break; case CV_SEQ_ELTYPE_CODE: case CV_SEQ_ELTYPE_INDEX: - *ret = rb_cFixnum; + *ret = rb_cInteger; break; case CV_SEQ_ELTYPE_PPOINT: // or CV_SEQ_ELTYPE_PTR: // Not supported @@ -132,7 +132,7 @@ class2seq_flags_value(VALUE klass) { else if (klass == cCvPoint3D32f::rb_class()) { seq_flags = CV_SEQ_ELTYPE_POINT3D; } - else if (klass == rb_cFixnum) { + else if (klass == rb_cInteger) { seq_flags = CV_SEQ_ELTYPE_INDEX; } else { @@ -146,14 +146,14 @@ class2seq_flags_value(VALUE klass) { * Constructor * * @overload new(seq_flags, storage = nil) - * @param [Fixnum] seq_flags Flags of the created sequence, which are combinations of + * @param [Integer] seq_flags Flags of the created sequence, which are combinations of * the element types and sequence types. * - Element type: * - CV_SEQ_ELTYPE_POINT: {CvPoint} * - CV_32FC2: {CvPoint2D32f} * - CV_SEQ_ELTYPE_POINT3D: {CvPoint3D32f} - * - CV_SEQ_ELTYPE_INDEX: Fixnum - * - CV_SEQ_ELTYPE_CODE: Fixnum (Freeman code) + * - CV_SEQ_ELTYPE_INDEX: Integer + * - CV_SEQ_ELTYPE_CODE: Integer (Freeman code) * - Sequence type: * - CV_SEQ_KIND_GENERIC: Generic sequence * - CV_SEQ_KIND_CURVE: Curve @@ -421,7 +421,7 @@ rb_pop(VALUE self) VALUE object = Qnil; VALUE klass = seqblock_class(seq); try { - if (klass == rb_cFixnum) { + if (klass == rb_cInteger) { int n = 0; cvSeqPop(seq, &n); object = INT2FIX(n); @@ -489,7 +489,7 @@ rb_shift(VALUE self) VALUE object = Qnil; try { - if (seqblock_class(seq) == rb_cFixnum) { + if (seqblock_class(seq) == rb_cInteger) { int n = 0; cvSeqPopFront(seq, &n); object = INT2NUM(n); @@ -525,7 +525,7 @@ rb_each(VALUE self) if (seq->total > 0) { VALUE klass = seqblock_class(seq); try { - if (klass == rb_cFixnum) + if (klass == rb_cInteger) for (int i = 0; i < seq->total; ++i) rb_yield(INT2NUM(*CV_GET_SEQ_ELEM(int, seq, i))); else @@ -567,10 +567,10 @@ rb_insert(VALUE self, VALUE index, VALUE object) Check_Type(index, T_FIXNUM); CvSeq *seq = CVSEQ(self); VALUE klass = seqblock_class(seq); - if (CLASS_OF(object) != klass) + if (!rb_obj_is_kind_of(object, klass)) rb_raise(rb_eTypeError, "arguments should be %s.", rb_class2name(klass)); try { - if (klass == rb_cFixnum) { + if (klass == rb_cInteger) { int n = NUM2INT(object); cvSeqInsert(seq, NUM2INT(index), &n); } diff --git a/ext/opencv/cvsize.cpp b/ext/opencv/cvsize.cpp index bf88a77..419e39c 100644 --- a/ext/opencv/cvsize.cpp +++ b/ext/opencv/cvsize.cpp @@ -12,7 +12,7 @@ * Document-class: OpenCV::CvSize * * This class means one size on X axis Y axis. - * X and Y takes the value of the Fixnum. + * X and Y takes the value of the Integer. * * C structure is here, very simple. * typdef struct CvSize { diff --git a/ext/opencv/cvtwopoints.cpp b/ext/opencv/cvtwopoints.cpp index cc70201..089abe4 100644 --- a/ext/opencv/cvtwopoints.cpp +++ b/ext/opencv/cvtwopoints.cpp @@ -12,7 +12,7 @@ * Document-class: OpenCV::CvTwoPoints * * This class means one twopoints on X axis Y axis. - * X and Y takes the value of the Fixnum. see also CvTwopoints2D32F + * X and Y takes the value of the Integer. see also CvTwopoints2D32F * * C structure is here, very simple. * typdef struct CvTwopoints { diff --git a/ext/opencv/iplimage.cpp b/ext/opencv/iplimage.cpp index e5998a3..adc97a0 100644 --- a/ext/opencv/iplimage.cpp +++ b/ext/opencv/iplimage.cpp @@ -193,7 +193,7 @@ rb_reset_roi(VALUE self) } /* - * Return COI as Fixnum. + * Return COI as Integer. */ VALUE rb_get_coi(VALUE self) @@ -213,7 +213,7 @@ rb_get_coi(VALUE self) * set_coi(coi) * set_coi(coi){|image| ...} * - * Set COI. coi should be Fixnum. + * Set COI. coi should be Integer. * Return self. */ VALUE diff --git a/ext/opencv/trackbar.cpp b/ext/opencv/trackbar.cpp index 360091f..2c41926 100644 --- a/ext/opencv/trackbar.cpp +++ b/ext/opencv/trackbar.cpp @@ -47,7 +47,7 @@ void trackbar_free(void *ptr) { * * Create new Trackbar. * name should be String. - * maxval and val should be Fixnum. + * maxval and val should be Integer. * When Trackbar adjuster changed, block will be called. */ VALUE rb_initialize(int argc, VALUE *argv, VALUE self) { diff --git a/test/test_cvavgcomp.rb b/test/test_cvavgcomp.rb index 2207fd5..6ba543c 100755 --- a/test/test_cvavgcomp.rb +++ b/test/test_cvavgcomp.rb @@ -18,7 +18,7 @@ class TestCvAvgComp < OpenCVTestCase end def test_neighbors - assert_equal(Fixnum, @avgcomp.neighbors.class) + assert_kind_of(Integer, @avgcomp.neighbors) end end diff --git a/test/test_cvchain.rb b/test/test_cvchain.rb index 06c543a..a1f83bb 100755 --- a/test/test_cvchain.rb +++ b/test/test_cvchain.rb @@ -42,7 +42,7 @@ class TestCvChain < OpenCVTestCase } chain = mat0.find_contours(:mode => CV_RETR_EXTERNAL, :method => CV_CHAIN_CODE) assert_equal(Array, chain.codes.class) - assert(chain.codes.all? { |a| (a.class == Fixnum) and (a >= 0 and a <= 7) }) + assert(chain.codes.all? { |a| (Integer === a) and (a >= 0 and a <= 7) }) end def test_points diff --git a/test/test_cvseq.rb b/test/test_cvseq.rb index a984282..a12c1f7 100755 --- a/test/test_cvseq.rb +++ b/test/test_cvseq.rb @@ -67,7 +67,7 @@ class TestCvSeq < OpenCVTestCase seq2 = CvSeq.new(CV_SEQ_ELTYPE_INDEX) seq2.push(10, 20, 30) - assert_equal(Fixnum, seq2[0].class) + assert_kind_of(Integer, seq2[0]) assert_equal(10, seq2[0]) assert_equal(20, seq2[1]) assert_equal(30, seq2[2]) @@ -101,7 +101,7 @@ class TestCvSeq < OpenCVTestCase seq4 = CvSeq.new(CV_SEQ_ELTYPE_INDEX).push(20, 30) seq3.push(seq4) assert_equal(3, seq3.total) - assert_equal(Fixnum, seq3[0].class) + assert_kind_of(Integer, seq3[0]) assert_equal(10, seq3[0]) assert_equal(20, seq3[1]) assert_equal(30, seq3[2])