Sha256: a97cbe9ba070f8ea2f8d79dde60b59af3dac14e0cb768653b049c476d42030c1

Contents?: true

Size: 995 Bytes

Versions: 38

Compression:

Stored size: 995 Bytes

Contents

# Multiplexor. Accepts a number of exporters and replays 
# the calls to all of them in succession.
class Tracksperanto::Export::Mux
  attr_accessor :outputs
  
  def initialize(*outputs)
    @outputs = outputs.flatten
  end
  
  # Called on export start
  def start_export( img_width, img_height)
    @outputs.each do | output |
      output.start_export( img_width, img_height)
    end
  end

  # Called on tracker start, one for each tracker
  def start_tracker_segment(tracker_name)
    @outputs.each do | output |
      output.start_tracker_segment(tracker_name)
    end
  end
  
  def end_tracker_segment
    @outputs.each do | output |
      output.end_tracker_segment
    end
  end
  
  # Called for each tracker keyframe
  def export_point(at_frame_i, abs_float_x, abs_float_y, float_residual)
    @outputs.each do | output |
      output.export_point(at_frame_i, abs_float_x, abs_float_y, float_residual)
    end
  end
  
  def end_export
    @outputs.each{|o| o.end_export }
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
tracksperanto-2.1.0 lib/export/mux.rb
tracksperanto-2.0.2 lib/export/mux.rb
tracksperanto-2.0.1 lib/export/mux.rb
tracksperanto-2.0.0 lib/export/mux.rb
tracksperanto-1.9.9 lib/export/mux.rb
tracksperanto-1.9.8 lib/export/mux.rb
tracksperanto-1.9.6 lib/export/mux.rb
tracksperanto-1.9.5 lib/export/mux.rb
tracksperanto-1.9.4 lib/export/mux.rb
tracksperanto-1.9.3 lib/export/mux.rb
tracksperanto-1.9.2 lib/export/mux.rb
tracksperanto-1.9.1 lib/export/mux.rb
tracksperanto-1.9.0 lib/export/mux.rb
tracksperanto-1.8.4 lib/export/mux.rb
tracksperanto-1.8.2 lib/export/mux.rb
tracksperanto-1.8.1 lib/export/mux.rb
tracksperanto-1.8.0 lib/export/mux.rb
tracksperanto-1.7.5 lib/export/mux.rb
tracksperanto-1.7.4 lib/export/mux.rb
tracksperanto-1.7.3 lib/export/mux.rb