Sha256: 1947175907620d95da0484293f47b0d10c268af8384b38fe4f0b685f928981c8

Contents?: true

Size: 748 Bytes

Versions: 5

Compression:

Stored size: 748 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"
  TEMPLATE = "   %.2f   %.3f   %.3f   %.3f"
  
  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 = TEMPLATE % [frame + 1, abs_float_x, abs_float_y, 1 - float_residual]
    @io.puts line
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tracksperanto-4.2.0 lib/export/shake_text.rb
tracksperanto-4.1.3 lib/export/shake_text.rb
tracksperanto-4.1.2 lib/export/shake_text.rb
tracksperanto-4.1.0 lib/export/shake_text.rb
tracksperanto-4.0.0 lib/export/shake_text.rb