Class: CVFFI::Point
- Inherits:
-
Object
- Object
- CVFFI::Point
- Includes:
- CvPointCastMethods, CvPointMethods
- Defined in:
- lib/opencv-ffi-wrappers/core/point.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#w ⇒ Object
Returns the value of attribute w.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #area ⇒ Object
-
#initialize(*args) ⇒ Point
constructor
A new instance of Point.
Methods included from CvPointMethods
#*, #+, #-, #/, #==, #===, #got_what_i_need, #l2_squared_distance, #l2distance, #neighbor?, #neighbor_rsquared?, #rotate, #to_Vector, #to_a
Methods included from CvPointCastMethods
#to_CvPoint, #to_CvPoint2D32f, #to_CvPoint2D64f, #to_Point, #to_a
Constructor Details
#initialize(*args) ⇒ Point
Returns a new instance of Point.
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 132 def initialize( *args ) if args.length == 2 and args[1] != nil @x = args[0] @y = args[1] else args = args.shift case args when Hash @y = args[:y] @x = args[:x] when Array @x = args[0] @y = args[1] else @x = args.x @y = args.y end end @x = @x.to_f @y = @y.to_f @w = 1 end |
Instance Attribute Details
#w ⇒ Object
Returns the value of attribute w.
130 131 132 |
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 130 def w @w end |
#x ⇒ Object
Returns the value of attribute x.
130 131 132 |
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 130 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
130 131 132 |
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 130 def y @y end |
Instance Method Details
#area ⇒ Object
157 158 159 |
# File 'lib/opencv-ffi-wrappers/core/point.rb', line 157 def area @y*@x end |