Commit 6afe15b5f94d284298157c9fc95137047aa57759

Authored by Josh Klontz
1 parent 4c859a50

added lffs format

Showing 1 changed file with 25 additions and 0 deletions
openbr/plugins/format.cpp
@@ -245,6 +245,31 @@ BR_REGISTER(Format, DefaultFormat) @@ -245,6 +245,31 @@ BR_REGISTER(Format, DefaultFormat)
245 245
246 /*! 246 /*!
247 * \ingroup formats 247 * \ingroup formats
  248 + * \brief Reads a NIST LFFS file.
  249 + * \author Josh Klontz \cite jklontz
  250 + */
  251 +class lffsFormat : public Format
  252 +{
  253 + Q_OBJECT
  254 +
  255 + Template read() const
  256 + {
  257 + QByteArray byteArray;
  258 + QtUtils::readFile(file.name, byteArray);
  259 + return Mat(1, byteArray.size(), CV_8UC1, byteArray.data()).clone();
  260 + }
  261 +
  262 + void write(const Template &t) const
  263 + {
  264 + QByteArray byteArray((const char*)t.m().data, t.m().total()*t.m().elemSize());
  265 + QtUtils::writeFile(file.name, byteArray);
  266 + }
  267 +};
  268 +
  269 +BR_REGISTER(Format, lffsFormat)
  270 +
  271 +/*!
  272 + * \ingroup formats
248 * \brief Reads a NIST BEE similarity matrix. 273 * \brief Reads a NIST BEE similarity matrix.
249 * \author Josh Klontz \cite jklontz 274 * \author Josh Klontz \cite jklontz
250 */ 275 */