Commit 706efbacd4c5213cfe1ddfaabc3adc942ffe7b49

Authored by Scott Klum
1 parent d1a5ec8c

Added CheckPoints

openbr/plugins/metadata/checkpoints.cpp 0 → 100644
  1 +#include <openbr/plugins/openbr_internal.h>
  2 +
  3 +namespace br
  4 +{
  5 +
  6 +/*!
  7 + * \ingroup transforms
  8 + * \brief Checks the points in a template for missing (-1,-1) values
  9 + * \author Scott Klum \cite sklum
  10 + */
  11 +class CheckPointsTransform : public UntrainableMetadataTransform
  12 +{
  13 + Q_OBJECT
  14 +
  15 + Q_PROPERTY(QList<int> indices READ get_indices WRITE set_indices RESET reset_indices STORED false)
  16 + BR_PROPERTY(QList<int>, indices, QList<int>())
  17 +
  18 + void projectMetadata(const File &src, File &dst) const
  19 + {
  20 + dst = src;
  21 + for (int i=0; i<indices.size(); i++)
  22 + if (src.points()[indices[i]] == QPointF(-1,-1)) {
  23 + dst.fte = true;
  24 + break;
  25 + }
  26 + }
  27 +};
  28 +
  29 +BR_REGISTER(Transform, CheckPointsTransform)
  30 +
  31 +} // namespace br
  32 +
  33 +#include "metadata/checkpoints.moc"
... ...