* sandbox/lazzara/igr/gui/anapath/src/tools/load.cc
* sandbox/lazzara/igr/gui/anapath/src/tools/load.hh
---
milena/ChangeLog | 7 +++
.../lazzara/igr/gui/anapath/src/tools/load.cc | 55 ++++++++++++++++++++
.../lazzara/igr/gui/anapath/src/tools/load.hh | 49 +++++++++++++++++
3 files changed, 111 insertions(+), 0 deletions(-)
create mode 100644 milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.cc
create mode 100644 milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6d5de98..23fa923 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add an image loader in the anapath GUI.
+
+ * sandbox/lazzara/igr/gui/anapath/src/tools/load.cc
+ * sandbox/lazzara/igr/gui/anapath/src/tools/load.hh
+
2010-11-18 Guillaume Lazzara <z(a)lrde.epita.fr>
* mln/io/pnm/save.hh: Add a fixme related to an ICE with GCC
diff --git a/milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.cc
b/milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.cc
new file mode 100644
index 0000000..48b1f46
--- /dev/null
+++ b/milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.cc
@@ -0,0 +1,55 @@
+#include <src/tools/load.hh>
+#include <mln/util/timer.hh>
+#include <shared/include/io/magick.hh>
+
+namespace igr
+{
+
+ namespace anapath
+ {
+
+ namespace tools
+ {
+
+ load::load(mln_data* data)
+ : data_(data)
+ {
+ }
+
+
+ void load::start(const QString& filename)
+ {
+ filename_ = filename;
+ QThread::start();
+ }
+
+
+ void load::run()
+ {
+ // Closing previous open image.
+ if (data_->input)
+ data_->input->close();
+ delete data_->input;
+
+
+ // Open new image.
+ data_->input = 0;
+
+ util::timer t;
+ t.start();
+
+ large_image_t *tmp = new large_image_t(filename_.toStdString());
+ if (! tmp->is_valid())
+ emit error(tmp->info_hook().error.c_str());
+
+ t.stop();
+ std::cout << "image loaded - " << t << std::endl;
+
+ data_->input = tmp;
+ }
+
+ } // end of namespace igr::anapath::tools
+
+ } // end of namespace igr::anapath
+
+} // end of namespace igr
diff --git a/milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.hh
b/milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.hh
new file mode 100644
index 0000000..cfaa6d9
--- /dev/null
+++ b/milena/sandbox/lazzara/igr/gui/anapath/src/tools/load.hh
@@ -0,0 +1,49 @@
+#ifndef IGR_ANAPATH_SRC_TOOLS_LOAD_HH
+# define IGR_ANAPATH_SRC_TOOLS_LOAD_HH
+
+#include <QtCore>
+
+#include <src/mln_data.hh>
+
+namespace igr
+{
+
+ namespace anapath
+ {
+
+ namespace tools
+ {
+
+
+ class load : public QThread
+ {
+ Q_OBJECT;
+
+ typedef io::magick::large_image<mln::value::rgb8> large_image_t;
+
+ public:
+
+ load(mln_data *data);
+ void start(const QString& filename);
+
+ virtual void run();
+
+ signals:
+ void error(const QString& msg);
+
+ private: // members
+
+ private: // attributes
+ mln_data* data_;
+ QString filename_;
+ };
+
+
+
+ } // end of namespace igr::anapath::tools
+
+ } // end of namespace igr::anapath
+
+} // end of namespace igr
+
+#endif // !IGR_ANAPATH_SRC_TOOLS_LOAD_HH
--
1.5.6.5
Show replies by date