Class: Magick::RVG::Image

Inherits:
Object
  • Object
show all
Includes:
Describable, Duplicatable, PreserveAspectRatio, Stylable, Transformable
Defined in:
lib/rvg/embellishable.rb

Overview

class Polyline

Instance Attribute Summary

Attributes included from Describable

#desc, #metadata, #title

Instance Method Summary collapse

Methods included from Duplicatable

#deep_copy

Methods included from PreserveAspectRatio

#preserve_aspect_ratio

Methods included from Transformable

#matrix, #rotate, #scale, #skewX, #skewY, #translate

Methods included from Stylable

#styles

Constructor Details

#initialize(image, width = nil, height = nil, x = 0, y = 0) ⇒ Image

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

Raises:

  • (ArgumentError)


220
221
222
223
224
225
226
227
# File 'lib/rvg/embellishable.rb', line 220

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)
  raise ArgumentError, 'width, height must be >= 0' if @width < 0 || @height < 0

  init_viewbox
end