aboutsummaryrefslogtreecommitdiff
path: root/src/vec_core.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-01-28 22:34:38 +0100
committerjaseg <git@jaseg.de>2021-01-28 22:34:38 +0100
commitf65cd52304a9a57118d82e527469839d5663e7ba (patch)
treeffcf4f638b7df7aaf8d222b2792a811ac79c5068 /src/vec_core.h
parent9711fabab7893fcdd0a5708c79a7d48f2ad15167 (diff)
downloadgerbolyze-f65cd52304a9a57118d82e527469839d5663e7ba.tar.gz
gerbolyze-f65cd52304a9a57118d82e527469839d5663e7ba.tar.bz2
gerbolyze-f65cd52304a9a57118d82e527469839d5663e7ba.zip
Binary vectorizer works
Diffstat (limited to 'src/vec_core.h')
-rw-r--r--src/vec_core.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vec_core.h b/src/vec_core.h
index 9df8598..06099ab 100644
--- a/src/vec_core.h
+++ b/src/vec_core.h
@@ -30,10 +30,21 @@ namespace gerbolyze {
public:
VoronoiVectorizer(grid_type grid, bool relax=true) : m_relax(relax), m_grid_type(grid) {}
- 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);
+ 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);
private:
double m_relax;
grid_type m_grid_type;
};
+
+ class OpenCVContoursVectorizer : public ImageVectorizer {
+ public:
+ OpenCVContoursVectorizer() {}
+
+ 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);
+ };
+
+ void parse_img_meta(const pugi::xml_node &node, double &x, double &y, double &width, double &height);
+ std::string read_img_data(const pugi::xml_node &node);
+ void draw_bg_rect(cairo_t *cr, double width, double height, ClipperLib::Paths &clip_path, PolygonSink &sink, cairo_matrix_t &viewport_matrix);
}