Class: Tracksperanto::Export::Equalizer4
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::Equalizer4
show all
- Defined in:
- lib/export/equalizer4.rb
Overview
Export for 3DE v4 point files. 3DE always starts frames at 1.
Instance Attribute Summary
Attributes inherited from Base
#io
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
inherited, #initialize
Methods included from ConstName
#const_name, included
#just_export
Class Method Details
.desc_and_extension ⇒ Object
5
6
7
|
# File 'lib/export/equalizer4.rb', line 5
def self.desc_and_extension
"3de_v4.txt"
end
|
.human_name ⇒ Object
9
10
11
|
# File 'lib/export/equalizer4.rb', line 9
def self.human_name
"3DE v4 point export .txt file"
end
|
Instance Method Details
#end_export ⇒ Object
38
39
40
41
42
43
|
# File 'lib/export/equalizer4.rb', line 38
def end_export
@internal_io.rewind
@io.puts(@num_of_trackers)
@io.puts(@internal_io.read)
@internal_io.close!
end
|
#end_tracker_segment ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/export/equalizer4.rb', line 30
def end_tracker_segment
@tracker_buffer.rewind
@internal_io.puts("0") @internal_io.puts(@num_of_kfs)
@internal_io.puts(@tracker_buffer.read)
@tracker_buffer.close!
end
|
#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object
25
26
27
28
|
# File 'lib/export/equalizer4.rb', line 25
def export_point(frame, abs_float_x, abs_float_y, float_residual)
@tracker_buffer.puts("%d %.15f %.15f" % [frame + 1, abs_float_x, abs_float_y])
@num_of_kfs += 1
end
|
#start_export(img_width, img_height) ⇒ Object
13
14
15
16
17
|
# File 'lib/export/equalizer4.rb', line 13
def start_export( img_width, img_height)
@internal_io, @num_of_trackers = Tracksperanto::BufferIO.new, 0
end
|
#start_tracker_segment(tracker_name) ⇒ Object
19
20
21
22
23
|
# File 'lib/export/equalizer4.rb', line 19
def start_tracker_segment(tracker_name)
@internal_io.puts(tracker_name)
@num_of_trackers += 1
@tracker_buffer, @num_of_kfs = Tracksperanto::BufferIO.new, 0
end
|