Renders fractals using the RMagick library.
Returns the fractal image as a BLOB of the specified file format.
mandelbrot = Mandelbrot.new
mandelbrot.renderer = Renderers::RMagickRenderer
blob =
mandelbrot.to_blob(‘jpg’)
# File lib/fractals/renderers.rb, line 149 def to_blob(file_format) image = Magick::Image.new(@width, @height) render do |x, y, color| image.pixel_color(x, y, "rgb(#{color.join(',')})") end image.to_blob { self.format = file_format; self.quality = 100 } end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.