Module: CVFFI::CvPointCastMethods

Included in:
CvPointBase, Point
Defined in:
lib/opencv-ffi-wrappers/core/point.rb

Instance Method Summary collapse

Instance Method Details

#to_a(homogeneous = true) ⇒ Object



108
109
110
111
112
113
114
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 108

def to_a(homogeneous=true)
  if homogeneous
    [ x, y, 1 ]
  else
    [x,y]
  end
end

#to_CvPointObject



100
101
102
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 100

def to_CvPoint
  CvPoint.new( :x => x.to_i, :y => y.to_i )
end

#to_CvPoint2D32fObject



96
97
98
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 96

def to_CvPoint2D32f
  CvPoint2D32f.new( :x => x, :y => y )
end

#to_CvPoint2D64fObject



92
93
94
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 92

def to_CvPoint2D64f
  CvPoint2D64f.new( :x => x, :y => y )
end

#to_PointObject



104
105
106
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 104

def to_Point
  Point.new( x, y )
end