Class: Tracksperanto::Export::FlameStabilizer
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::FlameStabilizer
show all
- Defined in:
- lib/export/flame_stabilizer.rb
Overview
TODO: this exporter is MAJORLY slow now
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
7
8
9
|
# File 'lib/export/flame_stabilizer.rb', line 7
def self.desc_and_extension
"flame.stabilizer"
end
|
.human_name ⇒ Object
11
12
13
|
# File 'lib/export/flame_stabilizer.rb', line 11
def self.human_name
"Flame/Smoke 2D Stabilizer setup"
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
|
# File 'lib/export/flame_stabilizer.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
@counter.times do |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
end
end
@writer.write_loose!("end")
end
|
#end_tracker_segment ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/export/flame_stabilizer.rb', line 67
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
57
58
59
60
61
62
63
64
65
|
# File 'lib/export/flame_stabilizer.rb', line 57
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)
@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
|
# File 'lib/export/flame_stabilizer.rb', line 15
def start_export( img_width, img_height)
@counter = 0
@width, @height = img_width, img_height
@temp = Tracksperanto::BufferIO.new
@writer = FlameChannelParser::Builder.new(@temp)
end
|
#start_tracker_segment(tracker_name) ⇒ Object
52
53
54
55
|
# File 'lib/export/flame_stabilizer.rb', line 52
def start_tracker_segment(tracker_name)
@counter += 1
@write_first_frame = true
end
|