Module: Compass::Magick::Functions::Canvas

Included in:
Compass::Magick::Functions
Defined in:
lib/magick/functions/canvas.rb

Overview

Methods for creating a new Canvas.

Instance Method Summary collapse

Instance Method Details

#magick_canvas(canvas, *commands) ⇒ String #magick_canvas(data, *commands) ⇒ String #magick_canvas(url, *commands) ⇒ String #magick_canvas(path, *commands) ⇒ String #magick_canvas(width, height, *commands) ⇒ String

Creates a new Canvas and execute all commands on the instance.

Overloads:

  • #magick_canvas(canvas, *commands) ⇒ String

    Parameters:

    • canvas (Canvas)

      Copy image from another Canvas object.

    • commands (Array<Command>)

      The list of commands to execute on new Canvas instance.

  • #magick_canvas(data, *commands) ⇒ String

    Parameters:

    • data (Sass::Script::String)

      A Base64 encoded Data URL containing the image.

    • commands (Array<Command>)

      The list of commands to execute on the Canvas instance.

  • #magick_canvas(url, *commands) ⇒ String

    Parameters:

    • url (Sass::Script::String)

      The URL to the image, relative to the stylesheet.

    • commands (Array<Command>)

      The list of commands to execute on the Canvas instance.

  • #magick_canvas(path, *commands) ⇒ String

    Parameters:

    • path (Sass::Script::String)

      The path to the image, relative to the configured generated_images_path or images_path.

    • commands (Array<Command>)

      The list of commands to execute on the Canvas instance.

  • #magick_canvas(width, height, *commands) ⇒ String

    Parameters:

    • width (Sass::Script::Number)

      The width of the new transparent Canvas.

    • height (Sass::Script::Number)

      The height of the new transparent Canvas.

    • commands (Array<Command>)

      The list of commands to execute on the Canvas instance.

Returns:

  • (String)

    A Base64 encoded PNG-24 Data URI for the generated image.



36
37
38
# File 'lib/magick/functions/canvas.rb', line 36

def magick_canvas(*commands)
  Compass::Magick::Canvas.new(*commands)
end