Class: Knossos::Renderer::PNGAdapter::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/knossos/renderer/png_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(width, height, color) ⇒ Image

Returns a new instance of Image.



7
8
9
# File 'lib/knossos/renderer/png_adapter.rb', line 7

def initialize(width, height, color)
  @image = ChunkyPNG::Image.new(width, height, color)
end

Instance Method Details

#line(x0, y0, x1, y1, color) ⇒ Object



11
12
13
# File 'lib/knossos/renderer/png_adapter.rb', line 11

def line(x0, y0, x1, y1, color)
  image.line(x0, y0, x1, y1, color)
end

#save(filename) ⇒ Object



15
16
17
# File 'lib/knossos/renderer/png_adapter.rb', line 15

def save(filename)
  image.save(filename)
end