Method: Processing::GraphicsContext#createImage
- Defined in:
- lib/processing/graphics_context.rb
#createImage(w, h) ⇒ Image #createImage(w, h, format) ⇒ Image
Creates a new image object.
3215 3216 3217 3218 3219 |
# File 'lib/processing/graphics_context.rb', line 3215 def createImage(w, h, format = RGBA) colorspace = {RGB => Rays::RGB, RGBA => Rays::RGBA}[format] raise ArgumentError, "Unknown image format" unless colorspace Image.new Rays::Image.new(w, h, colorspace).paint {background 0, 0} end |