* Makefile.am: Improve generation of headers.mk.
* demo/Makefile.am: Fix an invalid path to the .pro file.
* demo/src/main.cc: repair copyright header.
* demo/src/mainwindow.cc,
* demo/src/mainwindow.hh: handle a different base directory for image
data.
* filter/small_objects.hh: fix an accumulator.
---
scribo/ChangeLog | 34 +++++++++++++++++++++++++---------
scribo/Makefile.am | 13 +++++++++++++
scribo/demo/Makefile.am | 4 +++-
scribo/demo/src/main.cc | 6 ++++--
scribo/demo/src/mainwindow.cc | 12 ++++++++++--
scribo/demo/src/mainwindow.hh | 3 +++
scribo/filter/small_objects.hh | 13 ++-----------
7 files changed, 60 insertions(+), 25 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index d6ce297..a4cbdbd 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,16 +1,32 @@
+2009-06-11 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes in Scribo.
+
+ * Makefile.am: Improve generation of headers.mk.
+
+ * demo/Makefile.am: Fix an invalid path to the .pro file.
+
+ * demo/src/main.cc: repair copyright header.
+
+ * demo/src/mainwindow.cc,
+ * demo/src/mainwindow.hh: handle a different base directory for image
+ data.
+
+ * filter/small_objects.hh: fix an accumulator.
+
2009-06-10 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
- Fix Scribo
+ Fix Scribo.
- * core/all.hh
- * debug/all.hh
- * text/all.hh
- * filter/all.hh
- * table/all.hh
+ * core/all.hh,
+ * debug/all.hh,
+ * text/all.hh,
+ * filter/all.hh,
+ * table/all.hh: update includes.
- * demo/Makefile.am
- * src/Makefile.am
- * src/extract/primitive/Makefile.am
+ * demo/Makefile.am,
+ * src/Makefile.am,
+ * src/extract/primitive/Makefile.am: update source list.
* core/erase_bboxes.hh: move...
* core/erase_objects.hh: ...here.
diff --git a/scribo/Makefile.am b/scribo/Makefile.am
index 316ee8a..2285b6c 100644
--- a/scribo/Makefile.am
+++ b/scribo/Makefile.am
@@ -26,3 +26,16 @@ bin:
# Regen files recursively.
include $(top_srcdir)/build-aux/regen-recursive.mk
REGEN_SUBDIRS += tests
+
+regen-am:
+ ./generate_dist_headers.sh
+
+EXTRA_DIST = generate_dist_headers.sh
+# FIXME: Change generate_dist_headers.sh so that the action looks like this:
+#
+# $< $@.tmp && mv -f $@.tmp $@ && chmod -w $@
+#
+$(srcdir)/headers.mk: $(srcdir)/generate_dist_headers.sh
+ ./generate_dist_headers.sh
+
+include $(srcdir)/headers.mk
diff --git a/scribo/demo/Makefile.am b/scribo/demo/Makefile.am
index ab8c1a2..19948cb 100644
--- a/scribo/demo/Makefile.am
+++ b/scribo/demo/Makefile.am
@@ -2,8 +2,10 @@
include $(top_srcdir)/scribo/scribo.mk
+.PHONY : demo
+
Makefile.demo:
- qmake-qt4 $(top_srcdir)/scribo/src/demo/demo.pro -o Makefile.demo
+ qmake-qt4 $(top_srcdir)/scribo/demo/demo.pro -o Makefile.demo
demo: Makefile.demo
make -f Makefile.demo all
diff --git a/scribo/demo/src/main.cc b/scribo/demo/src/main.cc
index b467a07..ad9c28d 100644
--- a/scribo/demo/src/main.cc
+++ b/scribo/demo/src/main.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009
- EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -35,6 +34,9 @@ int main(int argc, char *argv[])
scribo::demo::MainWindow win;
+ if (argc == 2)
+ win.set_base_img_dir(argv[1]);
+
win.show();
return app.exec();
}
diff --git a/scribo/demo/src/mainwindow.cc b/scribo/demo/src/mainwindow.cc
index 720e086..28e120e 100644
--- a/scribo/demo/src/mainwindow.cc
+++ b/scribo/demo/src/mainwindow.cc
@@ -84,7 +84,9 @@ namespace scribo
setupUi(this);
mainItem_ = 0;
- exec_prefix_ = "../";
+ exec_prefix_ = "../src/";
+ base_img_dir_ = QCoreApplication::applicationDirPath();
+
pdialog_.setRange(0,0);
pdialog_.setLabelText(tr("Please wait while computing..."));
pdialog_.setWindowModality(Qt::WindowModal);
@@ -104,6 +106,12 @@ namespace scribo
setup_scene();
}
+ void MainWindow::set_base_img_dir(const QString& dir)
+ {
+ QDir d(dir);
+ base_img_dir_ = d.absolutePath();
+ }
+
void MainWindow::initToolBar()
{
@@ -140,7 +148,7 @@ namespace scribo
QString
filename = QFileDialog::getOpenFileName(this,
tr("Open Image."),
- QCoreApplication::applicationDirPath() + "/" + current_dir,
+ base_img_dir_ + "/" + current_dir,
tr("Images (*.pbm *.pgm *.ppm)"));
if (!filename.isEmpty())
diff --git a/scribo/demo/src/mainwindow.hh b/scribo/demo/src/mainwindow.hh
index 698186b..25b7667 100644
--- a/scribo/demo/src/mainwindow.hh
+++ b/scribo/demo/src/mainwindow.hh
@@ -45,6 +45,7 @@ namespace scribo
public:
MainWindow(QWidget *parent = 0);
+ void set_base_img_dir(const QString& dir);
private slots:
void initToolBar();
@@ -83,6 +84,8 @@ namespace scribo
QProcess exec_;
QProgressDialog pdialog_;
+
+ QString base_img_dir_;
};
diff --git a/scribo/filter/small_objects.hh b/scribo/filter/small_objects.hh
index 9fcd153..898f60b 100644
--- a/scribo/filter/small_objects.hh
+++ b/scribo/filter/small_objects.hh
@@ -44,7 +44,7 @@
# include <mln/pw/all.hh>
-# include <mln/accu/count.hh>
+# include <mln/accu/math/count.hh>
# include <mln/set/compute.hh>
@@ -52,15 +52,6 @@
# include <scribo/extract/primitive/objects.hh>
-//forward declaration.
-namespace mln
-{
- namespace accu
- {
- template <typename T> struct count;
- }
-}
-
namespace scribo
{
@@ -112,7 +103,7 @@ namespace scribo
struct small_objects_filter
: Function_v2b< small_objects_filter<L> >
{
- typedef accu::count<mln_psite(L)> card_t;
+ typedef accu::math::count<mln_psite(L)> card_t;
/// Constructor
///
--
1.5.6.5
Show replies by date