Class: WSLight::Animation::FadeAnimation

Inherits:
BaseAnimation show all
Defined in:
lib/ws_light/animation/fade_animation.rb

Overview

Slides from one set to another from left to right (obviously depending on the hardware setup)

Constant Summary collapse

FADE_DURATION =
50

Instance Attribute Summary

Attributes inherited from BaseAnimation

#set_from, #set_to, #type

Instance Method Summary collapse

Methods inherited from BaseAnimation

#frame_data, #initialize

Constructor Details

This class inherits a constructor from WSLight::Animation::BaseAnimation

Instance Method Details

#frame(count) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ws_light/animation/fade_animation.rb', line 13

def frame(count)
  set = []

  @set_from.next_frame
  @set_to.next_frame

  @set_from.full_length.times do |i|
    set << @set_from.pixel(i).mix(@set_to.pixel(i), count.to_f/FADE_DURATION.to_f)
  end

  set
end

#framesObject



9
10
11
# File 'lib/ws_light/animation/fade_animation.rb', line 9

def frames
  FADE_DURATION + 1
end

#frames_per_secondObject



26
27
28
# File 'lib/ws_light/animation/fade_animation.rb', line 26

def frames_per_second
  nil
end