Sha256: bfa1b66d64fd8f8df85f92fb63304df141c0570c69273f94a0ae04778bd4359f

Contents?: true

Size: 747 Bytes

Versions: 27

Compression:

Stored size: 747 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

27 entries across 27 versions & 1 rubygems

Version Path
tracksperanto-2.6.3 lib/export/shake_text.rb
tracksperanto-2.6.2 lib/export/shake_text.rb
tracksperanto-2.6.1 lib/export/shake_text.rb
tracksperanto-2.6.0 lib/export/shake_text.rb
tracksperanto-2.5.0 lib/export/shake_text.rb
tracksperanto-2.4.1 lib/export/shake_text.rb
tracksperanto-2.3.3 lib/export/shake_text.rb
tracksperanto-2.3.2 lib/export/shake_text.rb
tracksperanto-2.3.1 lib/export/shake_text.rb
tracksperanto-2.3.0 lib/export/shake_text.rb
tracksperanto-2.2.4 lib/export/shake_text.rb
tracksperanto-2.2.2 lib/export/shake_text.rb
tracksperanto-2.2.0 lib/export/shake_text.rb
tracksperanto-2.1.1 lib/export/shake_text.rb
tracksperanto-2.1.0 lib/export/shake_text.rb
tracksperanto-2.0.2 lib/export/shake_text.rb
tracksperanto-2.0.1 lib/export/shake_text.rb
tracksperanto-2.0.0 lib/export/shake_text.rb
tracksperanto-1.9.9 lib/export/shake_text.rb
tracksperanto-1.9.8 lib/export/shake_text.rb