Sha256: 17da39ff7a9da65468b26ff4035db76abbefbb3bd8a37b3a63d7cd47ac730d2f

Contents?: true

Size: 977 Bytes

Versions: 14

Compression:

Stored size: 977 Bytes

Contents

# Multiplexor. Does not inherit Base so that it does not get used as a translator
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

14 entries across 14 versions & 1 rubygems

Version Path
tracksperanto-1.5.2 lib/export/mux.rb
tracksperanto-1.5.1 lib/export/mux.rb
tracksperanto-1.5.0 lib/export/mux.rb
tracksperanto-1.4.0 lib/export/mux.rb
tracksperanto-1.2.6 lib/export/mux.rb
tracksperanto-1.3.1 lib/export/mux.rb
tracksperanto-1.3.0 lib/export/mux.rb
tracksperanto-1.2.4 lib/export/mux.rb
tracksperanto-1.2.3 lib/export/mux.rb
tracksperanto-1.2.2 lib/export/mux.rb
tracksperanto-1.2.1 lib/export/mux.rb
tracksperanto-1.2.0 lib/export/mux.rb
tracksperanto-1.1.1 lib/export/mux.rb
tracksperanto-1.1.0 lib/export/mux.rb