Class: Knossos::Renderer::PNGAdapter::Image
- Inherits:
-
Object
- Object
- Knossos::Renderer::PNGAdapter::Image
- Defined in:
- lib/knossos/renderer/png_adapter.rb
Instance Method Summary collapse
-
#initialize(width, height, color) ⇒ Image
constructor
A new instance of Image.
- #line(x0, y0, x1, y1, color) ⇒ Object
- #save(filename) ⇒ Object
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 |