diff --git a/openbr/plugins/core/propagate.cpp b/openbr/plugins/core/propagate.cpp index 8b13789..98e8167 100644 --- a/openbr/plugins/core/propagate.cpp +++ b/openbr/plugins/core/propagate.cpp @@ -1 +1,35 @@ +#include +namespace br +{ + +/*! + * \ingroup transforms + * \brief Ensures that a template will be propogated. + * \author Scott Klum \cite sklum + */ +class PropagateTransform : public Transform +{ + Q_OBJECT + + Q_PROPERTY(br::Transform *transform READ get_transform WRITE set_transform RESET reset_transform STORED true) + BR_PROPERTY(br::Transform *, transform, NULL) + + void train(const TemplateList &data) + { + transform->train(data); + } + + void project(const Template &src, Template &dst) const + { + transform->project(src,dst); + if (dst.isEmpty()) + dst = src; + } +}; + +BR_REGISTER(Transform, PropagateTransform) + +} // namespace br + +#include "core/propagate.moc"