| Module | Fractals::Renderers::PNGRenderer |
| In: |
lib/fractals/renderers.rb
|
Renders fractals using the PNG library. PNGRenderer is the default renderer.
Returns the fractal image as a BLOB.
# File lib/fractals/renderers.rb, line 104 def to_blob() canvas = PNG::Canvas.new(@width, @height) render do |x, y, color| canvas[x, (y - @height).abs - 1] = PNG::Color.new(color[0], color[1], color[2], 255) end PNG.new(canvas).to_blob end