Class: CVFFI::FAST::FASTResultsArray
- Inherits:
-
Object
- Object
- CVFFI::FAST::FASTResultsArray
- Includes:
- Enumerable
- Defined in:
- lib/opencv-ffi-fast/fast.rb
Instance Attribute Summary collapse
-
#nPoints ⇒ Object
(also: #size)
Returns the value of attribute nPoints.
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(pts, nPts) ⇒ FASTResultsArray
constructor
A new instance of FASTResultsArray.
Constructor Details
#initialize(pts, nPts) ⇒ FASTResultsArray
Returns a new instance of FASTResultsArray.
14 15 16 17 18 19 20 21 |
# File 'lib/opencv-ffi-fast/fast.rb', line 14 def initialize( pts, nPts ) @points = pts @nPoints = nPts # Define a destructor do dispose of the results destructor = Proc.new { pts.free } ObjectSpace.define_finalizer( self, destructor ) end |
Instance Attribute Details
#nPoints ⇒ Object Also known as: size
Returns the value of attribute nPoints.
12 13 14 |
# File 'lib/opencv-ffi-fast/fast.rb', line 12 def nPoints @nPoints end |
#points ⇒ Object
Returns the value of attribute points.
11 12 13 |
# File 'lib/opencv-ffi-fast/fast.rb', line 11 def points @points end |
Instance Method Details
#each ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/opencv-ffi-fast/fast.rb', line 23 def each if @nPoints > 0 0.upto(@nPoints-1) { |i| yield Xy.new( @points[i] ) } end end |