Class: Tracksperanto::Export::ShakeText
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::ShakeText
show all
- Defined in:
- lib/export/shake_text.rb
Overview
Export for Shake .txt tracker blobs
Constant Summary
collapse
- PREAMBLE =
"TrackName %s\n Frame X Y Correlation\n"
- POSTAMBLE =
"\n"
- TEMPLATE =
" %.2f %.3f %.3f %.3f"
Instance Attribute Summary
Attributes inherited from Base
#io
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#end_export, #initialize, #start_export
Methods included from ConstName
#const_name
#just_export
Class Method Details
.desc_and_extension ⇒ Object
7
8
9
|
# File 'lib/export/shake_text.rb', line 7
def self.desc_and_extension
"shake_trackers.txt"
end
|
.human_name ⇒ Object
11
12
13
|
# File 'lib/export/shake_text.rb', line 11
def self.human_name
"Shake trackers in a .txt file"
end
|
Instance Method Details
#end_tracker_segment ⇒ Object
19
20
21
|
# File 'lib/export/shake_text.rb', line 19
def end_tracker_segment
@io.puts POSTAMBLE
end
|
#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object
23
24
25
26
27
|
# File 'lib/export/shake_text.rb', line 23
def export_point(frame, abs_float_x, abs_float_y, float_residual)
line = TEMPLATE % [frame + 1, abs_float_x, abs_float_y, 1 - float_residual]
@io.puts line
end
|
#start_tracker_segment(tracker_name) ⇒ Object
15
16
17
|
# File 'lib/export/shake_text.rb', line 15
def start_tracker_segment(tracker_name)
@io.puts PREAMBLE % tracker_name
end
|