Class: FaceCrop::Detector::Region
- Inherits:
-
Object
- Object
- FaceCrop::Detector::Region
- Defined in:
- lib/face_crop.rb
Overview
Region
Instance Attribute Summary collapse
-
#center ⇒ Object
Returns the value of attribute center.
-
#color ⇒ Object
Returns the value of attribute color.
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #bottom_right ⇒ Object
-
#initialize(x, y, width, height) ⇒ Region
constructor
A new instance of Region.
- #to_s ⇒ Object
- #top_left ⇒ Object
Constructor Details
Instance Attribute Details
#center ⇒ Object
Returns the value of attribute center.
54 55 56 |
# File 'lib/face_crop.rb', line 54 def center @center end |
#color ⇒ Object
Returns the value of attribute color.
57 58 59 |
# File 'lib/face_crop.rb', line 57 def color @color end |
#height ⇒ Object
Returns the value of attribute height.
56 57 58 |
# File 'lib/face_crop.rb', line 56 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
55 56 57 |
# File 'lib/face_crop.rb', line 55 def width @width end |
Instance Method Details
#bottom_right ⇒ Object
68 69 70 |
# File 'lib/face_crop.rb', line 68 def bottom_right @bottom_right ||= Point.new(@center.x + (width / 2), @center.y + (height / 2)) end |
#to_s ⇒ Object
72 73 74 |
# File 'lib/face_crop.rb', line 72 def to_s "#{center.x},#{center.y}-#{width}x#{height}" end |