diff --git a/include/core/processor/processor_frame_factor.h b/include/core/processor/processor_frame_factor.h new file mode 100644 index 0000000000000000000000000000000000000000..c938bd23810a716fca365e8e64a8da29e8745362 --- /dev/null +++ b/include/core/processor/processor_frame_factor.h @@ -0,0 +1,80 @@ +/* + * processor_frame_factor.h + * + * Created on: Sep 6, 2021 + * Author: joanvallve + */ + +#ifndef INCLUDE_CORE_PROCESSOR_PROCESSOR_FRAME_FACTOR_H_ +#define INCLUDE_CORE_PROCESSOR_PROCESSOR_FRAME_FACTOR_H_ + +#include "core/processor/processor_base.h" + +namespace wolf +{ + +WOLF_STRUCT_PTR_TYPEDEFS(ParamsProcessorFrameFactor); + +struct ParamsProcessorFrameFactor : public ParamsProcessorBase +{ + ParamsProcessorFrameFactor() = default; + ParamsProcessorFrameFactor(std::string _unique_name, const wolf::ParamsServer & _server) : + ParamsProcessorBase(_unique_name, _server) + { + } + std::string print() const override + { + return ParamsProcessorBase::print(); + } +}; + +WOLF_PTR_TYPEDEFS(ProcessorFrameFactor); + +class ProcessorFrameFactor : public ProcessorBase +{ + public: + ProcessorFrameFactor(ParamsProcessorMotionModelPtr); + + // Factory method for high level API + WOLF_PROCESSOR_CREATE(ProcessorFrameFactor, ParamsProcessorFrameFactor); + + virtual ~ProcessorFrameFactor() override; + void configure(SensorBasePtr _sensor) override {}; + + protected: + + /** \brief process an incoming capture NEVER CALLED + */ + virtual void processCapture(CaptureBasePtr) override {}; + + /** \brief process an incoming key-frame: applies the motion model between consecutive keyframes + */ + virtual void processKeyFrame(FrameBasePtr _keyframe_ptr, const double& _time_tolerance) override; + + /** \brief trigger in capture + */ + virtual bool triggerInCapture(CaptureBasePtr) const override {return false;}; + + /** \brief trigger in key-frame + */ + virtual bool triggerInKeyFrame(FrameBasePtr _keyframe_ptr, const double& _time_tolerance) const override {return true;}; + + /** \brief store key frame + */ + virtual bool storeKeyFrame(FrameBasePtr) override {return false;}; + + /** \brief store capture + */ + virtual bool storeCapture(CaptureBasePtr) override {return false;}; + + /** \brief Vote for KeyFrame generation + */ + virtual bool voteForKeyFrame() const override {return false;}; + + // ATTRIBUTES + ParamsProcessorFrameFactorPtr params_processor_; +}; + +} /* namespace wolf */ + +#endif /* INCLUDE_CORE_PROCESSOR_PROCESSOR_FRAME_FACTOR_H_ */ diff --git a/src/processor/processor_frame_factor.cpp b/src/processor/processor_frame_factor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cfcb44c6e66560bd5f6a920c6f6492a449c8aa0b --- /dev/null +++ b/src/processor/processor_frame_factor.cpp @@ -0,0 +1,36 @@ +/* + * processor_frame_factor.cpp + * + * Created on: Sep 6, 2021 + * Author: joanvallve + */ + +#include "../../include/core/processor/processor_frame_factor.h" + +namespace wolf +{ + +ProcessorFrameFactor::ProcessorFrameFactor(ParamsProcessorMotionModelPtr _params) : + params_motion_model_(_params) +{ +} + +ProcessorFrameFactor::~ProcessorFrameFactor() +{ +} + +void ProcessorFrameFactor::processKeyFrame(FrameBasePtr _keyframe_ptr, const double& _time_tolerance) +{ + // TODO +} + +} /* namespace wolf */ + + +// Register in the FactoryProcessor +#include "core/processor/factory_processor.h" +namespace wolf { +WOLF_REGISTER_PROCESSOR(ProcessorFrameFactor); +WOLF_REGISTER_PROCESSOR_AUTO(ProcessorFrameFactor); +} // namespace wolf +