Class: Imogen::AutoCrop::Box::Center
- Inherits:
-
Object
- Object
- Imogen::AutoCrop::Box::Center
- Defined in:
- lib/imogen/auto_crop/box.rb
Instance Method Summary collapse
- #box ⇒ Object
-
#initialize(grayscale) ⇒ Center
constructor
A new instance of Center.
Constructor Details
#initialize(grayscale) ⇒ Center
Returns a new instance of Center.
56 57 58 59 60 |
# File 'lib/imogen/auto_crop/box.rb', line 56 def initialize(grayscale) @center ||= [(grayscale.cols/2).floor, (grayscale.rows/2).floor] @radius = @center.min @ratio = @radius / @center.max end |