Class: Tracksperanto::Middleware::Scaler
- Defined in:
- lib/middleware/scaler.rb
Overview
Scales the comp being exported by a specific factor, together with the tracker keyframes
Constant Summary collapse
- DEFAULT_FACTOR =
1
Instance Attribute Summary collapse
-
#x_factor ⇒ Object
Returns the value of attribute x_factor.
-
#y_factor ⇒ Object
Returns the value of attribute y_factor.
Instance Method Summary collapse
- #export_point(frame, float_x, float_y, float_residual) ⇒ Object
-
#start_export(img_width, img_height) ⇒ Object
Called on export start.
Methods inherited from Base
#end_export, #end_tracker_segment, inherited, #initialize, #start_tracker_segment
Methods included from SimpleExport
Methods included from ConstName
Methods included from BlockInit
Methods included from Casts
#cast_to_float, #cast_to_int, #cast_to_string, included
Constructor Details
This class inherits a constructor from Tracksperanto::Middleware::Base
Instance Attribute Details
#x_factor ⇒ Object
Returns the value of attribute x_factor.
5 6 7 |
# File 'lib/middleware/scaler.rb', line 5 def x_factor @x_factor end |
#y_factor ⇒ Object
Returns the value of attribute y_factor.
5 6 7 |
# File 'lib/middleware/scaler.rb', line 5 def y_factor @y_factor end |
Instance Method Details
#export_point(frame, float_x, float_y, float_residual) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/middleware/scaler.rb', line 22 def export_point(frame, float_x, float_y, float_residual) super(frame, (float_x * x_factor), (float_y * y_factor), (float_residual * @residual_factor) ) end |
#start_export(img_width, img_height) ⇒ Object
Called on export start
9 10 11 12 |
# File 'lib/middleware/scaler.rb', line 9 def start_export( img_width, img_height) set_residual_factor super( (img_width * x_factor).to_i, (img_height * y_factor).to_i) end |