Class: Teaas::Pulse
- Inherits:
-
Object
- Object
- Teaas::Pulse
- Defined in:
- lib/teaas/pulse.rb
Class Method Summary collapse
-
.pulse(original_img) ⇒ Magick::ImageList
This is a snapshot of a broken version of Spin that creates a cool pulsing image.
-
.pulse_from_file(path) ⇒ Magick::ImageList
This is a snapshot of a broken version of Spin that creates a cool pulsing image.
Class Method Details
.pulse(original_img) ⇒ Magick::ImageList
This is a snapshot of a broken version of Spin that creates a cool pulsing image.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/teaas/pulse.rb', line 8 def self.pulse(original_img) pulsing_image = Magick::ImageList.new img = Teaas::Helper.prepare_for_animation(original_img) increment = 360 / 8 8.times do |i| pulsing_image << img.rotate(increment * i+1).resize_to_fill(original_img.columns, original_img.rows) end pulsing_image end |
.pulse_from_file(path) ⇒ Magick::ImageList
This is a snapshot of a broken version of Spin that creates a cool pulsing image.
25 26 27 28 29 30 31 32 33 |
# File 'lib/teaas/pulse.rb', line 25 def self.pulse_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] pulse(img) end |