Convert SVG to TikZ, with filters.
This API is meant to create custom SVG to TikZ exporters, possibly filtering or modifying some elements of the original image along the way. The filters work best if the SVG comes from Inkscape.
For instance, selecting only one Inkscape "layer" can be done
using the Layers
filter:
extern crate svg;
use svg_tikz::*;
use svg_tikz::layers::*;
let f = std::io::BufWriter::new(std::fs::File::create("output.tex").unwrap());
let default = DefaultHandler::new(f);
let mut handler = Layers::new(&["my layer"], default);
// Creating an empty SVG file.
std::fs::File::create("input.svg").unwrap();
// Parsing our empty SVG file.
let input = paths::parse(svg::open("input.svg").unwrap()).unwrap().into();
handler.output(&input).unwrap();