Class: CVFFI::Sequence
- Inherits:
-
Object
- Object
- CVFFI::Sequence
- Includes:
- Enumerable
- Defined in:
- lib/opencv-ffi-wrappers/sequence.rb
Instance Attribute Summary collapse
-
#seq ⇒ Object
Returns the value of attribute seq.
Instance Method Summary collapse
- #[](i) ⇒ Object
- #each ⇒ Object
-
#initialize(seq) ⇒ Sequence
constructor
A new instance of Sequence.
- #push(a) ⇒ Object
- #size ⇒ Object (also: #length)
Methods included from Enumerable
Constructor Details
Instance Attribute Details
#seq ⇒ Object
Returns the value of attribute seq.
9 10 11 |
# File 'lib/opencv-ffi-wrappers/sequence.rb', line 9 def seq @seq end |
Instance Method Details
#[](i) ⇒ Object
31 32 33 |
# File 'lib/opencv-ffi-wrappers/sequence.rb', line 31 def [](i) CVFFI::cvGetSeqElem( @seq, i ) end |
#each ⇒ Object
16 17 18 19 20 |
# File 'lib/opencv-ffi-wrappers/sequence.rb', line 16 def each size.times { |i| yield CVFFI::cvGetSeqElem( @seq, i ) } end |
#push(a) ⇒ Object
22 23 24 |
# File 'lib/opencv-ffi-wrappers/sequence.rb', line 22 def push( a ) CVFFI::cvSeqPush( @seq, a ) end |
#size ⇒ Object Also known as: length
26 27 28 |
# File 'lib/opencv-ffi-wrappers/sequence.rb', line 26 def size @seq.total end |