Class: CooCoo::Image::Translate
- Defined in:
- lib/coo-coo/image.rb
Instance Method Summary collapse
- #call(x, y) ⇒ Object
-
#initialize(tx, ty) ⇒ Translate
constructor
A new instance of Translate.
Methods inherited from Transform
Constructor Details
#initialize(tx, ty) ⇒ Translate
Returns a new instance of Translate.
177 178 179 180 181 |
# File 'lib/coo-coo/image.rb', line 177 def initialize(tx, ty) super() @tx = tx @ty = ty end |
Instance Method Details
#call(x, y) ⇒ Object
183 184 185 |
# File 'lib/coo-coo/image.rb', line 183 def call(x, y) [ x - @tx, y - @ty ] end |