Sha256: be84a12f07819977076a12a673cc33322a01dd22a4c83878e7df1ccfe12234cf

Contents?: true

Size: 578 Bytes

Versions: 6

Compression:

Stored size: 578 Bytes

Contents

# -*- encoding : utf-8 -*-
# This middleware removes all keyframes before frame 0, and skips trackers entirely if they are all before frame 0
class Tracksperanto::Middleware::StartTrim < Tracksperanto::Middleware::Base
  attr_accessor :enabled
  
  def start_export( img_width, img_height)
    if @enabled
      @exporter = Tracksperanto::Middleware::LengthCutoff.new(@exporter, :min_length => 1) # Ensure at least one keyframe
    end
    
    super
  end
  
  def export_point(frame, float_x, float_y, float_residual)
    return super unless (@enabled && frame < 0)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tracksperanto-2.9.5 lib/middleware/start_trim.rb
tracksperanto-2.9.4 lib/middleware/start_trim.rb
tracksperanto-2.9.3 lib/middleware/start_trim.rb
tracksperanto-2.9.2 lib/middleware/start_trim.rb
tracksperanto-2.9.1 lib/middleware/start_trim.rb
tracksperanto-2.9.0 lib/middleware/start_trim.rb