From 61887e9ee1a108c26cdd4b2d67fc4095d62b6e9d Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 4 Jun 2021 23:28:36 +0200 Subject: Add & fix vectorizer tests --- svg-flatten/src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'svg-flatten/src/main.cpp') diff --git a/svg-flatten/src/main.cpp b/svg-flatten/src/main.cpp index 3093d6a..1fce67b 100644 --- a/svg-flatten/src/main.cpp +++ b/svg-flatten/src/main.cpp @@ -34,14 +34,17 @@ int main(int argc, char **argv) { "Number of decimal places use for exported coordinates (gerber: 1-9, SVG: 0-*)", 1}, {"svg_clear_color", {"--clear-color"}, - "SVG color to use for \"clear\" areas (default: white)", + "SVG color to use for \"clear\" areas (SVG output only; default: white)", 1}, {"svg_dark_color", {"--dark-color"}, - "SVG color to use for \"dark\" areas (default: black)", + "SVG color to use for \"dark\" areas (SVG output only; default: black)", 1}, {"flip_gerber_polarity", {"-f", "--flip-gerber-polarity"}, "Flip polarity of all output gerber primitives for --format gerber.", 0}, + {"flip_svg_color_interpretation", {"-i", "--svg-white-is-gerber-dark"}, + "Flip polarity of SVG color interpretation. This affects only SVG primitives like paths and NOT embedded bitmaps. With -i: white -> silk there/\"dark\" gerber primitive.", + 0}, {"min_feature_size", {"-d", "--trace-space"}, "Minimum feature size of elements in vectorized graphics (trace/space) in mm. Default: 0.1mm.", 1}, @@ -420,11 +423,14 @@ int main(int argc, char **argv) { } VectorizerSelectorizer vec_sel(vectorizer, args["vectorizer_map"] ? args["vectorizer_map"].as() : ""); + bool flip_svg_colors = args["flip_svg_color_interpretation"]; + RenderSettings rset { min_feature_size, curve_tolerance, vec_sel, outline_mode, + flip_svg_colors, }; SVGDocument doc; -- cgit