Class: Tracksperanto::Export::FlameStabilizer2014
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::FlameStabilizer2014
show all
- Defined in:
- lib/export/flame_stabilizer_2014.rb
Constant Summary
collapse
- COLOR =
"50 50 50"
- DATETIME_FORMAT =
'%a %b %d %H:%M:%S %Y'
Instance Attribute Summary
Attributes inherited from Base
#io
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Methods included from ConstName
#const_name
#just_export
Class Method Details
.desc_and_extension ⇒ Object
6
7
8
|
# File 'lib/export/flame_stabilizer_2014.rb', line 6
def self.desc_and_extension
"flamesmoke2014.stabilizer"
end
|
.human_name ⇒ Object
10
11
12
|
# File 'lib/export/flame_stabilizer_2014.rb', line 10
def self.human_name
"Flame/Smoke 2D Stabilizer setup (v. 2014 and above)"
end
|
Instance Method Details
#end_export ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/export/flame_stabilizer_2014.rb', line 22
def end_export
@writer = FlameChannelParser::Builder.new(@io)
(@counter)
@temp.rewind
@io.write(@temp.read) until @temp.eof?
@temp.close!
@writer.channel_end
@first_ref_frames.each_with_index do | ref_frame, i|
@writer.write_unterminated_block!("tracker", i) do |t|
t.active true
t.color_hash!("colour", 0, 100, 0)
t.fixed_ref true
t.fixed_x false
t.fixed_y false
t.tolerance 100
t.offsets_x 0
t.offsets_y 0
t.first_ref_frame ref_frame
end
end
@writer.write_loose!("end")
end
|
#end_tracker_segment ⇒ Object
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/export/flame_stabilizer_2014.rb', line 72
def end_tracker_segment
write_shift_channel("shift/x", @x_shift_values)
write_shift_channel("shift/y", @y_shift_values)
write_offset_channels
end
|
#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/export/flame_stabilizer_2014.rb', line 60
def export_point(frame, abs_float_x, abs_float_y, float_residual)
flame_frame = frame + 1
if @write_first_frame
export_first_point(flame_frame, abs_float_x, abs_float_y)
@first_ref_frames << flame_frame
@write_first_frame = false
else
export_remaining_point(flame_frame, abs_float_x, abs_float_y)
end
end
|
#start_export(img_width, img_height) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/export/flame_stabilizer_2014.rb', line 14
def start_export( img_width, img_height)
@counter = 0
@first_ref_frames = []
@width, @height = img_width, img_height
@temp = Tracksperanto::BufferIO.new
@writer = FlameChannelParser::Builder.new(@temp)
end
|
#start_tracker_segment(tracker_name) ⇒ Object
55
56
57
58
|
# File 'lib/export/flame_stabilizer_2014.rb', line 55
def start_tracker_segment(tracker_name)
@counter += 1
@write_first_frame = true
end
|