Sha256: de6920425ef7127fb95363de1a3f94fbc42dc5e694dbca5cbe2a99f67ecceb76

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

# Internal representation of a keyframe, that carries info on the frame location in the clip, x y and residual
# Frame numbers start from zero (frame 0 is first frame of the clip).
# Tracksperanto uses Shake coordinates as base. Image is Y-positive, X-positive, absolute
# pixel values up and right (zero is in the lower left corner). Some apps use a different
# coordinate system so translation will take place on import or on export, respectively.
# We also use residual and not correlation (residual is how far the tracker strolls away,
# correlation is how sure the tracker is about what it's doing). Residual is the inverse of
# correlation (with total correlation of one the residual excursion becomes zero).
class Tracksperanto::Keyframe
  include Tracksperanto::Casts
  include Tracksperanto::BlockInit
  
  # Absolute integer frame where this keyframe is placed, 0 based
  attr_accessor :frame
  
  # Absolute float X value of the point, zero is lower left
  attr_accessor :abs_x
  
  # Absolute float Y value of the point, zero is lower left
  attr_accessor :abs_y
  
  # Absolute float residual (0 is "spot on")
  attr_accessor :residual
  
  cast_to_float :abs_x, :abs_y, :residual
  cast_to_int :frame
  
  def inspect
    [frame, abs_x, abs_y].inspect
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
tracksperanto-1.5.7 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.6 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.5 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.4 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.3 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.2 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.1 lib/tracksperanto/keyframe.rb
tracksperanto-1.5.0 lib/tracksperanto/keyframe.rb
tracksperanto-1.4.0 lib/tracksperanto/keyframe.rb
tracksperanto-1.2.6 lib/tracksperanto/keyframe.rb
tracksperanto-1.3.1 lib/tracksperanto/keyframe.rb
tracksperanto-1.3.0 lib/tracksperanto/keyframe.rb
tracksperanto-1.2.4 lib/tracksperanto/keyframe.rb
tracksperanto-1.2.3 lib/tracksperanto/keyframe.rb
tracksperanto-1.2.2 lib/tracksperanto/keyframe.rb
tracksperanto-1.2.1 lib/tracksperanto/keyframe.rb
tracksperanto-1.2.0 lib/tracksperanto/keyframe.rb