Commit a46353ccd3233bc62754f50326897c67a1a40a61
1 parent
9a9a279b
added DefaultDistance
Showing
1 changed file
with
24 additions
and
1 deletions
sdk/plugins/compare.cpp renamed to sdk/plugins/distance.cpp
| ... | ... | @@ -116,6 +116,29 @@ BR_REGISTER(Distance, DistDistance) |
| 116 | 116 | |
| 117 | 117 | /*! |
| 118 | 118 | * \ingroup distances |
| 119 | + * \brief DistDistance wrapper. | |
| 120 | + * \author Josh Klontz \cite jklontz | |
| 121 | + */ | |
| 122 | +class DefaultDistance : public Distance | |
| 123 | +{ | |
| 124 | + Q_OBJECT | |
| 125 | + Distance *distance; | |
| 126 | + | |
| 127 | + void init() | |
| 128 | + { | |
| 129 | + distance = Distance::make("Dist("+file.name+")"); | |
| 130 | + } | |
| 131 | + | |
| 132 | + float compare(const Template &a, const Template &b) const | |
| 133 | + { | |
| 134 | + return distance->compare(a, b); | |
| 135 | + } | |
| 136 | +}; | |
| 137 | + | |
| 138 | +BR_REGISTER(Distance, DefaultDistance) | |
| 139 | + | |
| 140 | +/*! | |
| 141 | + * \ingroup distances | |
| 119 | 142 | * \brief Fast 8-bit L1 distance |
| 120 | 143 | * \author Josh Klontz \cite jklontz |
| 121 | 144 | */ |
| ... | ... | @@ -174,4 +197,4 @@ BR_REGISTER(Distance, IdenticalDistance) |
| 174 | 197 | |
| 175 | 198 | } // namespace br |
| 176 | 199 | |
| 177 | -#include "compare.moc" | |
| 200 | +#include "distance.moc" | ... | ... |