Class: Tracksperanto::Middleware::Base
- Inherits:
-
Object
- Object
- Tracksperanto::Middleware::Base
- Defined in:
- lib/middleware/base.rb
Overview
The base middleware class works just like a Tracksperanto::Export::Base, but it only wraps another exporting object and does not get registered on it’s own as an export format. Middleware can be used to massage the tracks being exported in various interesting ways - like moving the coordinates, clipping the keyframes, scaling the whole export or even reversing the trackers to go backwards
Instance Method Summary collapse
-
#end_export ⇒ Object
Called on export end.
-
#end_tracker_segment ⇒ Object
Called on tracker end.
-
#export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) ⇒ Object
Called for each tracker keyframe.
-
#initialize(exporter, *args_for_block_init) ⇒ Base
constructor
A new instance of Base.
-
#start_export(img_width, img_height) ⇒ Object
Called on export start.
-
#start_tracker_segment(tracker_name) ⇒ Object
Called on tracker start, one for each tracker.
Methods included from Casts
#cast_to_float, #cast_to_int, #cast_to_string, included
Constructor Details
#initialize(exporter, *args_for_block_init) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/middleware/base.rb', line 8 def initialize(exporter, *args_for_block_init) @exporter = exporter super(*args_for_block_init) end |
Instance Method Details
#end_export ⇒ Object
Called on export end
19 20 21 |
# File 'lib/middleware/base.rb', line 19 def end_export @exporter.end_export end |
#end_tracker_segment ⇒ Object
Called on tracker end
30 31 32 |
# File 'lib/middleware/base.rb', line 30 def end_tracker_segment @exporter.end_tracker_segment end |
#export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) ⇒ Object
Called for each tracker keyframe
35 36 37 |
# File 'lib/middleware/base.rb', line 35 def export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) @exporter.export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) end |
#start_export(img_width, img_height) ⇒ Object
Called on export start
14 15 16 |
# File 'lib/middleware/base.rb', line 14 def start_export( img_width, img_height) @exporter.start_export(img_width, img_height) end |
#start_tracker_segment(tracker_name) ⇒ Object
Called on tracker start, one for each tracker. Start of the next tracker signifies that the previous tracker has passed by
25 26 27 |
# File 'lib/middleware/base.rb', line 25 def start_tracker_segment(tracker_name) @exporter.start_tracker_segment(tracker_name) end |