From 47078a758bb69cdf5a98bee44061e30168222e6c Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 13 Jun 2014 10:41:38 -0400 Subject: [PATCH] deprecated br-print --- app/CMakeLists.txt | 1 - app/br-print/CMakeLists.txt | 4 ---- app/br-print/br-print.cpp | 50 -------------------------------------------------- openbr/openbr_plugin.cpp | 1 + openbr/plugins/gallery.cpp | 25 +++++++++++++++++++++++++ 5 files changed, 26 insertions(+), 55 deletions(-) delete mode 100644 app/br-print/CMakeLists.txt delete mode 100644 app/br-print/br-print.cpp diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 7e3c6c2..f509c6a 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -9,7 +9,6 @@ if(NOT ${BR_EMBEDDED}) add_subdirectory(br-download) add_subdirectory(br-crawl) add_subdirectory(br-gui) - add_subdirectory(br-print) add_subdirectory(br-search) add_subdirectory(br-select) add_subdirectory(br-serve) diff --git a/app/br-print/CMakeLists.txt b/app/br-print/CMakeLists.txt deleted file mode 100644 index c3bee4b..0000000 --- a/app/br-print/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_executable(br-print br-print.cpp ${BR_RESOURCES}) -target_link_libraries(br-print openbr ${BR_THIRDPARTY_LIBS}) -qt5_use_modules(br-print ${QT_DEPENDENCIES}) -install(TARGETS br-print RUNTIME DESTINATION bin) diff --git a/app/br-print/br-print.cpp b/app/br-print/br-print.cpp deleted file mode 100644 index a64d7c5..0000000 --- a/app/br-print/br-print.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright 2014 Noblis * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include - -static void help() -{ - printf("br-print [args]\n" - "================\n" - "* __stdin__ - Templates\n" - "* __stdout__ - Template _data_\n" - "\n" - "_br-print_ extracts template data.\n"); -} - -static void print_utemplate(br_const_utemplate utemplate, br_callback_context) -{ - static bool first = true; - if (first) { - first = false; - } else { - printf("\n"); - } - - fwrite(utemplate->data, 1, utemplate->size, stdout); -} - -int main(int argc, char *argv[]) -{ - for (int i=1; iinit(File()); Globals->useGui = useGui; + Globals->algorithm = "Identity"; Common::seedRNG(); diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 49684d4..c2cac1f 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -236,6 +236,31 @@ BR_REGISTER(Gallery, utGallery) /*! * \ingroup galleries + * \brief Newline-separated br_universal_template data. + * \author Josh Klontz \cite jklontz + */ +class utdGallery : public BinaryGallery +{ + Q_OBJECT + + Template readTemplate() + { + qFatal("Not supported"); + } + + void write(const Template &t) + { + if (t.empty()) + return; + gallery.write(QByteArray((const char*) t.m().data, t.m().rows * t.m().cols * t.m().elemSize())); + gallery.write("\n"); + } +}; + +BR_REGISTER(Gallery, utdGallery) + +/*! + * \ingroup galleries * \brief Reads/writes templates to/from folders. * \author Josh Klontz \cite jklontz * \param regexp An optional regular expression to match against the files extension. -- libgit2 0.21.4