DEVELOPER_DOCS.rdoc in tracksperanto-2.12.0 vs DEVELOPER_DOCS.rdoc in tracksperanto-3.0.0

- old
+ new

@@ -16,10 +16,17 @@ * Checkout the repo at http://github.com/guerilla-di/tracksperanto * Run `bundle install' and `bundle exec rake' to run the tests * Carry your development, in your own branch or feature branch * File a pull request or send a patch to info at guerilla-di.org +=== Internal tracker representation + +The trackers are represented by Tracker objects, which work like addressable hashes per frame number. The Tracker objects +contain Keyframe objects, and those in turn contain coordinates. The coordinates are stored in absolute pixels, relative to +the zero coordinate in the lower left corner. The absolute left/bottom of the image has coordinates 0,0 (at the lower left corner of the +first pixel) and 0.5x0.5 in the middle of the leftmost lower pixel. + === Importing your own formats You can easily write a Tracksperanto import module - refer to Tracksperanto::Import::Base docs. Your importer will be configured with width and height of the comp that it is importing, and will get an IO object with the file that you are processing. You should then yield parsed trackers within the each method (tracker objects should @@ -31,18 +38,18 @@ (hundreds of trackers with thousands of keyframes with exported files growing up to 5-10 megs in size are not uncommon!). This means that the exporter should work with streams (smaller parts of the file being exported will be held in memory at a time). === Ading your own processing steps -You probably want to write a Middleware (consult the Tracksperanto::Middleware::Base docs) if you need some processing applied to the tracks -or their data. A Middleware is just like an export module, except that instead it sits between the exporter and the exporting routine. Middlewares wrap export -modules or each other, so you can stack different middleware modules together (like "scale first, then move"). +You probably want to write a Tool (consult the Tracksperanto::Tool::Base docs) if you need some processing applied to the tracks +or their data. A Tool is just like an export module, except that instead it sits between the exporter and the exporting routine. Tools wrap export +modules or each other, so you can stack different tool modules together (like "scale first, then move"). === Writing your own processing routines You probably want to write a descendant of Tracksperanto::Pipeline::Base. This is a class that manages a conversion from start to finish, including detecting the -input format, allocating output files and building a chain of Middlewares to process the export. If you want to make a GUI for Tracksperanto you will likely need +input format, allocating output files and building a chain of Tools to process the export. If you want to make a GUI for Tracksperanto you will likely need to write your own Pipeline class or reimplement parts of it. === Reporting status from long-running operations Almost every module in Tracksperanto has a method called report_progress. This method is used to notify an external callback of what you are doing, and helps keep @@ -72,14 +79,14 @@ # Create the exporter and pass the output file to it destination_file = File.open("exported_file.other", "wb") some_exporter = Tracksperanto.get_exporter("flamestabilizer").new(destination_file) - # Now add some middlewares, for example a Scale - scaler = Middleware::Scaler.new(some_exporter, :x_factor => 2) - # ... and a slip. Middlewares wrap exporters and other middlewares, so you can chain them + # Now add some tools, for example a Scale + scaler = Tool::Scaler.new(some_exporter, :x_factor => 2) + # ... and a slip. Tools wrap exporters and other tools, so you can chain them # ad nauseam - slipper = Middleware::Slipper.new(scaler, :offset => 2) + slipper = Tool::Slipper.new(scaler, :offset => 2) # Now when we send export commands to the Slipper it will play them through # to the Scaler and the Scaler in turn will send commands to the exporter. slipper.start_export(1024, 576) trackers.each do | t | \ No newline at end of file