lib/pipeline/base.rb in tracksperanto-1.0.6 vs lib/pipeline/base.rb in tracksperanto-1.1.0

- old
+ new

@@ -17,15 +17,16 @@ # Setup middlewares - skip for now scaler = Tracksperanto::Middleware::Scaler.new(mux) slipper = Tracksperanto::Middleware::Slipper.new(scaler) golden = Tracksperanto::Middleware::Golden.new(slipper) + reformat = Tracksperanto::Middleware::Reformat.new(golden) # Yield middlewares to the block - yield(scaler, slipper, golden) if block_given? + yield(scaler, slipper, golden, reformat) if block_given? - @converted_points, @converted_keyframes = run_export(read_data, parser, golden) do | p, m | + @converted_points, @converted_keyframes = run_export(read_data, parser, reformat) do | p, m | @progress_block.call(p, m) if @progress_block end end # Runs the export and returns the number of points and keyframes processed. @@ -40,10 +41,11 @@ yield(percent_complete = 20.0, "Starting export for #{trackers.length} trackers") if block_given? percent_per_tracker = 80.0 / trackers.length + # Use the width and height provided by the parser itself processor.start_export(parser.width, parser.height) yield(percent_complete, "Starting export") if block_given? trackers.each do | t | @@ -53,9 +55,10 @@ t.keyframes.each do | kf | keyframes += 1 processor.export_point(kf.frame, kf.abs_x, kf.abs_y, kf.residual) yield(percent_complete += kf_weight, "Writing keyframe") if block_given? end + processor.end_tracker_segment end processor.end_export yield(100.0, "Wrote #{points} points and #{keyframes} keyframes") if block_given? \ No newline at end of file