Class: Axon::Scaler

Inherits:
Object
  • Object
show all
Defined in:
lib/axon/scaler.rb

Direct Known Subclasses

BilinearScaler, NearestNeighborScaler

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject (readonly)

Returns the value of attribute height.



3
4
5
# File 'lib/axon/scaler.rb', line 3

def height
  @height
end

#widthObject (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_modelObject



21
22
23
# File 'lib/axon/scaler.rb', line 21

def color_model
  @image.color_model
end

#componentsObject



17
18
19
# File 'lib/axon/scaler.rb', line 17

def components
  @image.components
end