Parent

Files

GD2::Canvas::Point

Attributes

x[R]
y[R]

Public Class Methods

new(x, y) click to toggle source
# File lib/gd2/canvas.rb, line 33
def initialize(x, y)
  @x, @y = x, y
end

Public Instance Methods

coordinates() click to toggle source
# File lib/gd2/canvas.rb, line 37
def coordinates
  [@x, @y]
end
draw(image, mode) click to toggle source
# File lib/gd2/canvas.rb, line 50
def draw(image, mode)
  image.set_pixel(@x, @y, mode)
end
transform(matrix) click to toggle source
# File lib/gd2/canvas.rb, line 46
def transform(matrix)
  dup.transform!(matrix)
end
transform!(matrix) click to toggle source
# File lib/gd2/canvas.rb, line 41
def transform!(matrix)
  @x, @y = (Matrix.row_vector([@x, @y, 1]) * matrix)[0, 0..1]
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.