class Tracksperanto::Export::MatchMover

Export for Autodesk MatchMover/Image Modeler

Constants

FIRST_KEYFRAME_TEMPLATE
KEYFRAME_TEMPLATE
PREAMBLE
TRACKER_POSTAMBLE
TRACKER_PREAMBLE

Public Class Methods

desc_and_extension() click to toggle source
# File lib/export/match_mover.rb, line 4
def self.desc_and_extension
  "matchmover.rz2"
end
human_name() click to toggle source
# File lib/export/match_mover.rb, line 8
def self.human_name
  "MatchMover REALVIZ Ascii Point Tracks .rz2 file"
end

Public Instance Methods

end_tracker_segment() click to toggle source
# File lib/export/match_mover.rb, line 29
def end_tracker_segment
  @io.write(TRACKER_POSTAMBLE)
end
export_point(frame, abs_float_x, abs_float_y, float_residual) click to toggle source
# File lib/export/match_mover.rb, line 33
def export_point(frame, abs_float_x, abs_float_y, float_residual)
  template = @at_first_point ? FIRST_KEYFRAME_TEMPLATE : KEYFRAME_TEMPLATE
  values = [frame + 1, abs_float_x, @height - abs_float_y, (1 - float_residual)]
  @io.puts(template % values)
  @at_first_point = false
end
start_export( img_width, img_height) click to toggle source
# File lib/export/match_mover.rb, line 18
def start_export( img_width, img_height)
  @height = img_height
  @io.puts(PREAMBLE % [img_width, img_height])
end
start_tracker_segment(tracker_name) click to toggle source
# File lib/export/match_mover.rb, line 23
def start_tracker_segment(tracker_name)
  @tracker_name = tracker_name
  @at_first_point = true
  @io.write(TRACKER_PREAMBLE % tracker_name.inspect)
end