Class: RComposite::Canvas

Inherits:
LayerSet show all
Defined in:
lib/rcomposite/canvas.rb

Instance Attribute Summary collapse

Attributes inherited from LayerSet

#bounding_height, #bounding_width, #layers, #max_x, #max_y, #min_x, #min_y, #name

Instance Method Summary collapse

Methods inherited from LayerSet

#add_layer, #adjustment_layer, #bounding_box, #composite_layers, #fill_layer, #flatten, #layer, #layer_set, #offset, #remove_layer, #render, #rotate, #save_as, #scale, #stack

Constructor Details

#initialize(width, height, &block) ⇒ Canvas

Returns a new instance of Canvas.



6
7
8
9
10
11
12
13
14
# File 'lib/rcomposite/canvas.rb', line 6

def initialize(width, height, &block)
  @image = Magick::Image.new width, height
  @width = width
  @height = height
  $RCompositeCanvasWidth = @width
  $RCompositeCanvasHeight = @height

  super(:canvas, &block)
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



3
4
5
# File 'lib/rcomposite/canvas.rb', line 3

def height
  @height
end

#imageObject

Returns the value of attribute image.



4
5
6
# File 'lib/rcomposite/canvas.rb', line 4

def image
  @image
end

#widthObject (readonly)

Returns the value of attribute width.



3
4
5
# File 'lib/rcomposite/canvas.rb', line 3

def width
  @width
end