lib/tracksperanto/keyframe.rb in tracksperanto-2.8.6 vs lib/tracksperanto/keyframe.rb in tracksperanto-2.9.0
- old
+ new
@@ -1,15 +1,15 @@
+# -*- encoding : utf-8 -*-
# Internal representation of a keyframe, that carries info on the frame location in the clip, x y and residual.
#
# Franme numbers are zero-based (frame 0 is first frame of the clip).
# X-coordinate (abs_x) is absolute pixels from lower left corner of the comp to the right
# Y-coordinate (abs_y) is absolute pixels from lower left corner of the comp up
# Residual is how far in pixels the tracker strolls away, and is the inverse of
# correlation (with total correlation of one the residual excursion becomes zero).
class Tracksperanto::Keyframe
- include Tracksperanto::Casts
- include Tracksperanto::BlockInit
+ include Tracksperanto::Casts, Tracksperanto::BlockInit, Comparable
# Absolute integer frame where this keyframe is placed, 0 based
attr_accessor :frame
# Absolute float X value of the point, zero is lower left
@@ -27,8 +27,8 @@
def inspect
'#< %.1fx%.1f @%d ~%.2f) >' % [abs_x, abs_y, frame, residual]
end
def <=>(another)
- frame <=> another.frame
+ [frame, abs_x, abs_y, residual] <=> [another.frame, another.abs_x, another.abs_y, another.residual]
end
-end
\ No newline at end of file
+end