NHMLFixup v10
[jpcrr.git] / streamtools / rescalers / simple.cpp
blob3c488a44eca7e491760c5480a3318de68e6acc61
1 #include "rescalers/public.hpp"
2 #include "rescalers/factory.hpp"
3 #include "rescalers/simple.hpp"
4 #include <map>
5 #include <stdexcept>
7 namespace
9 class simple_rescaler_c : public rescaler
11 public:
12 simple_rescaler_c(bound_scaler_t _rescale_fn)
14 rescale_fn = _rescale_fn;
17 void operator()(uint8_t* target, uint32_t twidth, uint32_t theight,
18 const uint8_t* source, uint32_t swidth, uint32_t sheight)
20 rescale_fn(target, twidth, theight, source, swidth, sheight);
23 private:
24 bound_scaler_t rescale_fn;
28 simple_rescaler::simple_rescaler(const std::string& type, bound_scaler_t _fn)
29 : rescaler_factory(type)
31 fn = _fn;
34 rescaler& simple_rescaler::make(const std::string& type)
36 return *new simple_rescaler_c(fn);