class ChunkyPNG::Canvas

def initialize(width, height, initial = ChunkyPNG::Color::TRANSPARENT)

Parameters:
  • initial (ChunkyPNG::Pixel, Array) -- The initial value of te pixels:
  • width (Integer) -- The height in pixels of this canvas
  • width (Integer) -- The width in pixels of this canvas
def initialize(width, height, initial = ChunkyPNG::Color::TRANSPARENT)
  @width, @height = width, height
  if initial.kind_of?(Array) && initial.length == width * height
    @pixels = initial
  else
    @pixels = Array.new(width * height, ChunkyPNG::Color(initial))
  end
end