Class: Tracksperanto::Tool::Reformat
Overview
This tool reformats (scales) the track setup to a specific pixel resolution. Very useful for applying proxy tracks to full-res images
Class Method Summary collapse
Instance Method Summary collapse
-
#start_export(img_width, img_height) ⇒ Object
Called on export start.
Methods inherited from Base
Methods included from Parameters
Methods included from SimpleExport
Methods included from ConstName
Methods included from BlockInit
Methods included from Casts
#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string
Constructor Details
This class inherits a constructor from Tracksperanto::Tool::Base
Class Method Details
.action_description ⇒ Object
10 11 12 |
# File 'lib/tools/reformat.rb', line 10 def self.action_description "Reformat the comp together with it's trackers to conform to a specific format" end |
Instance Method Details
#start_export(img_width, img_height) ⇒ Object
Called on export start
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tools/reformat.rb', line 15 def start_export( img_width, img_height) @width ||= img_width # If they be nil @height ||= img_height x_factor, y_factor = (@width / img_width.to_f), (@height / img_height.to_f) @stash = @exporter @exporter = Tracksperanto::Tool::Scaler.new(@exporter, :x_factor => x_factor, :y_factor => y_factor) super end |