Class: CooCoo::Image::Translate

Inherits:
Transform show all
Defined in:
lib/coo-coo/image.rb

Instance Method Summary collapse

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