Class: CooCoo::Image::Scale
Instance Method Summary collapse
- #call(x, y) ⇒ Object
-
#initialize(sx, sy) ⇒ Scale
constructor
A new instance of Scale.
Methods inherited from Transform
Constructor Details
#initialize(sx, sy) ⇒ Scale
Returns a new instance of Scale.
189 190 191 192 193 |
# File 'lib/coo-coo/image.rb', line 189 def initialize(sx, sy) super() @sx = sx @sy = sy || sx end |
Instance Method Details
#call(x, y) ⇒ Object
195 196 197 |
# File 'lib/coo-coo/image.rb', line 195 def call(x, y) [ (x / @sx).floor, (y / @sy).floor ] end |