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
inherited, #initialize
Methods included from ConstName
#const_name, included
#just_export
Class Method Details
.desc_and_extension ⇒ Object
7
8
9
|
# File 'lib/export/flame_stabilizer_2014.rb', line 7
def self.desc_and_extension
"flamesmoke2014.stabilizer"
end
|
.human_name ⇒ Object
11
12
13
|
# File 'lib/export/flame_stabilizer_2014.rb', line 11
def self.human_name
"Flame/Smoke 2D Stabilizer setup (v. 2014 and above)"
end
|
Instance Method Details
#end_export ⇒ Object
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
54
|
# File 'lib/export/flame_stabilizer_2014.rb', line 23
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
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/export/flame_stabilizer_2014.rb', line 73
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
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/export/flame_stabilizer_2014.rb', line 61
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
15
16
17
18
19
20
21
|
# File 'lib/export/flame_stabilizer_2014.rb', line 15
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
56
57
58
59
|
# File 'lib/export/flame_stabilizer_2014.rb', line 56
def start_tracker_segment(tracker_name)
@counter += 1
@write_first_frame = true
end
|