Class: CVFFI::FAST::FASTResultsArray

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/opencv-ffi-fast/fast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nPointsObject 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

#pointsObject

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

#eachObject



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