Class: Tracksperanto::Export::Mux

Inherits:
Object
  • Object
show all
Defined in:
lib/export/mux.rb

Overview

Multiplexor. Does not inherit Base so that it does not get used as a translator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*outputs) ⇒ Mux

Returns a new instance of Mux.



5
6
7
# File 'lib/export/mux.rb', line 5

def initialize(*outputs)
  @outputs = outputs.flatten
end

Instance Attribute Details

#outputsObject

Returns the value of attribute outputs.



3
4
5
# File 'lib/export/mux.rb', line 3

def outputs
  @outputs
end

Instance Method Details

#end_exportObject



36
37
38
# File 'lib/export/mux.rb', line 36

def end_export
  @outputs.each{|o| o.end_export }
end

#end_tracker_segmentObject



23
24
25
26
27
# File 'lib/export/mux.rb', line 23

def end_tracker_segment
  @outputs.each do | output |
    output.end_tracker_segment
  end
end

#export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) ⇒ Object

Called for each tracker keyframe



30
31
32
33
34
# File 'lib/export/mux.rb', line 30

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

#start_export(img_width, img_height) ⇒ Object

Called on export start



10
11
12
13
14
# File 'lib/export/mux.rb', line 10

def start_export( img_width, img_height)
  @outputs.each do | output |
    output.start_export( img_width, img_height)
  end
end

#start_tracker_segment(tracker_name) ⇒ Object

Called on tracker start, one for each tracker



17
18
19
20
21
# File 'lib/export/mux.rb', line 17

def start_tracker_segment(tracker_name)
  @outputs.each do | output |
    output.start_tracker_segment(tracker_name)
  end
end