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.8.4 lib/export/shake_text.rb
tracksperanto-1.8.2 lib/export/shake_text.rb
tracksperanto-1.8.1 lib/export/shake_text.rb
tracksperanto-1.8.0 lib/export/shake_text.rb
tracksperanto-1.7.5 lib/export/shake_text.rb
tracksperanto-1.7.4 lib/export/shake_text.rb
tracksperanto-1.7.3 lib/export/shake_text.rb
tracksperanto-1.7.2 lib/export/shake_text.rb
tracksperanto-1.7.1 lib/export/shake_text.rb
tracksperanto-1.7.0 lib/export/shake_text.rb
tracksperanto-1.6.9 lib/export/shake_text.rb
tracksperanto-1.6.8 lib/export/shake_text.rb
tracksperanto-1.6.7 lib/export/shake_text.rb
tracksperanto-1.6.6 lib/export/shake_text.rb
tracksperanto-1.6.5 lib/export/shake_text.rb
tracksperanto-1.6.4 lib/export/shake_text.rb
tracksperanto-1.6.3 lib/export/shake_text.rb
tracksperanto-1.6.2 lib/export/shake_text.rb
tracksperanto-1.6.1 lib/export/shake_text.rb
tracksperanto-1.6.0 lib/export/shake_text.rb