Sha256: 193f0a3bcfedd64bedec090960c02931a40f70ce7ec783586f46e53b79f34040

Contents?: true

Size: 725 Bytes

Versions: 26

Compression:

Stored size: 725 Bytes

Contents

# Export for Shake .txt tracker blobs
class Tracksperanto::Export::ShakeText < Tracksperanto::Export::Base
  PREAMBLE = "TrackName %s\n   Frame             X             Y   Correlation\n"
  POSTAMBLE = "\n"
  
  def self.desc_and_extension
    "shake_trackers.txt"
  end
  
  def self.human_name
    "Shake trackers in a .txt file"
  end
  
  def start_tracker_segment(tracker_name)
    @io.puts PREAMBLE % tracker_name
  end
  
  def end_tracker_segment
    @io.puts POSTAMBLE
  end
   
  def export_point(frame, abs_float_x, abs_float_y, float_residual)
    # Shake starts from frame 1, not 0
    line = "   %.2f   %.3f   %.3f   %.3f" % [frame + 1, abs_float_x, abs_float_y, 1 - float_residual]
    @io.puts line
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
tracksperanto-1.5.7 lib/export/shake_text.rb
tracksperanto-1.5.6 lib/export/shake_text.rb
tracksperanto-1.5.5 lib/export/shake_text.rb
tracksperanto-1.5.4 lib/export/shake_text.rb
tracksperanto-1.5.3 lib/export/shake_text.rb
tracksperanto-1.5.2 lib/export/shake_text.rb