From 6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 28 Jan 2021 23:15:36 +0100 Subject: Per-image vectorizer selection works --- include/gerbolyze.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/gerbolyze.hpp b/include/gerbolyze.hpp index 01d089a..1d4f9bd 100644 --- a/include/gerbolyze.hpp +++ b/include/gerbolyze.hpp @@ -93,15 +93,27 @@ namespace gerbolyze { class ImageVectorizer { public: + virtual ~ImageVectorizer() {}; virtual void vectorize_image(cairo_t *cr, const pugi::xml_node &node, ClipperLib::Paths &clip_path, cairo_matrix_t &viewport_matrix, PolygonSink &sink, double min_feature_size_px) = 0; }; ImageVectorizer *makeVectorizer(const std::string &name); + class VectorizerSelectorizer { + public: + VectorizerSelectorizer(const std::string default_vectorizer="dev-null", const std::string defs=""); + + ImageVectorizer *select(const pugi::xml_node &img); + + private: + std::string m_default; + std::map m_map; + }; + class RenderSettings { public: double m_minimum_feature_size_mm = 0.1; - ImageVectorizer *m_vec = nullptr; + VectorizerSelectorizer &m_vec_sel; }; class SVGDocument { -- cgit