Sha256: f9d54dee1a69a7ecd3229409e3efc61d93beacd1e60a56ce5caf3fbac35ab3f2

Contents?: true

Size: 955 Bytes

Versions: 26

Compression:

Stored size: 955 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.dirname(__FILE__) + '/scaler'

# This tool reformats (scales) the track setup to a specific pixel resolution. Very useful for
# applying proxy tracks to full-res images
class Tracksperanto::Tool::Reformat < Tracksperanto::Tool::Base
  
  parameter :width,  :cast => :int, :desc => "New comp width in px", :default => 1080
  parameter :height,  :cast => :int, :desc => "New comp height in px", :default => 1080
  
  def self.action_description
    "Reformat the comp together with it's trackers to conform to a specific format"
  end
  
  # Called on export start
  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
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 lib/tools/reformat.rb
tracksperanto-3.5.8 lib/tools/reformat.rb
tracksperanto-3.5.7 lib/tools/reformat.rb
tracksperanto-3.5.6 lib/tools/reformat.rb
tracksperanto-3.5.5 lib/tools/reformat.rb
tracksperanto-3.5.4 lib/tools/reformat.rb
tracksperanto-3.5.2 lib/tools/reformat.rb
tracksperanto-3.5.1 lib/tools/reformat.rb
tracksperanto-3.5.0 lib/tools/reformat.rb
tracksperanto-3.4.1 lib/tools/reformat.rb
tracksperanto-3.4.0 lib/tools/reformat.rb
tracksperanto-3.3.13 lib/tools/reformat.rb
tracksperanto-3.3.12 lib/tools/reformat.rb
tracksperanto-3.3.11 lib/tools/reformat.rb
tracksperanto-3.3.10 lib/tools/reformat.rb
tracksperanto-3.3.9 lib/tools/reformat.rb
tracksperanto-3.3.8 lib/tools/reformat.rb
tracksperanto-3.3.7 lib/tools/reformat.rb
tracksperanto-3.3.6 lib/tools/reformat.rb
tracksperanto-3.3.0.pre lib/tools/reformat.rb