Class: Tracksperanto::Export::PFTrack4
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::PFTrack4
show all
- Defined in:
- lib/export/pftrack.rb
Overview
Export for PFTrack .2dt files
Constant Summary
collapse
- KEYFRAME_TEMPLATE =
"%s %.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, inherited, #initialize, #start_export
#just_export
Methods included from ConstName
#const_name, included
Class Method Details
.desc_and_extension ⇒ Object
6
7
8
|
# File 'lib/export/pftrack.rb', line 6
def self.desc_and_extension
"pftrack_v4.2dt"
end
|
.human_name ⇒ Object
10
11
12
|
# File 'lib/export/pftrack.rb', line 10
def self.human_name
"PFTrack v4 .2dt file"
end
|
Instance Method Details
#end_tracker_segment ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/export/pftrack.rb', line 20
def end_tracker_segment
block = [ "\n",
@tracker_name.inspect, @prev_tracker.length,
@prev_tracker.join("\n") ]
@io.puts block.join("\n")
end
|
#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object
28
29
30
31
|
# File 'lib/export/pftrack.rb', line 28
def export_point(frame, abs_float_x, abs_float_y, float_residual)
line = KEYFRAME_TEMPLATE % [frame, abs_float_x, abs_float_y, float_residual / 8]
@prev_tracker << line
end
|
#start_tracker_segment(tracker_name) ⇒ Object
14
15
16
17
18
|
# File 'lib/export/pftrack.rb', line 14
def start_tracker_segment(tracker_name)
@prev_tracker = []
@tracker_name = tracker_name
end
|