Class: Axon::Scaler
- Inherits:
-
Object
- Object
- Axon::Scaler
- Defined in:
- lib/axon/scaler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #color_model ⇒ Object
- #components ⇒ Object
-
#initialize(image, *args) ⇒ Scaler
constructor
A new instance of Scaler.
Constructor Details
#initialize(image, *args) ⇒ Scaler
Returns a new instance of Scaler.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/axon/scaler.rb', line 5 def initialize(image, *args) @image = image if args.size == 1 init_ratio(args[0]) elsif args.size == 2 init_dims(args[0], args[1]) else raise ArgumentError, "Must give one or two arguments" end end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/axon/scaler.rb', line 3 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'lib/axon/scaler.rb', line 3 def width @width end |
Instance Method Details
#color_model ⇒ Object
21 22 23 |
# File 'lib/axon/scaler.rb', line 21 def color_model @image.color_model end |
#components ⇒ Object
17 18 19 |
# File 'lib/axon/scaler.rb', line 17 def components @image.components end |