diff options
author | jaseg <git@jaseg.de> | 2021-01-28 22:34:38 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2021-01-28 22:34:38 +0100 |
commit | f65cd52304a9a57118d82e527469839d5663e7ba (patch) | |
tree | ffcf4f638b7df7aaf8d222b2792a811ac79c5068 /src/main.cpp | |
parent | 9711fabab7893fcdd0a5708c79a7d48f2ad15167 (diff) | |
download | gerbolyze-f65cd52304a9a57118d82e527469839d5663e7ba.tar.gz gerbolyze-f65cd52304a9a57118d82e527469839d5663e7ba.tar.bz2 gerbolyze-f65cd52304a9a57118d82e527469839d5663e7ba.zip |
Binary vectorizer works
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index ba75204..6484295 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,6 +42,9 @@ int main(int argc, char **argv) { {"only_groups", {"-g", "--only-groups"}, "Comma-separated list of group IDs to export.", 1}, + {"vectorizer", {"-b", "--vectorizer"}, + "Vectorizer to use for bitmap images. One of poisson-disc (default), hex-grid, square-grid, binary-contours.", + 1}, {"exclude_groups", {"-e", "--exclude-groups"}, "Comma-separated list of group IDs to exclude from export. Takes precedence over --only-groups.", 1}, @@ -165,10 +168,18 @@ int main(int argc, char **argv) { if (args["exclude_groups"]) id_match(args["exclude_groups"], sel.exclude); - VoronoiVectorizer vec(POISSON_DISC, true); + string vectorizer = args["vectorizer"] ? args["vectorizer"] : "poisson-disc"; + ImageVectorizer *vec = makeVectorizer(vectorizer); + if (!vec) { + cerr << "Unknown vectorizer \"" << vectorizer << "\"." << endl; + argagg::fmt_ostream fmt(cerr); + fmt << usage.str() << argparser; + return EXIT_FAILURE; + } + RenderSettings rset { 0.1, - &vec + vec }; doc.render(rset, flattener ? *flattener : *sink, &sel); |