Methods

Included Modules

Fractals::Renderers::JRubyRenderer

Renders fractals using native Java libraries.

Public Instance Methods

write(file_path='fractal.png') click to toggle source

Writes the image to the specified file path.

# File lib/fractals/renderers.rb, line 171
      def write(file_path='fractal.png')
        import java.awt.image.BufferedImage
        import javax.imageio.ImageIO

        buffered_image = BufferedImage.new(@width, @height, BufferedImage::TYPE_INT_RGB)
        render do |x, y, color|
          buffered_image.setRGB(x, y, to_rgb(color))
        end

        ImageIO.write(buffered_image, file_path.split('.').last, java.io.File.new(file_path))
      end

Private Instance Methods

to_rgb(color) click to toggle source

(Not documented)

# File lib/fractals/renderers.rb, line 184
      def to_rgb(color)
        (color[0] << 16) + (color[1] << 8) + color[2]
      end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.