aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-01-28 23:15:36 +0100
committerjaseg <git@jaseg.de>2021-01-28 23:15:36 +0100
commit6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d (patch)
tree76dcc0361419ccbbffa5900c2d18ee2956124a5f /src/main.cpp
parentf65cd52304a9a57118d82e527469839d5663e7ba (diff)
downloadgerbolyze-6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d.tar.gz
gerbolyze-6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d.tar.bz2
gerbolyze-6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d.zip
Per-image vectorizer selection works
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 6484295..93b6e8f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -43,7 +43,10 @@ int main(int argc, char **argv) {
"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.",
+ "Vectorizer to use for bitmap images. One of poisson-disc (default), hex-grid, square-grid, binary-contours, dev-null.",
+ 1},
+ {"vectorizer_map", {"--vectorizer-map"},
+ "Map from image element id to vectorizer. Overrides --vectorizer. Format: id1=vectorizer,id2=vectorizer,...",
1},
{"exclude_groups", {"-e", "--exclude-groups"},
"Comma-separated list of group IDs to exclude from export. Takes precedence over --only-groups.",
@@ -169,6 +172,7 @@ int main(int argc, char **argv) {
id_match(args["exclude_groups"], sel.exclude);
string vectorizer = args["vectorizer"] ? args["vectorizer"] : "poisson-disc";
+ /* Check argument */
ImageVectorizer *vec = makeVectorizer(vectorizer);
if (!vec) {
cerr << "Unknown vectorizer \"" << vectorizer << "\"." << endl;
@@ -176,10 +180,12 @@ int main(int argc, char **argv) {
fmt << usage.str() << argparser;
return EXIT_FAILURE;
}
+ delete vec;
+ VectorizerSelectorizer vec_sel(vectorizer, args["vectorizer_map"] ? args["vectorizer_map"] : "");
RenderSettings rset {
0.1,
- vec
+ vec_sel,
};
doc.render(rset, flattener ? *flattener : *sink, &sel);