class Magick::RVG::Image

Public Class Methods

new(image, width = nil, height = nil, x = 0, y = 0) click to toggle source

Composite a raster image in the viewport defined by [x,y] and width and height. Use the Magick::RVG::ImageConstructors#image method to create Text objects in a container.

Calls superclass method Magick::RVG::Transformable.new
# File lib/rvg/embellishable.rb, line 222
def initialize(image, width = nil, height = nil, x = 0, y = 0)
  super()             # run module initializers
  @image = image.copy # use a copy of the image in case app. re-uses the argument
  @x, @y, @width, @height = Magick::RVG.convert_to_float(x, y, width || @image.columns, height || @image.rows)
  if @width < 0 || @height < 0
    fail ArgumentError, 'width, height must be >= 0'
  end
  init_viewbox
end