Commit 2173197af8156091b2d1b741f6205ce900ea46a5
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
2 changed files
with
32 additions
and
3 deletions
README.md
| @@ -11,6 +11,3 @@ To optionally check out a particular [tagged release](https://github.com/biometr | @@ -11,6 +11,3 @@ To optionally check out a particular [tagged release](https://github.com/biometr | ||
| 11 | $ git submodule update | 11 | $ git submodule update |
| 12 | 12 | ||
| 13 | **[Build Instructions](http://openbiometrics.org/doxygen/latest/installation.html)** | 13 | **[Build Instructions](http://openbiometrics.org/doxygen/latest/installation.html)** |
| 14 | - | ||
| 15 | - | ||
| 16 | -[](https://bitdeli.com/free "Bitdeli Badge") |
openbr/plugins/gallery.cpp
| @@ -559,6 +559,38 @@ class txtGallery : public Gallery | @@ -559,6 +559,38 @@ class txtGallery : public Gallery | ||
| 559 | }; | 559 | }; |
| 560 | 560 | ||
| 561 | BR_REGISTER(Gallery, txtGallery) | 561 | BR_REGISTER(Gallery, txtGallery) |
| 562 | +/*! | ||
| 563 | + * \ingroup galleries | ||
| 564 | + * \brief Treats each line as a call to File::flat() | ||
| 565 | + * \author Josh Klontz \cite jklontz | ||
| 566 | + */ | ||
| 567 | +class flatGallery : public Gallery | ||
| 568 | +{ | ||
| 569 | + Q_OBJECT | ||
| 570 | + QStringList lines; | ||
| 571 | + | ||
| 572 | + ~flatGallery() | ||
| 573 | + { | ||
| 574 | + if (!lines.isEmpty()) | ||
| 575 | + QtUtils::writeFile(file.name, lines); | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + TemplateList readBlock(bool *done) | ||
| 579 | + { | ||
| 580 | + TemplateList templates; | ||
| 581 | + foreach (const QString &line, QtUtils::readLines(file)) | ||
| 582 | + templates.append(File(line)); | ||
| 583 | + *done = true; | ||
| 584 | + return templates; | ||
| 585 | + } | ||
| 586 | + | ||
| 587 | + void write(const Template &t) | ||
| 588 | + { | ||
| 589 | + lines.append(t.file.flat()); | ||
| 590 | + } | ||
| 591 | +}; | ||
| 592 | + | ||
| 593 | +BR_REGISTER(Gallery, flatGallery) | ||
| 562 | 594 | ||
| 563 | /*! | 595 | /*! |
| 564 | * \ingroup galleries | 596 | * \ingroup galleries |