// perform crop, deskew, fill background ... // // Date: 2024-01-24 #pragma once #include #include #include class auto_crop : public image_processor { bool crop_ = true; // auto crop bool deskew_ = true; bool fill_bg_ = true; bool convex_ = true; bool fill_clr_ = false; int threshold_ = 40; int indent_ = 5; int noise_ = 8; SIZE fixed_paper_ = {0, 0}; bool lateral_ = false; std::map> opt_handler_; void init(void); int work(PROCIMGINFO& in, PROCIMGINFO& out); public: auto_crop(bool weaker = false); protected: ~auto_crop(); public: virtual int set_value(const char* name/*nullptr for all options*/, void* val/*nullptr for restore*/) override; public: virtual image_processor* copy_weaker(void) override; virtual int process(std::vector& in, std::vector& out) override; };