Class: Teaas::Fire

Inherits:
Object
  • Object
show all
Defined in:
lib/teaas/fire.rb

Class Method Summary collapse

Class Method Details

.fire(original_img) ⇒ Magick::ImageList

Takes in an image, and adds flames to it. Best when used with Turboize.turbo to generate multiple rotation speeds.

Parameters:

  • original_img (Magick::ImageList)

    The image to be engufled in flames

Returns:

  • (Magick::ImageList)

    The image, now on fire



7
8
9
# File 'lib/teaas/fire.rb', line 7

def self.fire(original_img)
  Overlayer.overlay(original_img, Magick::ImageList.new(Teaas.root + "/img/fire.gif"))
end

.fire_from_file(path) ⇒ Magick::ImageList

Takes in a path to an image, and adds flames to it. Best when used with Turboize.turbo to generate multiple rotation speeds. This is a wrapper around Blood.blood

Parameters:

  • path (String)

    Path to the image to be engulfed in flames

Returns:

  • (Magick::ImageList)

    The image, now on fire



15
16
17
18
19
20
21
22
23
# File 'lib/teaas/fire.rb', line 15

def self.fire_from_file(path)
  img = Magick::ImageList.new

  # Grab the first element in array to prevent strange things when an
  # animated image is submitted
  img.read(path)[0]

  fire(img)
end