Class: Tracksperanto::Middleware::Shift

Inherits:
Base
  • Object
show all
Defined in:
lib/middleware/shift.rb

Overview

This middleware moves the keyframs by a preset number of pixels

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#end_export, #end_tracker_segment, #initialize, #start_export, #start_tracker_segment

Methods included from BlockInit

#initialize

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_shiftObject

Returns the value of attribute x_shift.



3
4
5
# File 'lib/middleware/shift.rb', line 3

def x_shift
  @x_shift
end

#y_shiftObject

Returns the value of attribute y_shift.



3
4
5
# File 'lib/middleware/shift.rb', line 3

def y_shift
  @y_shift
end

Instance Method Details

#export_point(frame, float_x, float_y, float_residual) ⇒ Object



6
7
8
# File 'lib/middleware/shift.rb', line 6

def export_point(frame, float_x, float_y, float_residual)
  super(frame, float_x + (@x_shift || 0), float_y + (@y_shift || 0), float_residual)
end