class MovieMasher::FilterSourceColor

simple color source

Public Class Methods

new(duration, color) click to toggle source
Calls superclass method MovieMasher::FilterSource.new
# File lib/graphs/filters.rb, line 301
def initialize(duration, color)
  __raise_unless(duration, 'FilterSourceColor with no duration')
  __raise_unless(color, 'FilterSourceColor with no color')
  # we don't know dimensions yet
  super('color', { color: Graph.color_value(color), duration: duration })
end

Public Instance Methods

filter_command(scope) click to toggle source
# File lib/graphs/filters.rb, line 290
def filter_command(scope)
  output = scope[:mm_output]
  __raise_unless(output[:dimensions], "#{filter_name} with no dimensions")
  # __raise_unless(output[:video_rate], "#{filter_name} with no video_rate")
  @dimensions = @hash[:size] = output[:dimensions]
  @hash[:rate] = output[:video_rate] || 1
  super
end
filter_name() click to toggle source
# File lib/graphs/filters.rb, line 298
def filter_name
  "#{super} #{@hash[:color]} #{@dimensions}"
end