From 9d38540f31a2f52b78de9f706c5e4a505d64521e Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Wed, 17 Apr 2013 17:35:13 -0400 Subject: [PATCH] added templateGallery --- openbr/plugins/gallery.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+), 0 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index e753123..d5a3bc9 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -605,6 +605,32 @@ BR_REGISTER(Gallery, xmlGallery) /*! * \ingroup galleries + * \brief Treat the file as a single binary template. + * \author Josh Klontz \cite jklontz + */ +class templateGallery : public Gallery +{ + Q_OBJECT + + TemplateList readBlock(bool *done) + { + *done = true; + QByteArray data; + QtUtils::readFile(file.name.left(file.name.size()-QString(".template").size()), data); + return TemplateList() << Template(file, cv::Mat(1, data.size(), CV_8UC1, data.data()).clone()); + } + + void write(const Template &t) + { + (void) t; + qFatal("No supported."); + } +}; + +BR_REGISTER(Gallery, templateGallery) + +/*! + * \ingroup galleries * \brief Database input. * \author Josh Klontz \cite jklontz */ -- libgit2 0.21.4