Class: IIIF::Image::Size::Height
- Inherits:
-
Object
- Object
- IIIF::Image::Size::Height
- Defined in:
- lib/iiif/image/size/height.rb
Overview
The image or region should be scaled so that its height is exactly equal to the provided parameter, and the width will be a calculated value that maintains the aspect ratio of the extracted region
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
Instance Method Summary collapse
-
#initialize(height) ⇒ Height
constructor
A new instance of Height.
- #to_s ⇒ Object
- #width_for_aspect_ratio(ratio) ⇒ Object
Constructor Details
#initialize(height) ⇒ Height
Returns a new instance of Height.
8 9 10 |
# File 'lib/iiif/image/size/height.rb', line 8 def initialize(height) @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
12 13 14 |
# File 'lib/iiif/image/size/height.rb', line 12 def height @height end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/iiif/image/size/height.rb', line 19 def to_s ",#{height}" end |
#width_for_aspect_ratio(ratio) ⇒ Object
15 16 17 |
# File 'lib/iiif/image/size/height.rb', line 15 def width_for_aspect_ratio(ratio) (ratio * height).round end |