Olena-patches
Threads by month
- ----- 2025 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2011
- 5 participants
- 178 discussions
---
.../core/image/{gimp-image.hh => gimp_image.hh} | 26 +++++++++--
milena/mln/literal/colors.hh | 6 +-
milena/mln/literal/grays.hh | 10 ++++-
scribo/demo/scribogimpplugin/src/main.cc | 45 +++++++++-----------
.../scribogimpplugin/src/preferences_dialog.cc | 16 ++++----
.../scribogimpplugin/src/preferences_dialog.hh | 13 ++----
scribo/demo/scribogimpplugin/src/runner.cc | 23 +++++++---
scribo/demo/scribogimpplugin/src/runner.hh | 16 ++++---
.../binarization/internal/sauvola_formula.hh | 4 +-
9 files changed, 93 insertions(+), 66 deletions(-)
rename milena/mln/core/image/{gimp-image.hh => gimp_image.hh} (97%)
diff --git a/milena/mln/core/image/gimp-image.hh b/milena/mln/core/image/gimp_image.hh
similarity index 97%
rename from milena/mln/core/image/gimp-image.hh
rename to milena/mln/core/image/gimp_image.hh
index 112dc16..56d97bd 100644
--- a/milena/mln/core/image/gimp-image.hh
+++ b/milena/mln/core/image/gimp_image.hh
@@ -33,8 +33,17 @@
/// GIMP image wrapper.
/// \todo Handle mln::duplicate(gimp_image)
+
+# include <iostream>
+# include <sstream>
+
+extern "C"
+{
+// Qt define this macro which collides with GTK symbols.
+//# undef signals
# include <libgimp/gimp.h>
# include <libgimp/gimpui.h>
+}
# include <mln/core/concept/proxy.hh>
# include <mln/core/internal/image_primary.hh>
@@ -51,9 +60,6 @@
# include <mln/core/w_window.hh>
-# include <iostream>
-# include <sstream>
-
namespace mln
{
@@ -331,7 +337,10 @@ namespace mln
/// Gimp Image method
/// Give a hook to the GimpDrawable.
- GimpDrawable* gimp_drawable_();
+ GimpDrawable* gimp_drawable_() const;
+
+ /// Return GimpDrawable's image ID.
+ gint32 gimp_image_id_() const;
};
@@ -519,11 +528,18 @@ namespace mln
template <GimpImageType TI>
GimpDrawable*
- gimp_image<TI>::gimp_drawable_()
+ gimp_image<TI>::gimp_drawable_() const
{
return this->data_->drawable_;
}
+ template <GimpImageType TI>
+ gint32
+ gimp_image<TI>::gimp_image_id_() const
+ {
+ return gimp_drawable_get_image(this->data_->drawable_->drawable_id);
+ }
+
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/literal/colors.hh b/milena/mln/literal/colors.hh
index 099d2c7..64b059d 100644
--- a/milena/mln/literal/colors.hh
+++ b/milena/mln/literal/colors.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -183,9 +183,9 @@ namespace mln
const olive_t& olive = olive_t();
-# endif
+# endif // ! MLN_WO_GLOBAL_VARS
-# endif
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::literal
diff --git a/milena/mln/literal/grays.hh b/milena/mln/literal/grays.hh
index 79aef78..7a7f330 100644
--- a/milena/mln/literal/grays.hh
+++ b/milena/mln/literal/grays.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -61,15 +62,20 @@ namespace mln
/// Literal dark gray.
extern const dark_gray_t& dark_gray;
+
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
const light_gray_t& light_gray = light_gray_t();
const medium_gray_t& medium_gray = medium_gray_t();
const dark_gray_t& dark_gray = dark_gray_t();
-# endif // !MLN_INCLUDE_ONLY
+# endif // ! MLN_WO_GLOBAL_VARS
+
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::literal
diff --git a/scribo/demo/scribogimpplugin/src/main.cc b/scribo/demo/scribogimpplugin/src/main.cc
index 855a6ad..c56d32a 100644
--- a/scribo/demo/scribogimpplugin/src/main.cc
+++ b/scribo/demo/scribogimpplugin/src/main.cc
@@ -1,16 +1,14 @@
#include "config.h"
-extern "C"
-{
-#include <libgimp/gimp.h>
-}
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#undef MLN_WO_GLOBAL_VARS
-#include <gimp-image.hh>
+
+#include <mln/core/image/gimp_image.hh>
+
#include <QApplication>
#include <QMainWindow>
@@ -27,6 +25,7 @@ extern "C"
#include <preferences_dialog.hh>
+
extern "C"
{
static void query_proc(void);
@@ -143,26 +142,17 @@ extern "C"
// Begin of GIMP2Milena image
// ==========================
- // FIXME: move into the switch/case below.
- GimpPixelRgn in;
- gint32 x1, y1, x2, y2;
+ gint32 drawable_id = param[2].data.d_drawable;
+ GimpDrawable *drawable = gimp_drawable_get(drawable_id);
- gint32 drawable_id = param[2].data.d_drawable;
- GimpDrawable *drawable = gimp_drawable_get(drawable_id);
+ typedef mln::gimp_image<GIMP_RGB_IMAGE> I;
- gimp_drawable_mask_bounds(drawable_id, &x1, &y1, &x2, &y2);
- gint32 width = drawable->width;
- gint32 height = drawable->height;
-
- gimp_pixel_rgn_init(&in, drawable, x1, y1, x2, y2, FALSE, FALSE);
-
- typedef mln::gimp_image<GIMP_RGB_IMAGE> I;
- I tmp(&in);
- mln::image2d<mln::value::rgb8> input(height, width);
- std::cout << "Paste data into Olena image" << std::endl;
- mln::data::paste(tmp, input);
- mln::io::ppm::save(input, "/tmp/gimp_out.ppm");
- std::cout << "Paste data into Olena image: Done." << std::endl;
+ mln::util::timer t;
+ t.start();
+ I input(drawable);
+ t.stop();
+ std::cout << "Milena Gimp image built in " << t << "s" << std::endl;
+ t.restart();
// // Create a new image
// gint32 new_image_id = gimp_image_new(width,
@@ -170,7 +160,7 @@ extern "C"
// gimp_image_base_type(param[1].data.d_image));
// /* create new layer */
// gint32 new_layer_id = gimp_layer_new(new_image_id,
- // "titi",
+ // "DIA Output",
// width, height,
// gimp_drawable_type(drawable_id),
// 100,
@@ -210,7 +200,7 @@ extern "C"
case GIMP_RUN_INTERACTIVE:
{
preferences_dialog dialog;
- dialog.set_current_image(input, param[1].data.d_image);
+ dialog.set_current_image(input);
dialog.show();
// Run application.
@@ -238,7 +228,12 @@ extern "C"
}
break;
}
+
+ t.stop();
+ std::cout << "Gimp image processed in " << t << "s" << std::endl;
+
}
+
}
diff --git a/scribo/demo/scribogimpplugin/src/preferences_dialog.cc b/scribo/demo/scribogimpplugin/src/preferences_dialog.cc
index 8daea32..b5253c6 100644
--- a/scribo/demo/scribogimpplugin/src/preferences_dialog.cc
+++ b/scribo/demo/scribogimpplugin/src/preferences_dialog.cc
@@ -28,6 +28,7 @@
#include <mln/data/convert.hh>
#include <mln/data/paste_without_localization.hh>
#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/data/paste.hh>
preferences_dialog::preferences_dialog(QWidget *parent)
@@ -75,10 +76,10 @@ preferences_dialog::~preferences_dialog()
}
-void preferences_dialog::set_current_image(const mln::image2d<mln::value::rgb8>& ima, gint32 image_id)
+void preferences_dialog::set_current_image(const mln::gimp_image<GIMP_RGB_IMAGE>& ima)
{
current_image_ = ima;
- image_id_ = image_id;
+ image_id_ = ima.gimp_image_id_();
}
@@ -192,17 +193,16 @@ void preferences_dialog::diplay_result()
{
std::cout << "Creating result image" << std::endl;
- // Make sure there is not border in input image.
- mln::border::resize(current_image_, 0);
-
// Getting retrieved document.
const scribo::document<L>& doc = runner_.result();
- image2d<value::qt::rgb32> in_32 = data::convert(value::qt::rgb32(), current_image_);
+ image2d<value::rgb8> in_24; // FIXME: to be removed!
+ data::paste(current_image_, in_24);
+ image2d<value::qt::rgb32> in_32 = data::convert(value::qt::rgb32(), in_24);
int
- width = current_image_.bbox().width(),
- height = current_image_.bbox().height();
+ width = current_image_.domain().width(),
+ height = current_image_.domain().height();
// Get active drawable in input image.
gint32 drawable_id = gimp_image_get_active_drawable(image_id_);
diff --git a/scribo/demo/scribogimpplugin/src/preferences_dialog.hh b/scribo/demo/scribogimpplugin/src/preferences_dialog.hh
index 1e6f163..c6e172c 100644
--- a/scribo/demo/scribogimpplugin/src/preferences_dialog.hh
+++ b/scribo/demo/scribogimpplugin/src/preferences_dialog.hh
@@ -18,20 +18,15 @@
#ifndef SCRIBO_DEMO_VIEWER_PREFERENCES_DIALOG_HH
# define SCRIBO_DEMO_VIEWER_PREFERENCES_DIALOG_HH
-extern "C"
-{
-#include <libgimp/gimp.h>
-}
-
+# include <mln/core/image/gimp_image.hh>
-# include <QtGui>
# include <preferences_dialog.ui.h>
# include <runner.hh>
# include <mln/core/image/image2d.hh>
# include <scribo/core/def/lbl_type.hh>
-
+# include <QtGui>
class preferences_dialog : public QDialog, private Ui::PreferencesDialog
{
@@ -43,7 +38,7 @@ public:
preferences_dialog(QWidget *parent = 0);
~preferences_dialog();
- void set_current_image(const mln::image2d<mln::value::rgb8>& ima, gint32 image_id);
+ void set_current_image(const mln::gimp_image<GIMP_RGB_IMAGE>& ima);
private slots:
void on_optionList_currentRowChanged(int row);
@@ -63,7 +58,7 @@ private: // Attributes
runner runner_;
QProgressDialog pdialog_;
- mln::image2d<mln::value::rgb8> current_image_;
+ mln::gimp_image<GIMP_RGB_IMAGE> current_image_;
gint32 image_id_;
};
diff --git a/scribo/demo/scribogimpplugin/src/runner.cc b/scribo/demo/scribogimpplugin/src/runner.cc
index 82e83e2..e91d15c 100644
--- a/scribo/demo/scribogimpplugin/src/runner.cc
+++ b/scribo/demo/scribogimpplugin/src/runner.cc
@@ -16,7 +16,6 @@
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
#include "runner.hh"
-
#include <mln/core/image/image2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/io/magick/load.hh>
@@ -68,7 +67,7 @@ void runner::stop()
// Demat related stuff
void
-runner::start_demat(const image2d<value::rgb8>& image)
+runner::start_demat(const gimp_image<GIMP_RGB_IMAGE>& image)
{
args_.clear();
args_ << image;
@@ -90,7 +89,7 @@ runner::progress_value()
}
image2d<bool>
-runner::preprocess(const image2d<value::rgb8>& ima)
+runner::preprocess(const gimp_image<GIMP_RGB_IMAGE>& ima)
{
emit new_step("Preprocessing");
@@ -114,15 +113,21 @@ runner::preprocess(const image2d<value::rgb8>& ima)
emit new_progress_max_value(f.nsteps());
+
+ // FIXME : to be removed. Used to convert gimp_image
+ image2d<value::rgb8> ima_;
+ mln::initialize(ima_, ima);
+ data::paste(ima, ima_);
+
// Perform preprocessing.
- f(ima);
+ f(ima_);
qDebug() << "Preprocess Done.";
return f.output;
}
-void runner::process(const image2d<value::rgb8>& original_ima,
+void runner::process(const gimp_image<GIMP_RGB_IMAGE>& original_ima,
const image2d<bool>& processed_ima)
{
emit new_step("Page segmentation");
@@ -150,8 +155,14 @@ void runner::process(const image2d<value::rgb8>& original_ima,
emit new_progress_max_value(f.nsteps());
+ // FIXME : to be removed. Used to convert gimp_image
+ image2d<value::rgb8> ima_;
+ mln::initialize(ima_, original_ima);
+ data::paste(original_ima, ima_);
+
+
// Perform text detection.
- f(original_ima, processed_ima);
+ f(ima_, processed_ima);
doc_ = f.doc;
diff --git a/scribo/demo/scribogimpplugin/src/runner.hh b/scribo/demo/scribogimpplugin/src/runner.hh
index d08e1a0..6611b71 100644
--- a/scribo/demo/scribogimpplugin/src/runner.hh
+++ b/scribo/demo/scribogimpplugin/src/runner.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -17,8 +18,10 @@
#ifndef SCRIBO_DEMO_VIEWER_RUNNER_HH
# define SCRIBO_DEMO_VIEWER_RUNNER_HH
-# include <QtGui>
+# include <mln/core/image/gimp_image.hh>
+# include <QtCore>
+# include <QtGui>
# include <mln/core/image/image2d.hh>
# include <mln/value/rgb8.hh>
# include <mln/value/int_u16.hh>
@@ -27,6 +30,7 @@
using namespace mln;
+
enum RunMode
{
Demat,
@@ -42,7 +46,7 @@ public:
runner(QObject *parent = 0);
- void start_demat(const image2d<value::rgb8>& filename);
+ void start_demat(const gimp_image<GIMP_RGB_IMAGE>& filename);
const doc_t& result() const;
@@ -58,14 +62,14 @@ signals:
void finished();
private: // members
- image2d<bool> preprocess(const image2d<value::rgb8>& ima);
- void process(const image2d<value::rgb8>& original_ima,
+ image2d<bool> preprocess(const gimp_image<GIMP_RGB_IMAGE>& ima);
+ void process(const gimp_image<GIMP_RGB_IMAGE>& original_ima,
const image2d<bool>& processed_ima);
virtual void run();
private: // attributes
- QList<image2d<value::rgb8> > args_;
+ QList<gimp_image<GIMP_RGB_IMAGE> > args_;
RunMode mode_;
int step_;
diff --git a/scribo/scribo/binarization/internal/sauvola_formula.hh b/scribo/scribo/binarization/internal/sauvola_formula.hh
index 3251abd..adbef13 100644
--- a/scribo/scribo/binarization/internal/sauvola_formula.hh
+++ b/scribo/scribo/binarization/internal/sauvola_formula.hh
@@ -83,8 +83,8 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
- bool b;
- double skewness_;
+ // bool b;
+ // double skewness_;
inline
double
--
1.7.2.5
1
0
---
plugin-gimp/src/Makefile.am | 2 +-
plugin-gimp/src/gimp-image.hh | 588 -----------------------------------------
plugin-gimp/src/main.cc | 124 +++++-----
3 files changed, 61 insertions(+), 653 deletions(-)
delete mode 100644 plugin-gimp/src/gimp-image.hh
diff --git a/plugin-gimp/src/Makefile.am b/plugin-gimp/src/Makefile.am
index fc30a5a..ccff855 100644
--- a/plugin-gimp/src/Makefile.am
+++ b/plugin-gimp/src/Makefile.am
@@ -22,7 +22,7 @@ milena_CPPFLAGS = \
@GIMP_CFLAGS@ \
-I$(includedir) \
-CXXFLAGS = -g -O0
+CXXFLAGS = -g -O3 -DNDEBUG
LDADD = $(GIMP_LIBS)
diff --git a/plugin-gimp/src/gimp-image.hh b/plugin-gimp/src/gimp-image.hh
deleted file mode 100644
index be0fd4f..0000000
--- a/plugin-gimp/src/gimp-image.hh
+++ /dev/null
@@ -1,588 +0,0 @@
-// Copyright (C) 2007, 2011 EPITA Research and Development Laboratory
-//
-// This file is part of the Milena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING. If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02111-1307, USA.
-//
-// As a special exception, you may use this file as part of a free
-// software library without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to
-// produce an executable, this file does not by itself cause the
-// resulting executable to be covered by the GNU General Public
-// License. This exception does not however invalidate any other
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef __IMAGEGIMP_HH__
-# define __IMAGEGIMP_HH__
-
-# include <libgimp/gimp.h>
-# include <libgimp/gimpui.h>
-
-# include <mln/core/concept/proxy.hh>
-# include <mln/core/internal/image_primary.hh>
-
-# include <mln/core/alias/box2d.hh>
-# include <mln/value/set.hh>
-# include <mln/value/rgb8.hh>
-# include <mln/value/int_u8.hh>
-# include <mln/literal/all.hh>
-
-# include <iostream>
-# include <sstream>
-
-namespace mln
-{
-
- // Fwd decl.
- template <GimpImageType TI> struct gimp_image;
-
- template <typename T1, typename T2>
- struct my_shell
- : public Proxy< my_shell<T1,T2> >,
- public mln::internal::proxy_impl< T1, my_shell<T1,T2> >
- {
- // Equiv
- typedef T1 equiv;
-
- T1 subj_()
- {
- return val_;
- }
-
- my_shell(GimpPixelRgn* rgn, const point2d& p)
- : rgn_(rgn), p_(p)
- {
- gimp_pixel_rgn_get_pixel(rgn_,
- (guchar *) &val_,
- p_.col(), p_.row());
- }
-
- my_shell<T1, T2>& operator=(const T1& nval)
- {
- val_ = nval;
- gimp_pixel_rgn_set_pixel(rgn_,
- (guchar *) &val_,
- p_.col(), p_.row());
- }
-
-
- T1 val_;
- GimpPixelRgn* rgn_;
- point2d p_;
-
- };
-
- namespace internal
- {
-
- /// Trait that give mln type from gimp value tag.
- template <GimpImageType TI>
- struct gimp_value_tag_to_mln
- {
- typedef void type;
- };
-
- template <>
- struct gimp_value_tag_to_mln<GIMP_RGB_IMAGE>
- {
- typedef value::rgb8 type;
- };
-
- template <>
- struct gimp_value_tag_to_mln<GIMP_GRAY_IMAGE>
- {
- typedef value::int_u8 type;
- };
-
-
- template <GimpImageType TI>
- struct data< gimp_image<TI> >
- {
- typedef typename internal::gimp_value_tag_to_mln<TI>::type T;
-
- /// Constructor.
- /// {
- data(GimpPixelRgn* rgn);
- /// }
-
- /// Destructor.
- ~data();
-
- /// Gimp region.
- GimpPixelRgn* rgn_;
-
- guchar *rdata_;
-
- // Columns pointers
- //guchar** array_;
-
- /// theoretical box
- box2d b_;
- };
-
- } // end of namespace mln::internal
-
- namespace trait
- {
-
- template <GimpImageType TI>
- struct image_< gimp_image<TI> > : default_image_< mln::value::rgb8, gimp_image<TI> >
- {
- // misc
- typedef trait::image::category::primary category;
- typedef trait::image::speed::fast speed;
- typedef trait::image::size::regular size;
-
- // value
- typedef trait::image::vw_io::none vw_io;
- typedef trait::image::vw_set::none vw_set;
- typedef trait::image::value_access::computed value_access;
- typedef trait::image::value_storage::one_block value_storage;
- typedef trait::image::value_browsing::site_wise_only value_browsing;
- typedef trait::image::value_alignment::with_grid value_alignment;
- typedef trait::image::value_io::read_write value_io;
-
-
- // site / domain
- typedef trait::image::pw_io::read_write pw_io;
- typedef trait::image::localization::basic_grid localization;
- typedef trait::image::dimension::two_d dimension;
-
- // extended domain
- typedef trait::image::ext_domain::none ext_domain;
- typedef trait::image::ext_value::multiple ext_value;
- typedef trait::image::ext_io::read_only ext_io;
- };
-
- } // end of namespace mln::trait
-
-
-
- /*! \brief Basic 2D image class.
- *
- */
- template <GimpImageType TI>
- struct gimp_image
- : public internal::image_primary<typename internal::gimp_value_tag_to_mln<TI>::type,
- box2d, gimp_image<TI> >
- {
- typedef internal::image_primary<typename internal::gimp_value_tag_to_mln<TI>::type,
- box2d, gimp_image<TI> > super_;
-
- // Warning: just to make effective types appear in Doxygen:
- typedef box2d pset;
- typedef point2d psite;
- typedef point2d point;
- typedef dpoint2d dpoint;
- typedef mln_fwd_piter(box2d) fwd_piter;
- typedef mln_bkd_piter(box2d) bkd_piter;
- // End of warning.
-
- typedef typename internal::gimp_value_tag_to_mln<TI>::type T;
-
- /// Value associated type.
- typedef T value;
-
- /// Return type of read-only access.
- typedef my_shell<T,guchar> rvalue;
-
- /// Return type of read-write access.
- typedef my_shell<T,guchar> lvalue;
-
-
- /// Skeleton.
- typedef gimp_image<TI> skeleton;
-
-
- /// Value_Set associated type.
- typedef mln::value::set<value> vset;
-
-
- /// Constructor without argument.
- gimp_image();
-
- /// Constructor with a gimp region.
- gimp_image(GimpPixelRgn* rgn);
-
- /// Constructor with a box2d.
- gimp_image(box2d box);
-
- /// Constructor with with the numbers of rows and columns.
- gimp_image(int nrows, int ncols);
-
- /// Initialise an image from a gimp region.
- void init_(GimpPixelRgn* rgn);
-
- // /// Initialise an image from a box2d.
- // void init_(box2d box);
-
- /// Test if \p p is valid.
- bool has(const point2d& p) const;
-
- /// Give the set of values of the image.
- const vset& values() const;
-
- /// Give the definition domain.
- const box2d& domain() const;
-
- /// const-only access to the image value located at point \p p.
- rvalue operator()(const point& p) const;
-
- /// Read-write access to the image value located at point \p p.
- lvalue operator()(const point& p);
-
-
- // As a fastest image:
- // -------------------
-
- // // Give the index of a point.
- // unsigned index_of_point(const point& p) const;
-
-
- /// Give the border thickness.
- unsigned border() const;
-
- /// Give the number of elements (points including border ones).
- unsigned nelements() const;
-
- /// Read-only access to the image value located at index \p i.
- rvalue element(unsigned i) const;
-
- /// Read-write access to the image value located at index \p i.
- lvalue element(unsigned i);
-
- /// Give the delta-index corresponding to the delta-point \p dp.
- int delta_index(const dpoint2d& dp) const;
-
- // /// Give the point corresponding to the index \p i.
- // point2d point_at_index(unsigned i) const;
-
- /// Give a hook to the value buffer.
- const guchar* buffer() const;
-
- /// Give a hook to the value buffer.
- guchar* buffer();
-
-
- /// Gimp Image method
-
- /// Give a hook to the GimpPixelRgn.
- GimpPixelRgn* gimp_region();
-
- /// Give a hook to the GimpDrawable.
- GimpDrawable* gimp_drawable();
- };
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- namespace internal
- {
-
- template <GimpImageType TI>
- data< gimp_image<TI> >::data(GimpPixelRgn* rgn)
- : rgn_(rgn)
- {
- mln_assertion(rgn != NULL);
-
- rgn_ = rgn;
-
- rdata_ = rgn->data;
- mln_assertion(rdata_ != 0);
-
- // unsigned
- // nr = b_.height(),
- // nc = b_.width();
- // array_ = new guchar*[nc];
- // guchar* buf = rgn_->data;
- // for (unsigned i = 0; i < nc; ++i)
- // {
- // array_[i] = buf;
- // buf += nr * sizeof(T);
- // }
-
- b_ = make::box2d(rgn->y, rgn->x,
- rgn->y + rgn->h - 1,
- rgn->x + rgn->w - 1);
- }
-
- template <GimpImageType TI>
- data< gimp_image<TI> >::~data()
- {
- // FIXME : Flush!
- }
-
- } // end of namespace mln::internal
-
- // gimp_image<TI>
-
-
- template <GimpImageType TI>
- gimp_image<TI>::gimp_image()
- {
- }
-
- template <GimpImageType TI>
- gimp_image<TI>::gimp_image(GimpPixelRgn* rgn)
- {
- init_(rgn);
- gimp_tile_cache_ntiles(3 * (this->data_->rgn_->w / gimp_tile_width()));
- }
-
- template <GimpImageType TI>
- void
- gimp_image<TI>::init_(GimpPixelRgn* rgn)
- {
- this->data_ = new internal::data< gimp_image<TI> >(rgn);
- }
-
- template <GimpImageType TI>
- const box2d&
- gimp_image<TI>::domain() const
- {
- mln_precondition(this->is_valid());
- return this->data_->b_;
- }
-
- // template <GimpImageType TI>
- // unsigned
- // gimp_image<TI>::index_of_point(const point& p) const
- // {
- // mln_precondition(this->is_valid());
- // mln_precondition(this->has(p));
-
- // unsigned i = (this->operator()(p).address_() - this->buffer()) / sizeof(T);
- // mln_postcondition(p == this->point_at_index(i));
- // return i;
- // }
-
-
- template <GimpImageType TI>
- unsigned
- gimp_image<TI>::border() const
- {
- return 0;
- }
-
- template <GimpImageType TI>
- unsigned
- gimp_image<TI>::nelements() const
- {
- mln_precondition(this->is_valid());
- return this->data_->b_.nsites();
- }
-
- // template <GimpImageType TI>
- // inline
- // typename gimp_image<TI>::rvalue
- // gimp_image<TI>::element(unsigned i) const
- // {
- // mln_precondition(i < nelements());
- // return rvalue(this->data_->rdata_ + 3 * i);
- // }
-
- // template <GimpImageType TI>
- // inline
- // typename gimp_image<TI>::lvalue
- // gimp_image<TI>::element(unsigned i)
- // {
- // mln_precondition(i < nelements());
- // return lvalue(this->data_->rdata_ + 3 * i);
- // }
-
-
- template <GimpImageType TI>
- bool
- gimp_image<TI>::has(const point2d& p) const
- {
- mln_precondition(this->is_valid());
- return this->data_->b_.has(p);
- }
-
- template <GimpImageType TI>
- typename gimp_image<TI>::rvalue
- gimp_image<TI>::operator()(const point& p) const
- {
- mln_precondition(this->has(p));
- // return rvalue(&this->data_->array_[p.col()][p.row() * 3]);
- // return rvalue(this->data_->rdata_ + 3 * (p.row() * this->data_->b_.width() + p.col()));
- // static T c;
- // gimp_pixel_rgn_get_pixel(this->data_->rgn_,
- // (guchar *) &c,
- // p.col(), p.row());
- // return c;
- return rvalue(this->data_->rgn_, p);
- }
-
- template <GimpImageType TI>
- typename gimp_image<TI>::lvalue
- gimp_image<TI>::operator()(const point& p)
- {
- mln_precondition(this->has(p));
- return rvalue(this->data_->rgn_, p);
-// return lvalue(&this->data_->array_[p.col()][p.row() * 3]);
- //return rvalue(this->data_->rdata_ + 3 * (p.row() * this->data_->b_.width() + p.col()));
- }
-
- // template <GimpImageType TI>
- // inline
- // int
- // gimp_image<TI>::delta_index(const dpoint2d& dp) const
- // {
- // mln_precondition(this->is_valid());
- // int o = dp[0] * this->data_->b_.width() * 3 + dp[1] * 3;
- // return o;
- // }
-
- // template <GimpImageType TI>
- // inline
- // point2d
- // gimp_image<TI>::point_at_index(unsigned i) const
- // {
- // mln_precondition(i < nelements());
- // def::coord
- // row = static_cast<def::coord>(i / this->data_->b_.height() + this->data_->b_.min_col()),
- // col = static_cast<def::coord>(i % this->data_->b_.height() + this->data_->b_.min_row());
- // point2d p = point2d(row, col);
- // mln_postcondition(this->operator()(p).address_() == this->data_->rdata_ + sizeof(T) * i);
- // return p;
- // }
-
- // template <GimpImageType TI>
- // const guchar*
- // gimp_image<TI>::buffer() const
- // {
- // return this->data_->rdata_;
- // }
-
-
- // template <GimpImageType TI>
- // guchar*
- // gimp_image<TI>::buffer()
- // {
- // return this->data_->rdata_;
- // }
-
-
- template <GimpImageType TI>
- GimpPixelRgn*
- gimp_image<TI>::gimp_region()
- {
- return this->data_->rgn_;
- }
-
- template <GimpImageType TI>
- GimpDrawable*
- gimp_image<TI>::gimp_drawable()
- {
- return this->data_->rgn_->drawable;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
-
-# include <mln/core/trait/pixter.hh>
-# include <mln/core/dpoints_pixter.hh>
-# include <mln/core/pixter2d.hh>
-# include <mln/core/w_window.hh>
-
-
-namespace mln
-{
-
- namespace trait
- {
-
- // pixter
-
-
- template <GimpImageType TI>
- struct fwd_pixter< gimp_image<TI> >
- {
- typedef fwd_pixter2d< gimp_image<TI> > ret;
- };
-
-
- template <GimpImageType TI>
- struct fwd_pixter< const gimp_image<TI> >
- {
- typedef fwd_pixter2d< const gimp_image<TI> > ret;
- };
-
-
- template <GimpImageType TI>
- struct bkd_pixter< gimp_image<TI> >
- {
- typedef bkd_pixter2d< gimp_image<TI> > ret;
- };
-
-
- template <GimpImageType TI>
- struct bkd_pixter< const gimp_image<TI> >
- {
- typedef bkd_pixter2d< const gimp_image<TI> > ret;
- };
-
- // qixter
-
- template <typename W, GimpImageType TI>
- struct fwd_qixter< gimp_image<TI>, W >
- {
- typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
- };
-
- template <typename W, GimpImageType TI>
- struct fwd_qixter< const gimp_image<TI>, W >
- {
- typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
- };
-
- template <typename W, GimpImageType TI>
- struct bkd_qixter< gimp_image<TI>, W >
- {
- typedef mln::internal::fixme ret;
- };
-
- // nixter
-
- template <typename N, GimpImageType TI>
- struct fwd_nixter< gimp_image<TI>, N >
- {
- typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
- };
-
- template <typename N, GimpImageType TI>
- struct fwd_nixter< const gimp_image<TI>, N >
- {
- typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
- };
-
- template <typename N, GimpImageType TI>
- struct bkd_nixter< gimp_image<TI>, N >
- {
- typedef mln::internal::fixme ret;
- };
-
- } // end of namespace mln::trait
-
-} // end of namespace mln
-
-
-#endif // ! __GIMP_IMAGE_HH__
diff --git a/plugin-gimp/src/main.cc b/plugin-gimp/src/main.cc
index 7af1ffa..703bc9e 100644
--- a/plugin-gimp/src/main.cc
+++ b/plugin-gimp/src/main.cc
@@ -33,11 +33,21 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
-#include "interface.hh"
+#include <mln/util/timer.hh>
+#include <mln/data/fill.hh>
+#include <mln/literal/colors.hh>
+#include <mln/io/ppm/save.hh>
+#include <mln/io/ppm/load.hh>
+#include <mln/core/image/image2d.hh>
+#include <mln/data/paste.hh>
+
+#include <mln/core/image/gimp-image.hh>
+
+//#include "interface.hh"
#include "plugin-intl.hh"
-#include "build-image.hh"
+//#include "build-image.hh"
/* Constants */
@@ -64,7 +74,7 @@ GimpPlugInInfo PLUG_IN_INFO =
int main(int argc, char **argv)
{
int result;
- getchar();
+// getchar();
result = gimp_main(&PLUG_IN_INFO, argc, argv);
return result;
}
@@ -85,9 +95,9 @@ query (void)
"Perform many image processing using Milena library",
"Olena Team <olena(a)lrde.epita.fr>",
"EPITA Research and Development Laboratory (LRDE)",
- "2007-2011",
+ "2011",
N_("Milena toolbox..."),
- "RGB*, GRAY*, INDEXED*",
+ "RGB*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
@@ -107,10 +117,7 @@ run (const gchar *name,
static GimpParam values[1];
GimpDrawable *drawable;
- GimpPixelRgn in, out;
gint32 image_ID;
- gint x1, y1, x2, y2;
- gint width, height;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
@@ -121,62 +128,51 @@ run (const gchar *name,
image_ID = param[1].data.d_int32;
drawable = gimp_drawable_get (param[2].data.d_drawable);
- gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
-
- width = drawable->width;
- height = drawable->height;
-
- gimp_pixel_rgn_init(&out, drawable, 0, 0, width, height, TRUE, TRUE);
- gimp_pixel_rgns_register(1, &out);
-
- std::cout << "Run - with data: " << out.data << std::endl;
-
- I tmp(&out);
-
- //mln::data::fill(tmp, mln::literal::black);
- // mln_piter_(I) p(tmp.domain());
- // for_all(p)
- // tmp(p) = mln::value::rgb8(0, 0, 0);
-
- tmp(mln::point2d(0,0)) = mln::value::rgb8(0, 255, 0);
- tmp(mln::point2d(1,0)) = mln::value::rgb8(0, 255, 0);
- tmp(mln::point2d(0,1)) = mln::value::rgb8(0, 255, 0);
- tmp(mln::point2d(1,1)) = mln::value::rgb8(0, 255, 0);
-
- mln::io::ppm::save(tmp, "/tmp/gimp_image.ppm");
- // std::cout << ".";
- // std::cout << std::endl;
-
-
- // build_milena_image(&in, & out);
-
- // if (strcmp (name, PROCEDURE_NAME) == 0)
- // {
- // switch (run_mode)
- // {
- // case GIMP_RUN_NONINTERACTIVE:
- // break;
-
- // case GIMP_RUN_INTERACTIVE:
- // dialog (image_ID, drawable);
- // break;
-
- // case GIMP_RUN_WITH_LAST_VALS:
- // break;
-
- // default:
- // break;
- // }
- // }
- // else
- // {
- // status = GIMP_PDB_CALLING_ERROR;
- // }
-
- // gimp_drawable_update (drawable->drawable_id, x1, y1, (x2 - x1), (y2 - y1));
-
- // gimp_displays_flush ();
- // gimp_drawable_detach (drawable);
+ guint32 valtype = gimp_drawable_type(drawable->drawable_id);
+ if (valtype == GIMP_RGB_IMAGE)
+ {
+ typedef mln::gimp_image<GIMP_RGB_IMAGE> I;
+ {
+ mln::util::timer t;
+ t.start();
+ I tmp(drawable);
+ t.stop();
+ std::cout << "Milena Gimp image built in " << t << "s" << std::endl;
+ t.restart();
+
+ mln::data::fill(tmp, mln::literal::red);
+
+ t.stop();
+ std::cout << "Gimp image filled in " << t << "s" << std::endl;
+
+ tmp(mln::point2d(0,0)) = mln::value::rgb8(255, 0, 0);
+ tmp(mln::point2d(1,0)) = mln::value::rgb8(0, 0, 255);
+ tmp(mln::point2d(0,1)) = mln::value::rgb8(0, 255, 0);
+ tmp(mln::point2d(1,1)) = mln::value::rgb8(0, 255, 0);
+ }
+ }
+ else if (valtype == GIMP_GRAY_IMAGE)
+ {
+ typedef mln::gimp_image<GIMP_GRAY_IMAGE> I;
+ {
+ mln::util::timer t;
+ t.start();
+ I tmp(drawable);
+ t.stop();
+ std::cout << "Milena Gimp image built in " << t << "s" << std::endl;
+ t.restart();
+
+ mln::data::fill(tmp, 125);
+
+ t.stop();
+ std::cout << "Gimp image filled in " << t << "s" << std::endl;
+
+ tmp(mln::point2d(0,0)) = 64;
+ tmp(mln::point2d(1,0)) = 150;
+ tmp(mln::point2d(0,1)) = 255;
+ tmp(mln::point2d(1,1)) = 0;
+ }
+ }
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
--
1.7.2.5
1
0
---
.../src => milena/mln/core/image}/gimp-image.hh | 466 +++++++++-----------
1 files changed, 205 insertions(+), 261 deletions(-)
copy {plugin-gimp/src => milena/mln/core/image}/gimp-image.hh (64%)
diff --git a/plugin-gimp/src/gimp-image.hh b/milena/mln/core/image/gimp-image.hh
similarity index 64%
copy from plugin-gimp/src/gimp-image.hh
copy to milena/mln/core/image/gimp-image.hh
index be0fd4f..112dc16 100644
--- a/plugin-gimp/src/gimp-image.hh
+++ b/milena/mln/core/image/gimp-image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2011 EPITA Research and Development Laboratory
+// Copyright (C) 2011 EPITA Research and Development Laboratory
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,8 +25,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef __IMAGEGIMP_HH__
-# define __IMAGEGIMP_HH__
+#ifndef MLN_CORE_IMAGE_GIMP_IMAGE_HH
+# define MLN_CORE_IMAGE_GIMP_IMAGE_HH
+
+/// \file
+///
+/// GIMP image wrapper.
+/// \todo Handle mln::duplicate(gimp_image)
# include <libgimp/gimp.h>
# include <libgimp/gimpui.h>
@@ -40,50 +45,95 @@
# include <mln/value/int_u8.hh>
# include <mln/literal/all.hh>
+# include <mln/core/trait/pixter.hh>
+# include <mln/core/dpoints_pixter.hh>
+# include <mln/core/pixter2d.hh>
+# include <mln/core/w_window.hh>
+
+
# include <iostream>
# include <sstream>
namespace mln
{
- // Fwd decl.
+ // Forward declaration.
template <GimpImageType TI> struct gimp_image;
- template <typename T1, typename T2>
- struct my_shell
- : public Proxy< my_shell<T1,T2> >,
- public mln::internal::proxy_impl< T1, my_shell<T1,T2> >
+
+ namespace trait
{
- // Equiv
- typedef T1 equiv;
+ // pixter
- T1 subj_()
+ template <GimpImageType TI>
+ struct fwd_pixter< gimp_image<TI> >
{
- return val_;
- }
+ typedef fwd_pixter2d< gimp_image<TI> > ret;
+ };
- my_shell(GimpPixelRgn* rgn, const point2d& p)
- : rgn_(rgn), p_(p)
+
+ template <GimpImageType TI>
+ struct fwd_pixter< const gimp_image<TI> >
{
- gimp_pixel_rgn_get_pixel(rgn_,
- (guchar *) &val_,
- p_.col(), p_.row());
- }
+ typedef fwd_pixter2d< const gimp_image<TI> > ret;
+ };
+
- my_shell<T1, T2>& operator=(const T1& nval)
+ template <GimpImageType TI>
+ struct bkd_pixter< gimp_image<TI> >
{
- val_ = nval;
- gimp_pixel_rgn_set_pixel(rgn_,
- (guchar *) &val_,
- p_.col(), p_.row());
- }
+ typedef bkd_pixter2d< gimp_image<TI> > ret;
+ };
- T1 val_;
- GimpPixelRgn* rgn_;
- point2d p_;
+ template <GimpImageType TI>
+ struct bkd_pixter< const gimp_image<TI> >
+ {
+ typedef bkd_pixter2d< const gimp_image<TI> > ret;
+ };
+
+ // qixter
+
+ template <typename W, GimpImageType TI>
+ struct fwd_qixter< gimp_image<TI>, W >
+ {
+ typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
+ };
+
+ template <typename W, GimpImageType TI>
+ struct fwd_qixter< const gimp_image<TI>, W >
+ {
+ typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
+ };
+
+ template <typename W, GimpImageType TI>
+ struct bkd_qixter< gimp_image<TI>, W >
+ {
+ typedef mln::internal::fixme ret;
+ };
+
+ // nixter
+
+ template <typename N, GimpImageType TI>
+ struct fwd_nixter< gimp_image<TI>, N >
+ {
+ typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
+ };
+
+ template <typename N, GimpImageType TI>
+ struct fwd_nixter< const gimp_image<TI>, N >
+ {
+ typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
+ };
+
+ template <typename N, GimpImageType TI>
+ struct bkd_nixter< gimp_image<TI>, N >
+ {
+ typedef mln::internal::fixme ret;
+ };
+
+ } // end of namespace mln::trait
- };
namespace internal
{
@@ -115,19 +165,19 @@ namespace mln
/// Constructor.
/// {
- data(GimpPixelRgn* rgn);
+ data(GimpDrawable* drawable);
/// }
/// Destructor.
~data();
/// Gimp region.
- GimpPixelRgn* rgn_;
+ GimpDrawable* drawable_;
- guchar *rdata_;
+ GimpPixelRgn rgn_;
- // Columns pointers
- //guchar** array_;
+ T *rdata_;
+ T** array_;
/// theoretical box
box2d b_;
@@ -143,13 +193,13 @@ namespace mln
{
// misc
typedef trait::image::category::primary category;
- typedef trait::image::speed::fast speed;
+ typedef trait::image::speed::fastest speed;
typedef trait::image::size::regular size;
// value
typedef trait::image::vw_io::none vw_io;
typedef trait::image::vw_set::none vw_set;
- typedef trait::image::value_access::computed value_access;
+ typedef trait::image::value_access::direct value_access;
typedef trait::image::value_storage::one_block value_storage;
typedef trait::image::value_browsing::site_wise_only value_browsing;
typedef trait::image::value_alignment::with_grid value_alignment;
@@ -171,8 +221,11 @@ namespace mln
- /*! \brief Basic 2D image class.
- *
+ /*! \brief GIMP 2D image class.
+
+ \tparam GimpImageType Can take the following values :
+ GIMP_GRAY_IMAGE and GIMP_RGB_IMAGE.
+
*/
template <GimpImageType TI>
struct gimp_image
@@ -197,10 +250,12 @@ namespace mln
typedef T value;
/// Return type of read-only access.
- typedef my_shell<T,guchar> rvalue;
+ //typedef my_shell<T,guchar> rvalue;
+ typedef const T& rvalue;
/// Return type of read-write access.
- typedef my_shell<T,guchar> lvalue;
+ //typedef my_shell<T,guchar> lvalue;
+ typedef T& lvalue;
/// Skeleton.
@@ -214,8 +269,8 @@ namespace mln
/// Constructor without argument.
gimp_image();
- /// Constructor with a gimp region.
- gimp_image(GimpPixelRgn* rgn);
+ /// Constructor with a gimp drawable.
+ gimp_image(GimpDrawable* drawable);
/// Constructor with a box2d.
gimp_image(box2d box);
@@ -223,11 +278,8 @@ namespace mln
/// Constructor with with the numbers of rows and columns.
gimp_image(int nrows, int ncols);
- /// Initialise an image from a gimp region.
- void init_(GimpPixelRgn* rgn);
-
- // /// Initialise an image from a box2d.
- // void init_(box2d box);
+ /// Initialise an image from a gimp drawable.
+ void init_(GimpDrawable* drawable);
/// Test if \p p is valid.
bool has(const point2d& p) const;
@@ -248,9 +300,8 @@ namespace mln
// As a fastest image:
// -------------------
- // // Give the index of a point.
- // unsigned index_of_point(const point& p) const;
-
+ // Give the index of a point.
+ using super_::index_of_point;
/// Give the border thickness.
unsigned border() const;
@@ -268,22 +319,19 @@ namespace mln
int delta_index(const dpoint2d& dp) const;
// /// Give the point corresponding to the index \p i.
- // point2d point_at_index(unsigned i) const;
+ point2d point_at_index(unsigned i) const;
/// Give a hook to the value buffer.
- const guchar* buffer() const;
+ const T* buffer() const;
/// Give a hook to the value buffer.
- guchar* buffer();
+ T* buffer();
/// Gimp Image method
- /// Give a hook to the GimpPixelRgn.
- GimpPixelRgn* gimp_region();
-
/// Give a hook to the GimpDrawable.
- GimpDrawable* gimp_drawable();
+ GimpDrawable* gimp_drawable_();
};
@@ -293,60 +341,76 @@ namespace mln
{
template <GimpImageType TI>
- data< gimp_image<TI> >::data(GimpPixelRgn* rgn)
- : rgn_(rgn)
+ data< gimp_image<TI> >::data(GimpDrawable* drawable)
+ : drawable_(drawable)
{
- mln_assertion(rgn != NULL);
-
- rgn_ = rgn;
-
- rdata_ = rgn->data;
- mln_assertion(rdata_ != 0);
-
- // unsigned
- // nr = b_.height(),
- // nc = b_.width();
- // array_ = new guchar*[nc];
- // guchar* buf = rgn_->data;
- // for (unsigned i = 0; i < nc; ++i)
- // {
- // array_[i] = buf;
- // buf += nr * sizeof(T);
- // }
-
- b_ = make::box2d(rgn->y, rgn->x,
- rgn->y + rgn->h - 1,
- rgn->x + rgn->w - 1);
+ mln_precondition(drawable != NULL);
+
+ gint x1, y1, x2, y2;
+ gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
+
+ gimp_pixel_rgn_init(&rgn_, drawable, x1, y1, x2 - x1, y2 - y1, TRUE, TRUE);
+
+ rdata_ = new T[(x2 - x1) * (y2 - y1)];
+ gimp_pixel_rgn_get_rect(&rgn_, (guchar *)rdata_, x1, y1, (x2 - x1), (y2 - y1));
+
+ b_ = make::box2d(y1, x1, y2 - 1, x2 - 1);
+ array_ = new T*[b_.height()];
+ T* buf = rdata_;
+ for (unsigned i = 0; i < b_.height(); ++i)
+ {
+ array_[i] = buf;
+ buf += b_.width();
+ }
+
}
template <GimpImageType TI>
data< gimp_image<TI> >::~data()
{
- // FIXME : Flush!
+ gint x1, y1, x2, y2;
+ gimp_drawable_mask_bounds (drawable_->drawable_id, &x1, &y1, &x2, &y2);
+
+ gimp_pixel_rgn_set_rect(&rgn_, (guchar *)rdata_,
+ x1, y1,
+ (x2 - x1), (y2 - y1));
+
+ gimp_drawable_flush (drawable_);
+ gimp_drawable_merge_shadow(drawable_->drawable_id, true);
+
+ gimp_drawable_update (drawable_->drawable_id, 0, 0,
+ drawable_->width, drawable_->height);
+
+ gimp_displays_flush();
+ gimp_drawable_detach (drawable_);
+
+ delete[] rdata_;
+ delete[] array_;
}
} // end of namespace mln::internal
- // gimp_image<TI>
+ // gimp_image<TI>
+
template <GimpImageType TI>
gimp_image<TI>::gimp_image()
{
}
template <GimpImageType TI>
- gimp_image<TI>::gimp_image(GimpPixelRgn* rgn)
+ gimp_image<TI>::gimp_image(GimpDrawable* drawable)
{
- init_(rgn);
- gimp_tile_cache_ntiles(3 * (this->data_->rgn_->w / gimp_tile_width()));
+ init_(drawable);
+ gimp_tile_cache_ntiles(3 * (drawable->width / gimp_tile_width()));
}
template <GimpImageType TI>
void
- gimp_image<TI>::init_(GimpPixelRgn* rgn)
+ gimp_image<TI>::init_(GimpDrawable* drawable)
{
- this->data_ = new internal::data< gimp_image<TI> >(rgn);
+ this->data_ = new internal::data< gimp_image<TI> >(drawable);
}
template <GimpImageType TI>
@@ -357,19 +421,6 @@ namespace mln
return this->data_->b_;
}
- // template <GimpImageType TI>
- // unsigned
- // gimp_image<TI>::index_of_point(const point& p) const
- // {
- // mln_precondition(this->is_valid());
- // mln_precondition(this->has(p));
-
- // unsigned i = (this->operator()(p).address_() - this->buffer()) / sizeof(T);
- // mln_postcondition(p == this->point_at_index(i));
- // return i;
- // }
-
-
template <GimpImageType TI>
unsigned
gimp_image<TI>::border() const
@@ -385,23 +436,23 @@ namespace mln
return this->data_->b_.nsites();
}
- // template <GimpImageType TI>
- // inline
- // typename gimp_image<TI>::rvalue
- // gimp_image<TI>::element(unsigned i) const
- // {
- // mln_precondition(i < nelements());
- // return rvalue(this->data_->rdata_ + 3 * i);
- // }
-
- // template <GimpImageType TI>
- // inline
- // typename gimp_image<TI>::lvalue
- // gimp_image<TI>::element(unsigned i)
- // {
- // mln_precondition(i < nelements());
- // return lvalue(this->data_->rdata_ + 3 * i);
- // }
+ template <GimpImageType TI>
+ inline
+ typename gimp_image<TI>::rvalue
+ gimp_image<TI>::element(unsigned i) const
+ {
+ mln_precondition(i < nelements());
+ return *(this->data_->rdata_ + this->data_->drawable_->bpp * i);
+ }
+
+ template <GimpImageType TI>
+ inline
+ typename gimp_image<TI>::lvalue
+ gimp_image<TI>::element(unsigned i)
+ {
+ mln_precondition(i < nelements());
+ return *(this->data_->rdata_ + this->data_->drawable_->bpp * i);
+ }
template <GimpImageType TI>
@@ -417,14 +468,7 @@ namespace mln
gimp_image<TI>::operator()(const point& p) const
{
mln_precondition(this->has(p));
- // return rvalue(&this->data_->array_[p.col()][p.row() * 3]);
- // return rvalue(this->data_->rdata_ + 3 * (p.row() * this->data_->b_.width() + p.col()));
- // static T c;
- // gimp_pixel_rgn_get_pixel(this->data_->rgn_,
- // (guchar *) &c,
- // p.col(), p.row());
- // return c;
- return rvalue(this->data_->rgn_, p);
+ return this->data_->array_[p.row()][p.col()];
}
template <GimpImageType TI>
@@ -432,157 +476,57 @@ namespace mln
gimp_image<TI>::operator()(const point& p)
{
mln_precondition(this->has(p));
- return rvalue(this->data_->rgn_, p);
-// return lvalue(&this->data_->array_[p.col()][p.row() * 3]);
- //return rvalue(this->data_->rdata_ + 3 * (p.row() * this->data_->b_.width() + p.col()));
+ return this->data_->array_[p.row()][p.col()];
}
- // template <GimpImageType TI>
- // inline
- // int
- // gimp_image<TI>::delta_index(const dpoint2d& dp) const
- // {
- // mln_precondition(this->is_valid());
- // int o = dp[0] * this->data_->b_.width() * 3 + dp[1] * 3;
- // return o;
- // }
-
- // template <GimpImageType TI>
- // inline
- // point2d
- // gimp_image<TI>::point_at_index(unsigned i) const
- // {
- // mln_precondition(i < nelements());
- // def::coord
- // row = static_cast<def::coord>(i / this->data_->b_.height() + this->data_->b_.min_col()),
- // col = static_cast<def::coord>(i % this->data_->b_.height() + this->data_->b_.min_row());
- // point2d p = point2d(row, col);
- // mln_postcondition(this->operator()(p).address_() == this->data_->rdata_ + sizeof(T) * i);
- // return p;
- // }
-
- // template <GimpImageType TI>
- // const guchar*
- // gimp_image<TI>::buffer() const
- // {
- // return this->data_->rdata_;
- // }
-
-
- // template <GimpImageType TI>
- // guchar*
- // gimp_image<TI>::buffer()
- // {
- // return this->data_->rdata_;
- // }
-
-
template <GimpImageType TI>
- GimpPixelRgn*
- gimp_image<TI>::gimp_region()
+ inline
+ int
+ gimp_image<TI>::delta_index(const dpoint2d& dp) const
{
- return this->data_->rgn_;
+ mln_precondition(this->is_valid());
+ int o = (dp[0] * this->data_->b_.width() + dp[1]) * this->data_->drawable_->bpp;
+ return o;
}
template <GimpImageType TI>
- GimpDrawable*
- gimp_image<TI>::gimp_drawable()
+ inline
+ point2d
+ gimp_image<TI>::point_at_index(unsigned i) const
{
- return this->data_->rgn_->drawable;
+ mln_precondition(i < nelements());
+ def::coord
+ row = static_cast<def::coord>(i / this->data_->b_.width() + this->data_->b_.min_row()),
+ col = static_cast<def::coord>(i % this->data_->b_.width() + this->data_->b_.min_col());
+ point2d p = point2d(row, col);
+ mln_postcondition(& this->operator()(p) == this->data_->rdata_ + i);
+ return p;
}
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
-
-# include <mln/core/trait/pixter.hh>
-# include <mln/core/dpoints_pixter.hh>
-# include <mln/core/pixter2d.hh>
-# include <mln/core/w_window.hh>
-
-
-namespace mln
-{
-
- namespace trait
+ template <GimpImageType TI>
+ const typename gimp_image<TI>::T*
+ gimp_image<TI>::buffer() const
{
+ return this->data_->rdata_;
+ }
- // pixter
-
-
- template <GimpImageType TI>
- struct fwd_pixter< gimp_image<TI> >
- {
- typedef fwd_pixter2d< gimp_image<TI> > ret;
- };
-
-
- template <GimpImageType TI>
- struct fwd_pixter< const gimp_image<TI> >
- {
- typedef fwd_pixter2d< const gimp_image<TI> > ret;
- };
-
-
- template <GimpImageType TI>
- struct bkd_pixter< gimp_image<TI> >
- {
- typedef bkd_pixter2d< gimp_image<TI> > ret;
- };
-
-
- template <GimpImageType TI>
- struct bkd_pixter< const gimp_image<TI> >
- {
- typedef bkd_pixter2d< const gimp_image<TI> > ret;
- };
-
- // qixter
-
- template <typename W, GimpImageType TI>
- struct fwd_qixter< gimp_image<TI>, W >
- {
- typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
- };
-
- template <typename W, GimpImageType TI>
- struct fwd_qixter< const gimp_image<TI>, W >
- {
- typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
- };
-
- template <typename W, GimpImageType TI>
- struct bkd_qixter< gimp_image<TI>, W >
- {
- typedef mln::internal::fixme ret;
- };
-
- // nixter
-
- template <typename N, GimpImageType TI>
- struct fwd_nixter< gimp_image<TI>, N >
- {
- typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
- };
+ template <GimpImageType TI>
+ typename gimp_image<TI>::T*
+ gimp_image<TI>::buffer()
+ {
+ return this->data_->rdata_;
+ }
- template <typename N, GimpImageType TI>
- struct fwd_nixter< const gimp_image<TI>, N >
- {
- typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
- };
+ template <GimpImageType TI>
+ GimpDrawable*
+ gimp_image<TI>::gimp_drawable_()
+ {
+ return this->data_->drawable_;
+ }
- template <typename N, GimpImageType TI>
- struct bkd_nixter< gimp_image<TI>, N >
- {
- typedef mln::internal::fixme ret;
- };
- } // end of namespace mln::trait
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
-
-#endif // ! __GIMP_IMAGE_HH__
+#endif // ! MLN_CORE_IMAGE_GIMP_IMAGE_HH
--
1.7.2.5
1
0
---
milena/mln/convert/from_to.hxx | 4 +
milena/mln/tag/skeleton.hh | 3 +-
milena/mln/value/qt/rgb32.hh | 16 +-
.../nivault/plugin-gimp => plugin-gimp}/.gitignore | 0
.../nivault/plugin-gimp => plugin-gimp}/AUTHORS | 0
.../nivault/plugin-gimp => plugin-gimp}/COPYING | 0
.../nivault/plugin-gimp => plugin-gimp}/ChangeLog | 0
.../nivault/plugin-gimp => plugin-gimp}/HACKING | 0
.../nivault/plugin-gimp => plugin-gimp}/INSTALL | 0
.../plugin-gimp => plugin-gimp}/Makefile.am | 0
.../nivault/plugin-gimp => plugin-gimp}/TODO | 0
.../nivault/plugin-gimp => plugin-gimp}/autogen.sh | 0
plugin-gimp/configure.ac | 125 ++
.../plugin-gimp => plugin-gimp}/help/Makefile.am | 0
.../help/en/Makefile.am | 0
.../help/en/gimp-help.xml | 0
.../plugin-gimp => plugin-gimp}/help/en/index.html | 0
.../help/images/Makefile.am | 0
.../help/images/wilber.png | Bin 5022 -> 5022 bytes
.../plugin-gimp => plugin-gimp}/po/ChangeLog | 0
.../po/POTFILES.in | 0
.../nivault/plugin-gimp => plugin-gimp}/po/az.po | 0
.../nivault/plugin-gimp => plugin-gimp}/po/de.po | 0
.../nivault/plugin-gimp => plugin-gimp}/po/fr.po | 0
.../nivault/plugin-gimp => plugin-gimp}/po/sk.po | 0
.../nivault/plugin-gimp => plugin-gimp}/po/sv.po | 0
plugin-gimp/src/Makefile.am | 28 +
.../plugin-gimp => plugin-gimp}/src/build-image.hh | 0
plugin-gimp/src/build-image.hxx | 113 ++
plugin-gimp/src/gimp-image.hh | 588 +++++++
.../plugin-gimp => plugin-gimp}/src/interface.hh | 0
plugin-gimp/src/interface.hxx | 95 ++
plugin-gimp/src/main.cc | 183 +++
plugin-gimp/src/main2.cc | 83 +
.../plugin-gimp => plugin-gimp}/src/plugin-intl.hh | 0
plugins/olena.c | 75 +
.../demo/scribogimpplugin/AUTHORS | 0
scribo/demo/scribogimpplugin/COPYING | 674 ++++++++
.../demo/scribogimpplugin/ChangeLog | 0
INSTALL => scribo/demo/scribogimpplugin/INSTALL | 0
scribo/demo/scribogimpplugin/Makefile.am | 15 +
.../demo/scribogimpplugin/NEWS | 0
.../demo/scribogimpplugin/README | 0
scribo/demo/scribogimpplugin/aclocal.m4 | 1607 ++++++++++++++++++++
scribo/demo/scribogimpplugin/autogen.sh | 188 +++
.../demo/scribogimpplugin/build-aux}/autotroll.mk | 0
scribo/demo/scribogimpplugin/configure.ac | 158 ++
.../demo/scribogimpplugin}/help/Makefile.am | 0
.../demo/scribogimpplugin}/help/en/Makefile.am | 0
.../demo/scribogimpplugin}/help/en/gimp-help.xml | 0
.../demo/scribogimpplugin}/help/en/index.html | 0
.../demo/scribogimpplugin}/help/images/Makefile.am | 0
.../demo/scribogimpplugin}/help/images/wilber.png | Bin 5022 -> 5022 bytes
.../demo/scribogimpplugin/m4}/autotroll.m4 | 0
scribo/demo/scribogimpplugin/m4/intltool.m4 | 216 +++
.../demo/scribogimpplugin/m4}/oln-with-lib.m4 | 0
.../demo/scribogimpplugin/po/POTFILES.in | 0
.../demo/scribogimpplugin}/po/az.po | 0
.../demo/scribogimpplugin}/po/de.po | 0
.../demo/scribogimpplugin}/po/fr.po | 0
.../demo/scribogimpplugin}/po/sk.po | 0
.../demo/scribogimpplugin}/po/sv.po | 0
scribo/demo/scribogimpplugin/src/Makefile.am | 75 +
.../demo/scribogimpplugin}/src/build-image.hh | 0
scribo/demo/scribogimpplugin/src/build-image.hxx | 103 ++
.../{viewer => scribogimpplugin/src}/config.cc | 0
.../{viewer => scribogimpplugin/src}/config.hh | 0
.../demo/scribogimpplugin/src/general_options.cc | 39 +
.../demo/scribogimpplugin/src/general_options.hh | 38 +
.../demo/scribogimpplugin/src/general_options.ui | 56 +
scribo/demo/scribogimpplugin/src/gimp-image.hh | 471 ++++++
scribo/demo/scribogimpplugin/src/main.cc | 323 ++++
scribo/demo/scribogimpplugin/src/ocr_options.cc | 1 +
scribo/demo/scribogimpplugin/src/ocr_options.hh | 1 +
scribo/demo/scribogimpplugin/src/ocr_options.ui | 1 +
scribo/demo/scribogimpplugin/src/option_widget.cc | 1 +
scribo/demo/scribogimpplugin/src/option_widget.hh | 1 +
.../scribogimpplugin/src/preferences_dialog.cc | 326 ++++
.../scribogimpplugin/src/preferences_dialog.hh | 70 +
.../scribogimpplugin/src/preferences_dialog.ui | 121 ++
scribo/demo/scribogimpplugin/src/preprocess.cc | 1 +
scribo/demo/scribogimpplugin/src/preprocess.hh | 1 +
.../scribogimpplugin/src/preprocessing_options.cc | 1 +
.../scribogimpplugin/src/preprocessing_options.hh | 1 +
.../scribogimpplugin/src/preprocessing_options.ui | 1 +
scribo/demo/scribogimpplugin/src/process.cc | 1 +
scribo/demo/scribogimpplugin/src/process.hh | 1 +
scribo/demo/scribogimpplugin/src/runner.cc | 161 ++
scribo/demo/scribogimpplugin/src/runner.hh | 76 +
.../scribogimpplugin/src/segmentation_options.cc | 1 +
.../scribogimpplugin/src/segmentation_options.hh | 1 +
.../scribogimpplugin/src/segmentation_options.ui | 1 +
92 files changed, 6043 insertions(+), 2 deletions(-)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/.gitignore (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/AUTHORS (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/COPYING (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/ChangeLog (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/HACKING (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/INSTALL (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/TODO (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/autogen.sh (100%)
create mode 100644 plugin-gimp/configure.ac
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/help/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/help/en/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/help/en/gimp-help.xml (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/help/en/index.html (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/help/images/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/help/images/wilber.png (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/po/ChangeLog (100%)
copy milena/doc/outputs/accu-right-instantiation.txt => plugin-gimp/po/POTFILES.in (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/po/az.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/po/de.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/po/fr.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/po/sk.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/po/sv.po (100%)
create mode 100644 plugin-gimp/src/Makefile.am
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/src/build-image.hh (100%)
create mode 100644 plugin-gimp/src/build-image.hxx
create mode 100644 plugin-gimp/src/gimp-image.hh
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/src/interface.hh (100%)
create mode 100644 plugin-gimp/src/interface.hxx
create mode 100644 plugin-gimp/src/main.cc
create mode 100644 plugin-gimp/src/main2.cc
copy {milena/sandbox/nivault/plugin-gimp => plugin-gimp}/src/plugin-intl.hh (100%)
create mode 100644 plugins/olena.c
copy milena/doc/outputs/accu-right-instantiation.txt => scribo/demo/scribogimpplugin/AUTHORS (100%)
create mode 100644 scribo/demo/scribogimpplugin/COPYING
copy milena/doc/outputs/accu-right-instantiation.txt => scribo/demo/scribogimpplugin/ChangeLog (100%)
copy INSTALL => scribo/demo/scribogimpplugin/INSTALL (100%)
create mode 100644 scribo/demo/scribogimpplugin/Makefile.am
copy milena/doc/outputs/accu-right-instantiation.txt => scribo/demo/scribogimpplugin/NEWS (100%)
copy milena/doc/outputs/accu-right-instantiation.txt => scribo/demo/scribogimpplugin/README (100%)
create mode 100644 scribo/demo/scribogimpplugin/aclocal.m4
create mode 100755 scribo/demo/scribogimpplugin/autogen.sh
copy {build-aux => scribo/demo/scribogimpplugin/build-aux}/autotroll.mk (100%)
create mode 100644 scribo/demo/scribogimpplugin/configure.ac
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/help/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/help/en/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/help/en/gimp-help.xml (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/help/en/index.html (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/help/images/Makefile.am (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/help/images/wilber.png (100%)
copy {m4 => scribo/demo/scribogimpplugin/m4}/autotroll.m4 (100%)
create mode 100644 scribo/demo/scribogimpplugin/m4/intltool.m4
copy {m4 => scribo/demo/scribogimpplugin/m4}/oln-with-lib.m4 (100%)
copy milena/doc/outputs/accu-right-instantiation.txt => scribo/demo/scribogimpplugin/po/POTFILES.in (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/po/az.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/po/de.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/po/fr.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/po/sk.po (100%)
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/po/sv.po (100%)
create mode 100644 scribo/demo/scribogimpplugin/src/Makefile.am
copy {milena/sandbox/nivault/plugin-gimp => scribo/demo/scribogimpplugin}/src/build-image.hh (100%)
create mode 100644 scribo/demo/scribogimpplugin/src/build-image.hxx
copy scribo/demo/{viewer => scribogimpplugin/src}/config.cc (100%)
copy scribo/demo/{viewer => scribogimpplugin/src}/config.hh (100%)
create mode 100644 scribo/demo/scribogimpplugin/src/general_options.cc
create mode 100644 scribo/demo/scribogimpplugin/src/general_options.hh
create mode 100644 scribo/demo/scribogimpplugin/src/general_options.ui
create mode 100644 scribo/demo/scribogimpplugin/src/gimp-image.hh
create mode 100644 scribo/demo/scribogimpplugin/src/main.cc
create mode 120000 scribo/demo/scribogimpplugin/src/ocr_options.cc
create mode 120000 scribo/demo/scribogimpplugin/src/ocr_options.hh
create mode 120000 scribo/demo/scribogimpplugin/src/ocr_options.ui
create mode 120000 scribo/demo/scribogimpplugin/src/option_widget.cc
create mode 120000 scribo/demo/scribogimpplugin/src/option_widget.hh
create mode 100644 scribo/demo/scribogimpplugin/src/preferences_dialog.cc
create mode 100644 scribo/demo/scribogimpplugin/src/preferences_dialog.hh
create mode 100644 scribo/demo/scribogimpplugin/src/preferences_dialog.ui
create mode 120000 scribo/demo/scribogimpplugin/src/preprocess.cc
create mode 120000 scribo/demo/scribogimpplugin/src/preprocess.hh
create mode 120000 scribo/demo/scribogimpplugin/src/preprocessing_options.cc
create mode 120000 scribo/demo/scribogimpplugin/src/preprocessing_options.hh
create mode 120000 scribo/demo/scribogimpplugin/src/preprocessing_options.ui
create mode 120000 scribo/demo/scribogimpplugin/src/process.cc
create mode 120000 scribo/demo/scribogimpplugin/src/process.hh
create mode 100644 scribo/demo/scribogimpplugin/src/runner.cc
create mode 100644 scribo/demo/scribogimpplugin/src/runner.hh
create mode 120000 scribo/demo/scribogimpplugin/src/segmentation_options.cc
create mode 120000 scribo/demo/scribogimpplugin/src/segmentation_options.hh
create mode 120000 scribo/demo/scribogimpplugin/src/segmentation_options.ui
diff --git a/milena/mln/convert/from_to.hxx b/milena/mln/convert/from_to.hxx
index 7891e9a..5e1da48 100644
--- a/milena/mln/convert/from_to.hxx
+++ b/milena/mln/convert/from_to.hxx
@@ -187,6 +187,10 @@ namespace mln
template <unsigned m>
void from_to_(const value::int_u<m>& from, value::rgb<m>& to);
+ // rgb8 -> rgb.
+ template <unsigned m>
+ void from_to_(const value::rgb<8>& from, value::qt::rgb32& to);
+
// int_u -> qt::rgb32.
template <unsigned m>
void from_to_(const value::int_u<m>& from, value::qt::rgb32& to);
diff --git a/milena/mln/tag/skeleton.hh b/milena/mln/tag/skeleton.hh
index f446317..8af8cd8 100644
--- a/milena/mln/tag/skeleton.hh
+++ b/milena/mln/tag/skeleton.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/value/qt/rgb32.hh b/milena/mln/value/qt/rgb32.hh
index 511d6a7..38536dd 100644
--- a/milena/mln/value/qt/rgb32.hh
+++ b/milena/mln/value/qt/rgb32.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -82,6 +83,10 @@ namespace mln
namespace over_load
{
+ // rgb8 -> rgb.
+ template <unsigned m>
+ void from_to_(const value::rgb8& from, value::qt::rgb32& to);
+
// int_u -> rgb.
template <unsigned m>
void from_to_(const value::int_u<m>& from, value::qt::rgb32& to);
@@ -763,6 +768,15 @@ namespace mln
namespace over_load
{
+ // rgb8 -> qt::rgb32
+ template <unsigned m>
+ void
+ from_to_(const value::rgb8& from, value::qt::rgb32& to)
+ {
+ to = value::qt::rgb32(from.red(), from.green(), from.blue());
+ }
+
+
// int_u -> qt::rgb32
template <unsigned m>
void
diff --git a/milena/sandbox/nivault/plugin-gimp/.gitignore b/plugin-gimp/.gitignore
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/.gitignore
copy to plugin-gimp/.gitignore
diff --git a/milena/sandbox/nivault/plugin-gimp/AUTHORS b/plugin-gimp/AUTHORS
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/AUTHORS
copy to plugin-gimp/AUTHORS
diff --git a/milena/sandbox/nivault/plugin-gimp/COPYING b/plugin-gimp/COPYING
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/COPYING
copy to plugin-gimp/COPYING
diff --git a/milena/sandbox/nivault/plugin-gimp/ChangeLog b/plugin-gimp/ChangeLog
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/ChangeLog
copy to plugin-gimp/ChangeLog
diff --git a/milena/sandbox/nivault/plugin-gimp/HACKING b/plugin-gimp/HACKING
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/HACKING
copy to plugin-gimp/HACKING
diff --git a/milena/sandbox/nivault/plugin-gimp/INSTALL b/plugin-gimp/INSTALL
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/INSTALL
copy to plugin-gimp/INSTALL
diff --git a/milena/sandbox/nivault/plugin-gimp/Makefile.am b/plugin-gimp/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/Makefile.am
copy to plugin-gimp/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/TODO b/plugin-gimp/TODO
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/TODO
copy to plugin-gimp/TODO
diff --git a/milena/sandbox/nivault/plugin-gimp/autogen.sh b/plugin-gimp/autogen.sh
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/autogen.sh
copy to plugin-gimp/autogen.sh
diff --git a/plugin-gimp/configure.ac b/plugin-gimp/configure.ac
new file mode 100644
index 0000000..7937d58
--- /dev/null
+++ b/plugin-gimp/configure.ac
@@ -0,0 +1,125 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.54)
+
+dnl Name your plug-in here
+m4_define([plugin_name], [gimp-plugin-milena])
+
+dnl These three define the plug-in version number
+m4_define([plugin_major_version], [0])
+m4_define([plugin_minor_version], [1])
+
+m4_define([plugin_version],
+ [plugin_major_version.plugin_minor_version.plugin_micro_version])
+
+AC_INIT([plugin_name], [plugin_version])
+
+AC_DEFINE(PLUGIN_NAME, PACKAGE_NAME, [Plug-In name])
+AC_DEFINE(PLUGIN_VERSION, PACKAGE_VERSION, [Plug-In version])
+
+AC_DEFINE(PLUGIN_MAJOR_VERSION, plugin_major_version, [Plug-In major version])
+AC_DEFINE(PLUGIN_MINOR_VERSION, plugin_minor_version, [Plug-In minor version])
+AC_DEFINE(PLUGIN_MICRO_VERSION, plugin_micro_version, [Plug-In micro version])
+
+AC_CONFIG_SRCDIR([src/main.cc])
+AM_CONFIG_HEADER(config.h)
+
+AM_INIT_AUTOMAKE([no-define foreign])
+
+AC_ISC_POSIX
+AC_LANG([C++])
+AC_PROG_CXX
+#AC_LANG([C])
+#AC_PROG_CC
+#AM_PROG_CC_STDC
+AC_HEADER_STDC
+
+
+ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+
+AM_MAINTAINER_MODE
+
+
+dnl Use -Wall if we have gcc.
+changequote(,)dnl
+if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) CFLAGS="$CFLAGS -Wall" ;;
+ esac
+fi
+changequote([,])dnl
+
+
+GIMP_REQUIRED_VERSION=2.2.0
+
+PKG_CHECK_MODULES(GIMP,
+ gimp-2.0 >= $GIMP_REQUIRED_VERSION gimpui-2.0 >= $GIMP_REQUIRED_VERSION)
+
+AC_SUBST(GIMP_CFLAGS)
+AC_SUBST(GIMP_LIBS)
+
+#GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0`
+GIMP_LIBDIR=`echo ~/.gimp-2.4`
+AC_SUBST(GIMP_LIBDIR)
+
+
+dnl i18n stuff
+
+GETTEXT_PACKAGE=gimp20-plugin-template
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
+ [The gettext translation domain.])
+
+dnl Add the languages which your application supports here.
+ALL_LINGUAS="az de fr sk sv zh_TW"
+
+AC_PROG_INTLTOOL
+AM_GLIB_GNU_GETTEXT
+
+AC_CHECK_FUNCS(bind_textdomain_codeset)
+
+LOCALEDIR='${datadir}/locale'
+DATADIR='${datadir}/plugin_name'
+
+AC_SUBST(LOCALEDIR)
+AC_SUBST(DATADIR)
+
+
+AC_MSG_CHECKING([if GTK+ is version 2.7.0 or newer])
+if $PKG_CONFIG --atleast-version=2.7.0 gtk+-2.0; then
+ have_gtk_2_7=yes
+else
+ have_gtk_2_7=no
+fi
+AC_MSG_RESULT($have_gtk_2_7)
+
+if test "x$have_gtk_2_7" != "xyes"; then
+ CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+fi
+
+
+AC_MSG_CHECKING([if GIMP is version 2.3.0 or newer])
+if $PKG_CONFIG --atleast-version=2.3.0 gimp-2.0; then
+ have_gimp_2_3=yes
+else
+ have_gimp_2_3=no
+fi
+AC_MSG_RESULT($have_gimp_2_3)
+
+if test "x$have_gimp_2_3" != "xyes"; then
+ CPPFLAGS="$CPPFLAGS -DGIMP_DISABLE_DEPRECATED"
+fi
+
+
+
+AC_CONFIG_FILES([
+Makefile
+po/Makefile.in
+src/Makefile
+help/Makefile
+help/en/Makefile
+help/images/Makefile
+])
+
+AC_OUTPUT
diff --git a/milena/sandbox/nivault/plugin-gimp/help/Makefile.am b/plugin-gimp/help/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/Makefile.am
copy to plugin-gimp/help/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/help/en/Makefile.am b/plugin-gimp/help/en/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/en/Makefile.am
copy to plugin-gimp/help/en/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/help/en/gimp-help.xml b/plugin-gimp/help/en/gimp-help.xml
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/en/gimp-help.xml
copy to plugin-gimp/help/en/gimp-help.xml
diff --git a/milena/sandbox/nivault/plugin-gimp/help/en/index.html b/plugin-gimp/help/en/index.html
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/en/index.html
copy to plugin-gimp/help/en/index.html
diff --git a/milena/sandbox/nivault/plugin-gimp/help/images/Makefile.am b/plugin-gimp/help/images/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/images/Makefile.am
copy to plugin-gimp/help/images/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/help/images/wilber.png b/plugin-gimp/help/images/wilber.png
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/images/wilber.png
copy to plugin-gimp/help/images/wilber.png
diff --git a/milena/sandbox/nivault/plugin-gimp/po/ChangeLog b/plugin-gimp/po/ChangeLog
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/ChangeLog
copy to plugin-gimp/po/ChangeLog
diff --git a/milena/doc/outputs/accu-right-instantiation.txt b/plugin-gimp/po/POTFILES.in
similarity index 100%
copy from milena/doc/outputs/accu-right-instantiation.txt
copy to plugin-gimp/po/POTFILES.in
diff --git a/milena/sandbox/nivault/plugin-gimp/po/az.po b/plugin-gimp/po/az.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/az.po
copy to plugin-gimp/po/az.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/de.po b/plugin-gimp/po/de.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/de.po
copy to plugin-gimp/po/de.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/fr.po b/plugin-gimp/po/fr.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/fr.po
copy to plugin-gimp/po/fr.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/sk.po b/plugin-gimp/po/sk.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/sk.po
copy to plugin-gimp/po/sk.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/sv.po b/plugin-gimp/po/sv.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/sv.po
copy to plugin-gimp/po/sv.po
diff --git a/plugin-gimp/src/Makefile.am b/plugin-gimp/src/Makefile.am
new file mode 100644
index 0000000..fc30a5a
--- /dev/null
+++ b/plugin-gimp/src/Makefile.am
@@ -0,0 +1,28 @@
+## Process this file with automake to produce Makefile.in
+
+bin_PROGRAMS = milena
+
+bindir = $(GIMP_LIBDIR)/plug-ins
+
+INCS = build-image.hh \
+ build-image.hxx \
+ gimp-image.hh \
+ plugin-intl.hh \
+ interface.hxx \
+ interface.hh
+
+milena_SOURCES = main.cc \
+ $(INCS)
+
+milena_CPPFLAGS = \
+ -DLOCALEDIR=\""$(LOCALEDIR)"\" \
+ -DDATADIR=\""$(DATADIR)"\" \
+ -I$(top_srcdir) \
+ -I$(OLN)/milena \
+ @GIMP_CFLAGS@ \
+ -I$(includedir) \
+
+CXXFLAGS = -g -O0
+
+LDADD = $(GIMP_LIBS)
+
diff --git a/milena/sandbox/nivault/plugin-gimp/src/build-image.hh b/plugin-gimp/src/build-image.hh
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/src/build-image.hh
copy to plugin-gimp/src/build-image.hh
diff --git a/plugin-gimp/src/build-image.hxx b/plugin-gimp/src/build-image.hxx
new file mode 100644
index 0000000..c4092d3
--- /dev/null
+++ b/plugin-gimp/src/build-image.hxx
@@ -0,0 +1,113 @@
+/* GIMP Plug-in Template
+ * Copyright (C) 2000-2004 Michael Natterer <mitch(a)gimp.org> (the "Author").
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Author of the
+ * Software shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Author.
+ */
+
+#include "build-image.hh"
+
+typedef mln::gimp_image<GIMP_RGB_IMAGE> I;
+
+static I ima;
+
+const I& get_ima()
+{
+ return ima;
+}
+
+struct toto : mln::Function_v2v<toto>
+{
+ typedef mln::value::rgb8 result;
+ mln::value::rgb8 operator()(const mln::value::rgb8& c) const
+ {
+ return mln::value::rgb8(255 - c.red(), 255 - c.green(), 255 - c.blue());
+ }
+};
+
+void build_milena_image(GimpPixelRgn *in,
+ GimpPixelRgn *out)
+{
+ (void) out;
+ I tmp(in);
+// g_message(region->dirty ? "saaale" : "pas saaale");
+// g_message(region->shadow ? "shadoooow" : "pas shadoooow");
+ ima = tmp;
+
+ mln_piter_(I) p(ima.domain());
+ for_all(p)
+ std::cout << ".";
+ std::cout << std::endl;
+
+ mln::point2d p1(0,0);
+ mln::point2d p2(0,5);
+ mln::point2d p3(20,50);
+// mln::io::ppm::save(ima, "/goinfre/out.ppm");
+ std::cout << p1 << " : " << ima(p1) << std::endl;
+ std::cout << p2 << " : " << ima(p2) << std::endl;
+ std::cout << p3 << " : " << ima(p3) << std::endl;
+// mln::data::fill(ima, mln::literal::blue);
+
+ // toto fun;
+ // mln::image2d<mln::value::rgb8>
+ // tmp2 = mln::data::transform(ima, fun);
+ // mln::border::resize(tmp2, 0);
+
+ // gimp_pixel_rgn_set_rect(out,
+ // (const guchar *) ima.buffer(),
+ // 0,
+ // 0,
+ // out->w,
+ // out->h);
+
+ // gimp_drawable_flush (out->drawable);
+ // gimp_drawable_merge_shadow (out->drawable->drawable_id, TRUE);
+}
+
+gboolean draw_milena_image(GtkWidget* area,
+ GdkEventExpose *event,
+ gpointer data)
+{
+ (void) event;
+ (void) data;
+
+ GimpDrawable* drawable = gimp_drawable_preview_get_drawable((GimpDrawablePreview *)area);
+ assert(drawable != NULL);
+ GimpPixelRgn region;
+ std::stringstream ss;
+ gimp_pixel_rgn_init(®ion,
+ drawable,
+ 0,
+ 0,
+ drawable->width,
+ drawable->height,
+ FALSE,
+ FALSE);
+
+// gimp_pixel_rgn_set_rect(®ion,
+// (const guchar *) ima.buffer(),
+// 0,
+// 0,
+// drawable->width,
+// drawable->height);
+}
diff --git a/plugin-gimp/src/gimp-image.hh b/plugin-gimp/src/gimp-image.hh
new file mode 100644
index 0000000..be0fd4f
--- /dev/null
+++ b/plugin-gimp/src/gimp-image.hh
@@ -0,0 +1,588 @@
+// Copyright (C) 2007, 2011 EPITA Research and Development Laboratory
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef __IMAGEGIMP_HH__
+# define __IMAGEGIMP_HH__
+
+# include <libgimp/gimp.h>
+# include <libgimp/gimpui.h>
+
+# include <mln/core/concept/proxy.hh>
+# include <mln/core/internal/image_primary.hh>
+
+# include <mln/core/alias/box2d.hh>
+# include <mln/value/set.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/literal/all.hh>
+
+# include <iostream>
+# include <sstream>
+
+namespace mln
+{
+
+ // Fwd decl.
+ template <GimpImageType TI> struct gimp_image;
+
+ template <typename T1, typename T2>
+ struct my_shell
+ : public Proxy< my_shell<T1,T2> >,
+ public mln::internal::proxy_impl< T1, my_shell<T1,T2> >
+ {
+ // Equiv
+ typedef T1 equiv;
+
+ T1 subj_()
+ {
+ return val_;
+ }
+
+ my_shell(GimpPixelRgn* rgn, const point2d& p)
+ : rgn_(rgn), p_(p)
+ {
+ gimp_pixel_rgn_get_pixel(rgn_,
+ (guchar *) &val_,
+ p_.col(), p_.row());
+ }
+
+ my_shell<T1, T2>& operator=(const T1& nval)
+ {
+ val_ = nval;
+ gimp_pixel_rgn_set_pixel(rgn_,
+ (guchar *) &val_,
+ p_.col(), p_.row());
+ }
+
+
+ T1 val_;
+ GimpPixelRgn* rgn_;
+ point2d p_;
+
+ };
+
+ namespace internal
+ {
+
+ /// Trait that give mln type from gimp value tag.
+ template <GimpImageType TI>
+ struct gimp_value_tag_to_mln
+ {
+ typedef void type;
+ };
+
+ template <>
+ struct gimp_value_tag_to_mln<GIMP_RGB_IMAGE>
+ {
+ typedef value::rgb8 type;
+ };
+
+ template <>
+ struct gimp_value_tag_to_mln<GIMP_GRAY_IMAGE>
+ {
+ typedef value::int_u8 type;
+ };
+
+
+ template <GimpImageType TI>
+ struct data< gimp_image<TI> >
+ {
+ typedef typename internal::gimp_value_tag_to_mln<TI>::type T;
+
+ /// Constructor.
+ /// {
+ data(GimpPixelRgn* rgn);
+ /// }
+
+ /// Destructor.
+ ~data();
+
+ /// Gimp region.
+ GimpPixelRgn* rgn_;
+
+ guchar *rdata_;
+
+ // Columns pointers
+ //guchar** array_;
+
+ /// theoretical box
+ box2d b_;
+ };
+
+ } // end of namespace mln::internal
+
+ namespace trait
+ {
+
+ template <GimpImageType TI>
+ struct image_< gimp_image<TI> > : default_image_< mln::value::rgb8, gimp_image<TI> >
+ {
+ // misc
+ typedef trait::image::category::primary category;
+ typedef trait::image::speed::fast speed;
+ typedef trait::image::size::regular size;
+
+ // value
+ typedef trait::image::vw_io::none vw_io;
+ typedef trait::image::vw_set::none vw_set;
+ typedef trait::image::value_access::computed value_access;
+ typedef trait::image::value_storage::one_block value_storage;
+ typedef trait::image::value_browsing::site_wise_only value_browsing;
+ typedef trait::image::value_alignment::with_grid value_alignment;
+ typedef trait::image::value_io::read_write value_io;
+
+
+ // site / domain
+ typedef trait::image::pw_io::read_write pw_io;
+ typedef trait::image::localization::basic_grid localization;
+ typedef trait::image::dimension::two_d dimension;
+
+ // extended domain
+ typedef trait::image::ext_domain::none ext_domain;
+ typedef trait::image::ext_value::multiple ext_value;
+ typedef trait::image::ext_io::read_only ext_io;
+ };
+
+ } // end of namespace mln::trait
+
+
+
+ /*! \brief Basic 2D image class.
+ *
+ */
+ template <GimpImageType TI>
+ struct gimp_image
+ : public internal::image_primary<typename internal::gimp_value_tag_to_mln<TI>::type,
+ box2d, gimp_image<TI> >
+ {
+ typedef internal::image_primary<typename internal::gimp_value_tag_to_mln<TI>::type,
+ box2d, gimp_image<TI> > super_;
+
+ // Warning: just to make effective types appear in Doxygen:
+ typedef box2d pset;
+ typedef point2d psite;
+ typedef point2d point;
+ typedef dpoint2d dpoint;
+ typedef mln_fwd_piter(box2d) fwd_piter;
+ typedef mln_bkd_piter(box2d) bkd_piter;
+ // End of warning.
+
+ typedef typename internal::gimp_value_tag_to_mln<TI>::type T;
+
+ /// Value associated type.
+ typedef T value;
+
+ /// Return type of read-only access.
+ typedef my_shell<T,guchar> rvalue;
+
+ /// Return type of read-write access.
+ typedef my_shell<T,guchar> lvalue;
+
+
+ /// Skeleton.
+ typedef gimp_image<TI> skeleton;
+
+
+ /// Value_Set associated type.
+ typedef mln::value::set<value> vset;
+
+
+ /// Constructor without argument.
+ gimp_image();
+
+ /// Constructor with a gimp region.
+ gimp_image(GimpPixelRgn* rgn);
+
+ /// Constructor with a box2d.
+ gimp_image(box2d box);
+
+ /// Constructor with with the numbers of rows and columns.
+ gimp_image(int nrows, int ncols);
+
+ /// Initialise an image from a gimp region.
+ void init_(GimpPixelRgn* rgn);
+
+ // /// Initialise an image from a box2d.
+ // void init_(box2d box);
+
+ /// Test if \p p is valid.
+ bool has(const point2d& p) const;
+
+ /// Give the set of values of the image.
+ const vset& values() const;
+
+ /// Give the definition domain.
+ const box2d& domain() const;
+
+ /// const-only access to the image value located at point \p p.
+ rvalue operator()(const point& p) const;
+
+ /// Read-write access to the image value located at point \p p.
+ lvalue operator()(const point& p);
+
+
+ // As a fastest image:
+ // -------------------
+
+ // // Give the index of a point.
+ // unsigned index_of_point(const point& p) const;
+
+
+ /// Give the border thickness.
+ unsigned border() const;
+
+ /// Give the number of elements (points including border ones).
+ unsigned nelements() const;
+
+ /// Read-only access to the image value located at index \p i.
+ rvalue element(unsigned i) const;
+
+ /// Read-write access to the image value located at index \p i.
+ lvalue element(unsigned i);
+
+ /// Give the delta-index corresponding to the delta-point \p dp.
+ int delta_index(const dpoint2d& dp) const;
+
+ // /// Give the point corresponding to the index \p i.
+ // point2d point_at_index(unsigned i) const;
+
+ /// Give a hook to the value buffer.
+ const guchar* buffer() const;
+
+ /// Give a hook to the value buffer.
+ guchar* buffer();
+
+
+ /// Gimp Image method
+
+ /// Give a hook to the GimpPixelRgn.
+ GimpPixelRgn* gimp_region();
+
+ /// Give a hook to the GimpDrawable.
+ GimpDrawable* gimp_drawable();
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+ template <GimpImageType TI>
+ data< gimp_image<TI> >::data(GimpPixelRgn* rgn)
+ : rgn_(rgn)
+ {
+ mln_assertion(rgn != NULL);
+
+ rgn_ = rgn;
+
+ rdata_ = rgn->data;
+ mln_assertion(rdata_ != 0);
+
+ // unsigned
+ // nr = b_.height(),
+ // nc = b_.width();
+ // array_ = new guchar*[nc];
+ // guchar* buf = rgn_->data;
+ // for (unsigned i = 0; i < nc; ++i)
+ // {
+ // array_[i] = buf;
+ // buf += nr * sizeof(T);
+ // }
+
+ b_ = make::box2d(rgn->y, rgn->x,
+ rgn->y + rgn->h - 1,
+ rgn->x + rgn->w - 1);
+ }
+
+ template <GimpImageType TI>
+ data< gimp_image<TI> >::~data()
+ {
+ // FIXME : Flush!
+ }
+
+ } // end of namespace mln::internal
+
+ // gimp_image<TI>
+
+
+ template <GimpImageType TI>
+ gimp_image<TI>::gimp_image()
+ {
+ }
+
+ template <GimpImageType TI>
+ gimp_image<TI>::gimp_image(GimpPixelRgn* rgn)
+ {
+ init_(rgn);
+ gimp_tile_cache_ntiles(3 * (this->data_->rgn_->w / gimp_tile_width()));
+ }
+
+ template <GimpImageType TI>
+ void
+ gimp_image<TI>::init_(GimpPixelRgn* rgn)
+ {
+ this->data_ = new internal::data< gimp_image<TI> >(rgn);
+ }
+
+ template <GimpImageType TI>
+ const box2d&
+ gimp_image<TI>::domain() const
+ {
+ mln_precondition(this->is_valid());
+ return this->data_->b_;
+ }
+
+ // template <GimpImageType TI>
+ // unsigned
+ // gimp_image<TI>::index_of_point(const point& p) const
+ // {
+ // mln_precondition(this->is_valid());
+ // mln_precondition(this->has(p));
+
+ // unsigned i = (this->operator()(p).address_() - this->buffer()) / sizeof(T);
+ // mln_postcondition(p == this->point_at_index(i));
+ // return i;
+ // }
+
+
+ template <GimpImageType TI>
+ unsigned
+ gimp_image<TI>::border() const
+ {
+ return 0;
+ }
+
+ template <GimpImageType TI>
+ unsigned
+ gimp_image<TI>::nelements() const
+ {
+ mln_precondition(this->is_valid());
+ return this->data_->b_.nsites();
+ }
+
+ // template <GimpImageType TI>
+ // inline
+ // typename gimp_image<TI>::rvalue
+ // gimp_image<TI>::element(unsigned i) const
+ // {
+ // mln_precondition(i < nelements());
+ // return rvalue(this->data_->rdata_ + 3 * i);
+ // }
+
+ // template <GimpImageType TI>
+ // inline
+ // typename gimp_image<TI>::lvalue
+ // gimp_image<TI>::element(unsigned i)
+ // {
+ // mln_precondition(i < nelements());
+ // return lvalue(this->data_->rdata_ + 3 * i);
+ // }
+
+
+ template <GimpImageType TI>
+ bool
+ gimp_image<TI>::has(const point2d& p) const
+ {
+ mln_precondition(this->is_valid());
+ return this->data_->b_.has(p);
+ }
+
+ template <GimpImageType TI>
+ typename gimp_image<TI>::rvalue
+ gimp_image<TI>::operator()(const point& p) const
+ {
+ mln_precondition(this->has(p));
+ // return rvalue(&this->data_->array_[p.col()][p.row() * 3]);
+ // return rvalue(this->data_->rdata_ + 3 * (p.row() * this->data_->b_.width() + p.col()));
+ // static T c;
+ // gimp_pixel_rgn_get_pixel(this->data_->rgn_,
+ // (guchar *) &c,
+ // p.col(), p.row());
+ // return c;
+ return rvalue(this->data_->rgn_, p);
+ }
+
+ template <GimpImageType TI>
+ typename gimp_image<TI>::lvalue
+ gimp_image<TI>::operator()(const point& p)
+ {
+ mln_precondition(this->has(p));
+ return rvalue(this->data_->rgn_, p);
+// return lvalue(&this->data_->array_[p.col()][p.row() * 3]);
+ //return rvalue(this->data_->rdata_ + 3 * (p.row() * this->data_->b_.width() + p.col()));
+ }
+
+ // template <GimpImageType TI>
+ // inline
+ // int
+ // gimp_image<TI>::delta_index(const dpoint2d& dp) const
+ // {
+ // mln_precondition(this->is_valid());
+ // int o = dp[0] * this->data_->b_.width() * 3 + dp[1] * 3;
+ // return o;
+ // }
+
+ // template <GimpImageType TI>
+ // inline
+ // point2d
+ // gimp_image<TI>::point_at_index(unsigned i) const
+ // {
+ // mln_precondition(i < nelements());
+ // def::coord
+ // row = static_cast<def::coord>(i / this->data_->b_.height() + this->data_->b_.min_col()),
+ // col = static_cast<def::coord>(i % this->data_->b_.height() + this->data_->b_.min_row());
+ // point2d p = point2d(row, col);
+ // mln_postcondition(this->operator()(p).address_() == this->data_->rdata_ + sizeof(T) * i);
+ // return p;
+ // }
+
+ // template <GimpImageType TI>
+ // const guchar*
+ // gimp_image<TI>::buffer() const
+ // {
+ // return this->data_->rdata_;
+ // }
+
+
+ // template <GimpImageType TI>
+ // guchar*
+ // gimp_image<TI>::buffer()
+ // {
+ // return this->data_->rdata_;
+ // }
+
+
+ template <GimpImageType TI>
+ GimpPixelRgn*
+ gimp_image<TI>::gimp_region()
+ {
+ return this->data_->rgn_;
+ }
+
+ template <GimpImageType TI>
+ GimpDrawable*
+ gimp_image<TI>::gimp_drawable()
+ {
+ return this->data_->rgn_->drawable;
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+
+# include <mln/core/trait/pixter.hh>
+# include <mln/core/dpoints_pixter.hh>
+# include <mln/core/pixter2d.hh>
+# include <mln/core/w_window.hh>
+
+
+namespace mln
+{
+
+ namespace trait
+ {
+
+ // pixter
+
+
+ template <GimpImageType TI>
+ struct fwd_pixter< gimp_image<TI> >
+ {
+ typedef fwd_pixter2d< gimp_image<TI> > ret;
+ };
+
+
+ template <GimpImageType TI>
+ struct fwd_pixter< const gimp_image<TI> >
+ {
+ typedef fwd_pixter2d< const gimp_image<TI> > ret;
+ };
+
+
+ template <GimpImageType TI>
+ struct bkd_pixter< gimp_image<TI> >
+ {
+ typedef bkd_pixter2d< gimp_image<TI> > ret;
+ };
+
+
+ template <GimpImageType TI>
+ struct bkd_pixter< const gimp_image<TI> >
+ {
+ typedef bkd_pixter2d< const gimp_image<TI> > ret;
+ };
+
+ // qixter
+
+ template <typename W, GimpImageType TI>
+ struct fwd_qixter< gimp_image<TI>, W >
+ {
+ typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
+ };
+
+ template <typename W, GimpImageType TI>
+ struct fwd_qixter< const gimp_image<TI>, W >
+ {
+ typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
+ };
+
+ template <typename W, GimpImageType TI>
+ struct bkd_qixter< gimp_image<TI>, W >
+ {
+ typedef mln::internal::fixme ret;
+ };
+
+ // nixter
+
+ template <typename N, GimpImageType TI>
+ struct fwd_nixter< gimp_image<TI>, N >
+ {
+ typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
+ };
+
+ template <typename N, GimpImageType TI>
+ struct fwd_nixter< const gimp_image<TI>, N >
+ {
+ typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
+ };
+
+ template <typename N, GimpImageType TI>
+ struct bkd_nixter< gimp_image<TI>, N >
+ {
+ typedef mln::internal::fixme ret;
+ };
+
+ } // end of namespace mln::trait
+
+} // end of namespace mln
+
+
+#endif // ! __GIMP_IMAGE_HH__
diff --git a/milena/sandbox/nivault/plugin-gimp/src/interface.hh b/plugin-gimp/src/interface.hh
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/src/interface.hh
copy to plugin-gimp/src/interface.hh
diff --git a/plugin-gimp/src/interface.hxx b/plugin-gimp/src/interface.hxx
new file mode 100644
index 0000000..a092302
--- /dev/null
+++ b/plugin-gimp/src/interface.hxx
@@ -0,0 +1,95 @@
+/* GIMP Plug-in Template
+ * Copyright (C) 2000-2004 Michael Natterer <mitch(a)gimp.org> (the "Author").
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Author of the
+ * Software shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Author.
+ */
+
+#include "config.h"
+
+#include <libgimp/gimp.h>
+#include <libgimp/gimpui.h>
+
+#include "interface.hh"
+
+#include "plugin-intl.hh"
+
+
+/* Constants */
+
+#define SCALE_WIDTH 180
+#define SPIN_BUTTON_WIDTH 75
+#define RANDOM_SEED_WIDTH 100
+
+/* Give access to drawing areas */
+static GtkWidget *drawing_area = NULL;
+
+/* Public functions */
+
+gboolean
+dialog (gint32 image_ID,
+ GimpDrawable *drawable)
+{
+ GtkWidget *dlg;
+ GtkWidget *main_vbox;
+ GtkWidget *frame;
+ GimpRGB color;
+
+ (void) image_ID;
+
+ gimp_ui_init (PLUGIN_NAME, TRUE);
+
+ dlg = gimp_dialog_new (_("Milena toolbox !"), PLUGIN_NAME,
+ NULL, (GtkDialogFlags)0,
+ gimp_standard_help_func, "plug-in-milena", NULL);
+
+ main_vbox = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), main_vbox);
+
+ /*
+ ** Image Layout.
+ */
+
+ frame = gimp_frame_new (_("Display box :"));
+ gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
+ gtk_widget_show (frame);
+ gimp_rgb_set(&color, 0, 0, 0);
+
+ drawing_area = gimp_drawable_preview_new(drawable, NULL);
+ gtk_container_add (GTK_CONTAINER (frame), drawing_area);
+
+ gtk_widget_set_size_request(drawing_area,
+ 500,
+ 500);
+// draw_milena_image(drawing_area, NULL, 0);
+ gtk_widget_show (drawing_area);
+
+ gtk_widget_show (main_vbox);
+ gtk_widget_show (dlg);
+
+ gimp_dialog_run (GIMP_DIALOG (dlg));
+ gtk_widget_destroy (dlg);
+
+ return TRUE;
+}
diff --git a/plugin-gimp/src/main.cc b/plugin-gimp/src/main.cc
new file mode 100644
index 0000000..7af1ffa
--- /dev/null
+++ b/plugin-gimp/src/main.cc
@@ -0,0 +1,183 @@
+/* GIMP Plug-in Template
+ * Copyright (C) 2000 Michael Natterer <mitch(a)gimp.org> (the "Author").
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Author of the
+ * Software shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Author.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <stdio.h>
+
+#include <libgimp/gimp.h>
+#include <libgimp/gimpui.h>
+
+#include "interface.hh"
+
+#include "plugin-intl.hh"
+
+#include "build-image.hh"
+
+/* Constants */
+
+#define PROCEDURE_NAME "milena"
+
+/* Local function prototypes */
+
+static void query (void);
+static void run (const gchar *name,
+ gint nparams,
+ const GimpParam *param,
+ gint *nreturn_vals,
+ GimpParam **return_vals);
+
+
+GimpPlugInInfo PLUG_IN_INFO =
+{
+ NULL, /* init_proc */
+ NULL, /* quit_proc */
+ query, /* query_proc */
+ run, /* run_proc */
+};
+
+int main(int argc, char **argv)
+{
+ int result;
+ getchar();
+ result = gimp_main(&PLUG_IN_INFO, argc, argv);
+ return result;
+}
+
+
+static void
+query (void)
+{
+ static GimpParamDef args[] =
+ {
+ { GIMP_PDB_INT32, (gchar *)"run_mode", (gchar *)"Interactive, non-interactive" },
+ { GIMP_PDB_IMAGE, (gchar *)"image", (gchar *)"Input image" },
+ { GIMP_PDB_DRAWABLE, (gchar *)"drawable", (gchar *)"Input drawable" }
+ };
+
+ gimp_install_procedure (PROCEDURE_NAME,
+ "Milena",
+ "Perform many image processing using Milena library",
+ "Olena Team <olena(a)lrde.epita.fr>",
+ "EPITA Research and Development Laboratory (LRDE)",
+ "2007-2011",
+ N_("Milena toolbox..."),
+ "RGB*, GRAY*, INDEXED*",
+ GIMP_PLUGIN,
+ G_N_ELEMENTS (args), 0,
+ args, NULL);
+
+ gimp_plugin_menu_register (PROCEDURE_NAME, "<Image>/Filters/Milena");
+}
+
+static void
+run (const gchar *name,
+ gint n_params,
+ const GimpParam *param,
+ gint *nreturn_vals,
+ GimpParam **return_vals)
+{
+ (void) name;
+ (void) n_params;
+
+ static GimpParam values[1];
+ GimpDrawable *drawable;
+ GimpPixelRgn in, out;
+ gint32 image_ID;
+ gint x1, y1, x2, y2;
+ gint width, height;
+ GimpRunMode run_mode;
+ GimpPDBStatusType status = GIMP_PDB_SUCCESS;
+
+ *nreturn_vals = 1;
+ *return_vals = values;
+
+ run_mode = (GimpRunMode) param[0].data.d_int32;
+ image_ID = param[1].data.d_int32;
+ drawable = gimp_drawable_get (param[2].data.d_drawable);
+
+ gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
+
+ width = drawable->width;
+ height = drawable->height;
+
+ gimp_pixel_rgn_init(&out, drawable, 0, 0, width, height, TRUE, TRUE);
+ gimp_pixel_rgns_register(1, &out);
+
+ std::cout << "Run - with data: " << out.data << std::endl;
+
+ I tmp(&out);
+
+ //mln::data::fill(tmp, mln::literal::black);
+ // mln_piter_(I) p(tmp.domain());
+ // for_all(p)
+ // tmp(p) = mln::value::rgb8(0, 0, 0);
+
+ tmp(mln::point2d(0,0)) = mln::value::rgb8(0, 255, 0);
+ tmp(mln::point2d(1,0)) = mln::value::rgb8(0, 255, 0);
+ tmp(mln::point2d(0,1)) = mln::value::rgb8(0, 255, 0);
+ tmp(mln::point2d(1,1)) = mln::value::rgb8(0, 255, 0);
+
+ mln::io::ppm::save(tmp, "/tmp/gimp_image.ppm");
+ // std::cout << ".";
+ // std::cout << std::endl;
+
+
+ // build_milena_image(&in, & out);
+
+ // if (strcmp (name, PROCEDURE_NAME) == 0)
+ // {
+ // switch (run_mode)
+ // {
+ // case GIMP_RUN_NONINTERACTIVE:
+ // break;
+
+ // case GIMP_RUN_INTERACTIVE:
+ // dialog (image_ID, drawable);
+ // break;
+
+ // case GIMP_RUN_WITH_LAST_VALS:
+ // break;
+
+ // default:
+ // break;
+ // }
+ // }
+ // else
+ // {
+ // status = GIMP_PDB_CALLING_ERROR;
+ // }
+
+ // gimp_drawable_update (drawable->drawable_id, x1, y1, (x2 - x1), (y2 - y1));
+
+ // gimp_displays_flush ();
+ // gimp_drawable_detach (drawable);
+
+ values[0].type = GIMP_PDB_STATUS;
+ values[0].data.d_status = status;
+}
diff --git a/plugin-gimp/src/main2.cc b/plugin-gimp/src/main2.cc
new file mode 100644
index 0000000..4859bb2
--- /dev/null
+++ b/plugin-gimp/src/main2.cc
@@ -0,0 +1,83 @@
+/* GIMP Plug-in Template
+ * Copyright (C) 2000 Michael Natterer <mitch(a)gimp.org> (the "Author").
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Author of the
+ * Software shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Author.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include <libgimp/gimp.h>
+#include <libgimp/gimpui.h>
+
+#include "interface.hh"
+
+#include "plugin-intl.hh"
+
+#include "build-image.hh"
+
+
+
+int main(int argc, char *argv[])
+{
+
+ // Gimp* g = gimp_new("Gimp", "test", false, true, true,
+ // true, true, true,
+ // GIMP_STACK_TRACE_QUERY, GIMP_PDB_COMPAT_ON);
+
+ int width = 50, height = 50;
+
+ gint32 new_image_id = gimp_image_new(width,
+ height,
+ GIMP_RGB);
+ /* create new layer */
+ gint32 new_layer_id = gimp_layer_new(new_image_id,
+ "titi",
+ width, height,
+ GIMP_RGB_IMAGE,
+ 100,
+ GIMP_NORMAL_MODE);
+ gimp_image_add_layer(new_image_id, new_layer_id, 0);
+ GimpDrawable *new_drawable = gimp_drawable_get(new_layer_id);
+ GimpPixelRgn new_region;
+ gint32 x1, y1, x2, y2;
+ gimp_pixel_rgn_init(&new_region, new_drawable, x1, y1, x2, y2, TRUE, TRUE);
+
+ I tmp(&new_region);
+ mln_piter_(I) p(tmp.domain());
+ for_all(p)
+ tmp(p) = mln::value::rgb8(255, 0, 0);
+
+ mln::io::ppm::save(tmp, "/tmp/gimp_image.ppm");
+
+ gimp_drawable_flush(new_drawable);
+ gimp_drawable_merge_shadow(new_drawable->drawable_id, TRUE);
+ gimp_drawable_update(new_drawable->drawable_id, x1, y1, x2, y2);
+ gimp_drawable_detach(new_drawable);
+
+ /* free buffer */
+ gimp_displays_flush();
+
+}
diff --git a/milena/sandbox/nivault/plugin-gimp/src/plugin-intl.hh b/plugin-gimp/src/plugin-intl.hh
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/src/plugin-intl.hh
copy to plugin-gimp/src/plugin-intl.hh
diff --git a/plugins/olena.c b/plugins/olena.c
new file mode 100644
index 0000000..f189e1b
--- /dev/null
+++ b/plugins/olena.c
@@ -0,0 +1,75 @@
+#include <libgimp/gimp.h>
+
+static void query (void)
+{
+ static GimpParamDef args[] = {
+ {
+ GIMP_PDB_INT32,
+ "run-mode",
+ "Run mode"
+ },
+ {
+ GIMP_PDB_IMAGE,
+ "image",
+ "Input image"
+ },
+ {
+ GIMP_PDB_DRAWABLE,
+ "drawable",
+ "Input drawable"
+ }
+ };
+
+ gimp_install_procedure (
+ "Olena-plugin",
+ "Document Layout analysis",
+ "Find different blocks of a document.",
+ "Olena Team",
+ "Copyright EPITA/LRDE",
+ "2011",
+ "_Analyse Layout...",
+ "RGB*, GRAY*",
+ GIMP_PLUGIN,
+ G_N_ELEMENTS (args), 0,
+ args, NULL);
+
+ gimp_plugin_menu_register ("Olena-plugin",
+ "<Image>/Olena/Scribo/");
+}
+
+
+static void
+run (const gchar *name,
+ gint nparams,
+ const GimpParam *param,
+ gint *nreturn_vals,
+ GimpParam **return_vals)
+{
+ static GimpParam values[1];
+ GimpPDBStatusType status = GIMP_PDB_SUCCESS;
+ GimpRunMode run_mode;
+
+ /* Setting mandatory output values */
+ *nreturn_vals = 1;
+ *return_vals = values;
+
+ values[0].type = GIMP_PDB_STATUS;
+ values[0].data.d_status = status;
+
+ /* Getting run_mode - we won't display a dialog if
+ * we are in NONINTERACTIVE mode */
+ run_mode = param[0].data.d_int32;
+
+ if (run_mode != GIMP_RUN_NONINTERACTIVE)
+ g_message("Hello, world!\n");
+}
+
+
+GimpPlugInInfo PLUG_IN_INFO = {
+ NULL, //init
+ NULL, //quit
+ query,
+ run
+};
+
+MAIN()
diff --git a/milena/doc/outputs/accu-right-instantiation.txt b/scribo/demo/scribogimpplugin/AUTHORS
similarity index 100%
copy from milena/doc/outputs/accu-right-instantiation.txt
copy to scribo/demo/scribogimpplugin/AUTHORS
diff --git a/scribo/demo/scribogimpplugin/COPYING b/scribo/demo/scribogimpplugin/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/milena/doc/outputs/accu-right-instantiation.txt b/scribo/demo/scribogimpplugin/ChangeLog
similarity index 100%
copy from milena/doc/outputs/accu-right-instantiation.txt
copy to scribo/demo/scribogimpplugin/ChangeLog
diff --git a/INSTALL b/scribo/demo/scribogimpplugin/INSTALL
similarity index 100%
copy from INSTALL
copy to scribo/demo/scribogimpplugin/INSTALL
diff --git a/scribo/demo/scribogimpplugin/Makefile.am b/scribo/demo/scribogimpplugin/Makefile.am
new file mode 100644
index 0000000..6e1366c
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = po src help
+
+EXTRA_DIST = \
+ intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in
+
+DISTCLEANFILES = \
+ intltool-extract \
+ intltool-merge \
+ intltool-update
+
+ACLOCAL_AMFLAGS = -I m4
\ No newline at end of file
diff --git a/milena/doc/outputs/accu-right-instantiation.txt b/scribo/demo/scribogimpplugin/NEWS
similarity index 100%
copy from milena/doc/outputs/accu-right-instantiation.txt
copy to scribo/demo/scribogimpplugin/NEWS
diff --git a/milena/doc/outputs/accu-right-instantiation.txt b/scribo/demo/scribogimpplugin/README
similarity index 100%
copy from milena/doc/outputs/accu-right-instantiation.txt
copy to scribo/demo/scribogimpplugin/README
diff --git a/scribo/demo/scribogimpplugin/aclocal.m4 b/scribo/demo/scribogimpplugin/aclocal.m4
new file mode 100644
index 0000000..a61dd00
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/aclocal.m4
@@ -0,0 +1,1607 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 1995-2002 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003,2004 Red Hat, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License. As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+#
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper(a)cygnus.com>, 1995, 1996
+#
+# Modified to never use included libintl.
+# Owen Taylor <otaylor(a)redhat.com>, 12/15/1998
+#
+# Major rework to remove unused code
+# Owen Taylor <otaylor(a)redhat.com>, 12/11/2002
+#
+# Added better handling of ALL_LINGUAS from GNU gettext version
+# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
+#
+# Modified to require ngettext
+# Matthias Clasen <mclasen(a)redhat.com> 08/06/2004
+#
+# We need this here as well, since someone might use autoconf-2.5x
+# to configure GLib then an older version to configure a package
+# using AM_GLIB_GNU_GETTEXT
+AC_PREREQ(2.53)
+
+dnl
+dnl We go to great lengths to make sure that aclocal won't
+dnl try to pull in the installed version of these macros
+dnl when running aclocal in the glib directory.
+dnl
+m4_copy([AC_DEFUN],[glib_DEFUN])
+m4_copy([AC_REQUIRE],[glib_REQUIRE])
+dnl
+dnl At the end, if we're not within glib, we'll define the public
+dnl definitions in terms of our private definitions.
+dnl
+
+# GLIB_LC_MESSAGES
+#--------------------
+glib_DEFUN([GLIB_LC_MESSAGES],
+ [AC_CHECK_HEADERS([locale.h])
+ if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+ fi])
+
+# GLIB_PATH_PROG_WITH_TEST
+#----------------------------
+dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+# GLIB_WITH_NLS
+#-----------------
+glib_DEFUN([GLIB_WITH_NLS],
+ dnl NLS is obligatory
+ [USE_NLS=yes
+ AC_SUBST(USE_NLS)
+
+ gt_cv_have_gettext=no
+
+ CATOBJEXT=NONE
+ XGETTEXT=:
+ INTLLIBS=
+
+ AC_CHECK_HEADER(libintl.h,
+ [gt_cv_func_dgettext_libintl="no"
+ libintl_extra_libs=""
+
+ #
+ # First check in libc
+ #
+ AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
+ [AC_TRY_LINK([
+#include <libintl.h>
+],
+ [return !ngettext ("","", 1)],
+ gt_cv_func_ngettext_libc=yes,
+ gt_cv_func_ngettext_libc=no)
+ ])
+
+ if test "$gt_cv_func_ngettext_libc" = "yes" ; then
+ AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
+ [AC_TRY_LINK([
+#include <libintl.h>
+],
+ [return !dgettext ("","")],
+ gt_cv_func_dgettext_libc=yes,
+ gt_cv_func_dgettext_libc=no)
+ ])
+ fi
+
+ if test "$gt_cv_func_ngettext_libc" = "yes" ; then
+ AC_CHECK_FUNCS(bind_textdomain_codeset)
+ fi
+
+ #
+ # If we don't have everything we want, check in libintl
+ #
+ if test "$gt_cv_func_dgettext_libc" != "yes" \
+ || test "$gt_cv_func_ngettext_libc" != "yes" \
+ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
+
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CHECK_LIB(intl, ngettext,
+ [AC_CHECK_LIB(intl, dgettext,
+ gt_cv_func_dgettext_libintl=yes)])])
+
+ if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
+ AC_MSG_CHECKING([if -liconv is needed to use gettext])
+ AC_MSG_RESULT([])
+ AC_CHECK_LIB(intl, ngettext,
+ [AC_CHECK_LIB(intl, dcgettext,
+ [gt_cv_func_dgettext_libintl=yes
+ libintl_extra_libs=-liconv],
+ :,-liconv)],
+ :,-liconv)
+ fi
+
+ #
+ # If we found libintl, then check in it for bind_textdomain_codeset();
+ # we'll prefer libc if neither have bind_textdomain_codeset(),
+ # and both have dgettext and ngettext
+ #
+ if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
+ glib_save_LIBS="$LIBS"
+ LIBS="$LIBS -lintl $libintl_extra_libs"
+ unset ac_cv_func_bind_textdomain_codeset
+ AC_CHECK_FUNCS(bind_textdomain_codeset)
+ LIBS="$glib_save_LIBS"
+
+ if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
+ gt_cv_func_dgettext_libc=no
+ else
+ if test "$gt_cv_func_dgettext_libc" = "yes" \
+ && test "$gt_cv_func_ngettext_libc" = "yes"; then
+ gt_cv_func_dgettext_libintl=no
+ fi
+ fi
+ fi
+ fi
+
+ if test "$gt_cv_func_dgettext_libc" = "yes" \
+ || test "$gt_cv_func_dgettext_libintl" = "yes"; then
+ gt_cv_have_gettext=yes
+ fi
+
+ if test "$gt_cv_func_dgettext_libintl" = "yes"; then
+ INTLLIBS="-lintl $libintl_extra_libs"
+ fi
+
+ if test "$gt_cv_have_gettext" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT,1,
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ if test "$MSGFMT" != "no"; then
+ glib_save_LIBS="$LIBS"
+ LIBS="$LIBS $INTLLIBS"
+ AC_CHECK_FUNCS(dcgettext)
+ MSGFMT_OPTS=
+ AC_MSG_CHECKING([if msgfmt accepts -c])
+ GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: test 1.0\n"
+"PO-Revision-Date: 2007-02-15 12:01+0100\n"
+"Last-Translator: test <foo(a)bar.xx>\n"
+"Language-Team: C <LL(a)li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+ AC_SUBST(MSGFMT_OPTS)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [case $host in
+ *-*-solaris*)
+ dnl On Solaris, if bind_textdomain_codeset is in libc,
+ dnl GNU format message catalog is always supported,
+ dnl since both are added to the libc all together.
+ dnl Hence, we'd like to go with DATADIRNAME=share and
+ dnl and CATOBJEXT=.gmo in this case.
+ AC_CHECK_FUNC(bind_textdomain_codeset,
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [CATOBJEXT=.mo
+ DATADIRNAME=lib])
+ ;;
+ *)
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
+ ;;
+ esac])
+ LIBS="$glib_save_LIBS"
+ INSTOBJEXT=.mo
+ else
+ gt_cv_have_gettext=no
+ fi
+ fi
+ ])
+
+ if test "$gt_cv_have_gettext" = "yes" ; then
+ AC_DEFINE(ENABLE_NLS, 1,
+ [always defined to indicate that i18n is enabled])
+ fi
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is not GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext program is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+
+ AC_OUTPUT_COMMANDS(
+ [case "$CONFIG_FILES" in *po/Makefile.in*)
+ sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+ esac])
+
+ dnl These rules are solely for the distribution goal. While doing this
+ dnl we only have to keep exactly one list of the available catalogs
+ dnl in configure.in.
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(CATALOGS)
+ AC_SUBST(CATOBJEXT)
+ AC_SUBST(DATADIRNAME)
+ AC_SUBST(GMOFILES)
+ AC_SUBST(INSTOBJEXT)
+ AC_SUBST(INTLLIBS)
+ AC_SUBST(PO_IN_DATADIR_TRUE)
+ AC_SUBST(PO_IN_DATADIR_FALSE)
+ AC_SUBST(POFILES)
+ AC_SUBST(POSUB)
+ ])
+
+# AM_GLIB_GNU_GETTEXT
+# -------------------
+# Do checks necessary for use of gettext. If a suitable implementation
+# of gettext is found in either in libintl or in the C library,
+# it will set INTLLIBS to the libraries needed for use of gettext
+# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
+# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
+# on various variables needed by the Makefile.in.in installed by
+# glib-gettextize.
+dnl
+glib_DEFUN([GLIB_GNU_GETTEXT],
+ [AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+
+ GLIB_LC_MESSAGES
+ GLIB_WITH_NLS
+
+ if test "$gt_cv_have_gettext" = "yes"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ NEW_LINGUAS="$NEW_LINGUAS $presentlang"
+ fi
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+ dnl Try to locate is.
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+
+ dnl Generate list of files to be processed by xgettext which will
+ dnl be included in po/Makefile.
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ ])
+
+# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
+# -------------------------------
+# Define VARIABLE to the location where catalog files will
+# be installed by po/Makefile.
+glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
+[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
+glib_save_prefix="$prefix"
+glib_save_exec_prefix="$exec_prefix"
+glib_save_datarootdir="$datarootdir"
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+datarootdir=`eval echo "${datarootdir}"`
+if test "x$CATOBJEXT" = "x.mo" ; then
+ localedir=`eval echo "${libdir}/locale"`
+else
+ localedir=`eval echo "${datadir}/locale"`
+fi
+prefix="$glib_save_prefix"
+exec_prefix="$glib_save_exec_prefix"
+datarootdir="$glib_save_datarootdir"
+AC_DEFINE_UNQUOTED($1, "$localedir",
+ [Define the location where the catalogs will be installed])
+])
+
+dnl
+dnl Now the definitions that aclocal will find
+dnl
+ifdef(glib_configure_in,[],[
+AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
+AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
+])dnl
+
+# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
+#
+# Create a temporary file with TEST-FILE as its contents and pass the
+# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
+# 0 and perform ACTION-IF-FAIL for any other exit status.
+AC_DEFUN([GLIB_RUN_PROG],
+[cat >conftest.foo <<_ACEOF
+$2
+_ACEOF
+if AC_RUN_LOG([$1 conftest.foo]); then
+ m4_ifval([$3], [$3], [:])
+m4_ifvaln([$4], [else $4])dnl
+echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
+sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
+fi])
+
+
+# nls.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper(a)cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible(a)clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE([nls],
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT([$USE_NLS])
+ AC_SUBST([USE_NLS])
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott(a)netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/autotroll.m4])
+m4_include([m4/intltool.m4])
+m4_include([m4/oln-with-lib.m4])
diff --git a/scribo/demo/scribogimpplugin/autogen.sh b/scribo/demo/scribogimpplugin/autogen.sh
new file mode 100755
index 0000000..75b081e
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/autogen.sh
@@ -0,0 +1,188 @@
+#!/bin/sh
+
+# This script does all the magic calls to automake/autoconf and
+# friends that are needed to configure a cvs checkout. You need a
+# couple of extra tools to run this script successfully.
+#
+# If you are compiling from a released tarball you don't need these
+# tools and you shouldn't use this script. Just call ./configure
+# directly.
+
+PROJECT="GIMP Plug-In Template"
+TEST_TYPE=-f
+FILE=src/main.cc
+
+AUTOCONF_REQUIRED_VERSION=2.66
+AUTOMAKE_REQUIRED_VERSION=1.11
+GLIB_REQUIRED_VERSION=2.24.2
+INTLTOOL_REQUIRED_VERSION=0.41
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+ORIGDIR=`pwd`
+cd $srcdir
+
+check_version ()
+{
+ if expr $1 \>= $2 > /dev/null; then
+ echo "yes (version $1)"
+ else
+ echo "Too old (found version $1)!"
+ DIE=1
+ fi
+}
+
+echo
+echo "I am testing that you have the required versions of autoconf,"
+echo "automake, glib-gettextize and intltoolize..."
+echo
+
+DIE=0
+
+echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ VER=`autoconf --version \
+ | grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/" \
+ | head -n 1`
+ check_version $VER $AUTOCONF_REQUIRED_VERSION
+else
+ echo
+ echo " You must have autoconf installed to compile $PROJECT."
+ echo " Download the appropriate package for your distribution,"
+ echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1;
+fi
+
+echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
+if (automake-1.7 --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake-1.7
+ ACLOCAL=aclocal-1.7
+elif (automake-1.11 --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake-1.11
+ ACLOCAL=aclocal-1.11
+elif (automake-1.8 --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake-1.8
+ ACLOCAL=aclocal-1.8
+elif (automake-1.9 --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake-1.9
+ ACLOCAL=aclocal-1.9
+elif (automake-1.6 --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake-1.6
+ ACLOCAL=aclocal-1.6
+else
+ echo
+ echo " You must have automake 1.6 or newer installed to compile $PROJECT."
+ echo " Download the appropriate package for your distribution,"
+ echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
+ DIE=1
+fi
+
+if test x$AUTOMAKE != x; then
+ VER=`$AUTOMAKE --version \
+ | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
+ check_version $VER $AUTOMAKE_REQUIRED_VERSION
+fi
+
+echo -n "checking for glib-gettextize >= $GLIB_REQUIRED_VERSION ... "
+if (glib-gettextize --version) < /dev/null > /dev/null 2>&1; then
+ VER=`glib-gettextize --version \
+ | grep glib-gettextize | sed "s/.* \([0-9.]*\)/\1/"`
+ check_version $VER $GLIB_REQUIRED_VERSION
+else
+ echo
+ echo " You must have glib-gettextize installed to compile $PROJECT."
+ echo " glib-gettextize is part of glib-2.0, so you should already"
+ echo " have it. Make sure it is in your PATH."
+ DIE=1
+fi
+
+echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
+if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
+ VER=`intltoolize --version \
+ | grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
+ check_version $VER $INTLTOOL_REQUIRED_VERSION
+else
+ echo
+ echo " You must have intltool installed to compile $PROJECT."
+ echo " Get the latest version from"
+ echo " ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
+ DIE=1
+fi
+
+if test "$DIE" -eq 1; then
+ echo
+ echo "Please install/upgrade the missing tools and call me again."
+ echo
+ exit 1
+fi
+
+
+test $TEST_TYPE $FILE || {
+ echo
+ echo "You must run this script in the top-level $PROJECT directory."
+ echo
+ exit 1
+}
+
+
+echo
+echo "I am going to run ./configure with the following arguments:"
+echo
+echo " --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS $@"
+echo
+
+if test -z "$*"; then
+ echo "If you wish to pass additional arguments, please specify them "
+ echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
+ echo "environment variable."
+ echo
+fi
+
+if test -z "$ACLOCAL_FLAGS"; then
+
+ acdir=`$ACLOCAL --print-ac-dir`
+ m4list="glib-gettext.m4 intltool.m4"
+
+ for file in $m4list
+ do
+ if [ ! -f "$acdir/$file" ]; then
+ echo
+ echo "WARNING: aclocal's directory is $acdir, but..."
+ echo " no file $acdir/$file"
+ echo " You may see fatal macro warnings below."
+ echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
+ echo " environment variable to \"-I /some/dir\", or install"
+ echo " $acdir/$file."
+ echo
+ fi
+ done
+fi
+
+$ACLOCAL $ACLOCAL_FLAGS -I m4/
+RC=$?
+if test $RC -ne 0; then
+ echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
+ exit 1
+fi
+
+# optionally feature autoheader
+(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1
+
+$AUTOMAKE --add-missing || exit 1
+autoconf || exit 1
+
+glib-gettextize --copy --force || exit 1
+intltoolize --copy --force --automake || exit 1
+
+cd $ORIGDIR
+
+$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@"
+RC=$?
+if test $RC -ne 0; then
+ echo
+ echo "Configure failed or did not finish!"
+ exit $RC
+fi
+
+echo
+echo "Now type 'make' to compile $PROJECT."
diff --git a/build-aux/autotroll.mk b/scribo/demo/scribogimpplugin/build-aux/autotroll.mk
similarity index 100%
copy from build-aux/autotroll.mk
copy to scribo/demo/scribogimpplugin/build-aux/autotroll.mk
diff --git a/scribo/demo/scribogimpplugin/configure.ac b/scribo/demo/scribogimpplugin/configure.ac
new file mode 100644
index 0000000..0cb30d6
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/configure.ac
@@ -0,0 +1,158 @@
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 EPITA Research and
+# Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+m4_pattern_forbid([^OLN_])
+
+AC_PREREQ([2.61])
+
+## ---------------- ##
+## Package set up. ##
+## ---------------- ##
+
+AC_INIT([scribogimpplugin], [0.1], [olena(a)lrde.epita.fr] [scribo])
+
+# M4 macros.
+AC_CONFIG_MACRO_DIR([m4])
+
+# Auxiliary files.
+AC_CONFIG_AUX_DIR([build-aux])
+
+# Automake
+AM_INIT_AUTOMAKE([1.10 subdir-objects check-news tar-ustar dist-bzip2 nostdinc -Wall])
+
+
+# Package metadata.
+AC_DEFINE_UNQUOTED([SCRIBO_PACKAGE_NAME], ["$PACKAGE_NAME"],
+ [Package Full name.])
+AC_DEFINE_UNQUOTED([SCRIBO_PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
+ [Bug report address.])
+AC_DEFINE_UNQUOTED([SCRIBO_PACKAGE_STRING], ["$PACKAGE_STRING"],
+ [Full name and version.])
+AC_DEFINE_UNQUOTED([SCRIBO_PACKAGE_VERSION], ["$PACKAGE_VERSION"],
+ [Package Version.])
+
+AC_ISC_POSIX
+AC_LANG([C++])
+AC_PROG_CXX
+#AC_LANG([C])
+#AC_PROG_CC
+#AM_PROG_CC_STDC
+AC_HEADER_STDC
+
+
+ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+
+#AM_MAINTAINER_MODE
+
+# ---- #
+# Qt. #
+# ---- #
+
+AT_WITH_QT([xml], [], [], [:], [oln_have_qt=yes])
+if test x$oln_have_qt = xyes; then
+ AT_REQUIRE_QT_VERSION([4],
+ AC_MSG_WARN([Qt-dependent programs will be disabled.]),
+ oln_have_expected_qt_version=yes)
+fi
+AM_CONDITIONAL([HAVE_QT], [test "x$oln_have_expected_qt_version" = xyes])
+
+# ----------- #
+# Tesseract. #
+# ----------- #
+
+OLN_WITH_TESSERACT
+
+
+# ----- #
+# Gimp #
+# ----- #
+
+GIMP_REQUIRED_VERSION=2.2.0
+PKG_CHECK_MODULES(GIMP,
+ gimp-2.0 >= $GIMP_REQUIRED_VERSION gimpui-2.0 >= $GIMP_REQUIRED_VERSION)
+AC_SUBST(GIMP_CFLAGS)
+AC_SUBST(GIMP_LIBS)
+#GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0`
+GIMP_LIBDIR=`echo ~/.gimp-2.4`
+AC_SUBST(GIMP_LIBDIR)
+
+
+AM_CONFIG_HEADER(config.h)
+
+# Project Files
+AC_CONFIG_SRCDIR([src/main.cc])
+
+
+# i18n stuff
+
+GETTEXT_PACKAGE=gimp20-plugin-template
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
+ [The gettext translation domain.])
+
+# Add the languages which your application supports here.
+ALL_LINGUAS="az de fr sk sv zh_TW"
+
+AC_PROG_INTLTOOL
+AM_GLIB_GNU_GETTEXT
+
+AC_CHECK_FUNCS(bind_textdomain_codeset)
+
+LOCALEDIR='${datadir}/locale'
+DATADIR='${datadir}/plugin_name'
+
+AC_SUBST(LOCALEDIR)
+AC_SUBST(DATADIR)
+
+
+AC_MSG_CHECKING([if GTK+ is version 2.7.0 or newer])
+if $PKG_CONFIG --atleast-version=2.7.0 gtk+-2.0; then
+ have_gtk_2_7=yes
+else
+ have_gtk_2_7=no
+fi
+AC_MSG_RESULT($have_gtk_2_7)
+
+if test "x$have_gtk_2_7" != "xyes"; then
+ CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+fi
+
+
+AC_MSG_CHECKING([if GIMP is version 2.3.0 or newer])
+if $PKG_CONFIG --atleast-version=2.3.0 gimp-2.0; then
+ have_gimp_2_3=yes
+else
+ have_gimp_2_3=no
+fi
+AC_MSG_RESULT($have_gimp_2_3)
+
+if test "x$have_gimp_2_3" != "xyes"; then
+ CPPFLAGS="$CPPFLAGS -DGIMP_DISABLE_DEPRECATED"
+fi
+
+
+
+AC_CONFIG_FILES([
+Makefile
+help/Makefile
+help/en/Makefile
+help/images/Makefile
+src/Makefile
+po/Makefile.in
+])
+
+AC_OUTPUT
diff --git a/milena/sandbox/nivault/plugin-gimp/help/Makefile.am b/scribo/demo/scribogimpplugin/help/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/Makefile.am
copy to scribo/demo/scribogimpplugin/help/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/help/en/Makefile.am b/scribo/demo/scribogimpplugin/help/en/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/en/Makefile.am
copy to scribo/demo/scribogimpplugin/help/en/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/help/en/gimp-help.xml b/scribo/demo/scribogimpplugin/help/en/gimp-help.xml
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/en/gimp-help.xml
copy to scribo/demo/scribogimpplugin/help/en/gimp-help.xml
diff --git a/milena/sandbox/nivault/plugin-gimp/help/en/index.html b/scribo/demo/scribogimpplugin/help/en/index.html
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/en/index.html
copy to scribo/demo/scribogimpplugin/help/en/index.html
diff --git a/milena/sandbox/nivault/plugin-gimp/help/images/Makefile.am b/scribo/demo/scribogimpplugin/help/images/Makefile.am
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/images/Makefile.am
copy to scribo/demo/scribogimpplugin/help/images/Makefile.am
diff --git a/milena/sandbox/nivault/plugin-gimp/help/images/wilber.png b/scribo/demo/scribogimpplugin/help/images/wilber.png
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/help/images/wilber.png
copy to scribo/demo/scribogimpplugin/help/images/wilber.png
diff --git a/m4/autotroll.m4 b/scribo/demo/scribogimpplugin/m4/autotroll.m4
similarity index 100%
copy from m4/autotroll.m4
copy to scribo/demo/scribogimpplugin/m4/autotroll.m4
diff --git a/scribo/demo/scribogimpplugin/m4/intltool.m4 b/scribo/demo/scribogimpplugin/m4/intltool.m4
new file mode 100644
index 0000000..839e855
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/m4/intltool.m4
@@ -0,0 +1,216 @@
+## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*-
+## Copyright (C) 2001 Eazel, Inc.
+## Author: Maciej Stachowiak <mjs(a)noisehavoc.org>
+## Kenneth Christiansen <kenneth(a)gnu.org>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
+# serial 40 IT_PROG_INTLTOOL
+AC_DEFUN([IT_PROG_INTLTOOL], [
+AC_PREREQ([2.50])dnl
+AC_REQUIRE([AM_NLS])dnl
+
+case "$am__api_version" in
+ 1.[01234])
+ AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
+ ;;
+ *)
+ ;;
+esac
+
+if test -n "$1"; then
+ AC_MSG_CHECKING([for intltool >= $1])
+
+ INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
+ INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
+ [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
+ ]
+ AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
+ test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
+ AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
+fi
+
+AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
+AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
+AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
+if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
+ AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
+fi
+
+ INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
+ INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
+ INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+ INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+
+_IT_SUBST(INTLTOOL_DESKTOP_RULE)
+_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
+_IT_SUBST(INTLTOOL_KEYS_RULE)
+_IT_SUBST(INTLTOOL_PROP_RULE)
+_IT_SUBST(INTLTOOL_OAF_RULE)
+_IT_SUBST(INTLTOOL_PONG_RULE)
+_IT_SUBST(INTLTOOL_SERVER_RULE)
+_IT_SUBST(INTLTOOL_SHEET_RULE)
+_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
+_IT_SUBST(INTLTOOL_UI_RULE)
+_IT_SUBST(INTLTOOL_XAM_RULE)
+_IT_SUBST(INTLTOOL_KBD_RULE)
+_IT_SUBST(INTLTOOL_XML_RULE)
+_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
+_IT_SUBST(INTLTOOL_CAVES_RULE)
+_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
+_IT_SUBST(INTLTOOL_THEME_RULE)
+_IT_SUBST(INTLTOOL_SERVICE_RULE)
+_IT_SUBST(INTLTOOL_POLICY_RULE)
+
+# Check the gettext tools to make sure they are GNU
+AC_PATH_PROG(XGETTEXT, xgettext)
+AC_PATH_PROG(MSGMERGE, msgmerge)
+AC_PATH_PROG(MSGFMT, msgfmt)
+AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+fi
+xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
+mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
+mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
+if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+fi
+
+AC_PATH_PROG(INTLTOOL_PERL, perl)
+if test -z "$INTLTOOL_PERL"; then
+ AC_MSG_ERROR([perl not found])
+fi
+AC_MSG_CHECKING([for perl >= 5.8.1])
+$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
+if test $? -ne 0; then
+ AC_MSG_ERROR([perl 5.8.1 is required for intltool])
+else
+ IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
+ AC_MSG_RESULT([$IT_PERL_VERSION])
+fi
+if test "x$2" != "xno-xml"; then
+ AC_MSG_CHECKING([for XML::Parser])
+ if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+ AC_MSG_RESULT([ok])
+ else
+ AC_MSG_ERROR([XML::Parser perl module is required for intltool])
+ fi
+fi
+
+# Substitute ALL_LINGUAS so we can use it in po/Makefile
+AC_SUBST(ALL_LINGUAS)
+
+# Set DATADIRNAME correctly if it is not set yet
+# (copied from glib-gettext.m4)
+if test -z "$DATADIRNAME"; then
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[]],
+ [[extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr]])],
+ [DATADIRNAME=share],
+ [case $host in
+ *-*-solaris*)
+ dnl On Solaris, if bind_textdomain_codeset is in libc,
+ dnl GNU format message catalog is always supported,
+ dnl since both are added to the libc all together.
+ dnl Hence, we'd like to go with DATADIRNAME=share
+ dnl in this case.
+ AC_CHECK_FUNC(bind_textdomain_codeset,
+ [DATADIRNAME=share], [DATADIRNAME=lib])
+ ;;
+ *)
+ [DATADIRNAME=lib]
+ ;;
+ esac])
+fi
+AC_SUBST(DATADIRNAME)
+
+IT_PO_SUBDIR([po])
+
+])
+
+
+# IT_PO_SUBDIR(DIRNAME)
+# ---------------------
+# All po subdirs have to be declared with this macro; the subdir "po" is
+# declared by IT_PROG_INTLTOOL.
+#
+AC_DEFUN([IT_PO_SUBDIR],
+[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
+dnl
+dnl The following CONFIG_COMMANDS should be executed at the very end
+dnl of config.status.
+AC_CONFIG_COMMANDS_PRE([
+ AC_CONFIG_COMMANDS([$1/stamp-it], [
+ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
+ AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
+ fi
+ rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
+ >"$1/stamp-it.tmp"
+ [sed '/^#/d
+ s/^[[].*] *//
+ /^[ ]*$/d
+ '"s|^| $ac_top_srcdir/|" \
+ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
+ ]
+ [sed '/^POTFILES =/,/[^\\]$/ {
+ /^POTFILES =/!d
+ r $1/POTFILES
+ }
+ ' "$1/Makefile.in" >"$1/Makefile"]
+ rm -f "$1/Makefile.tmp"
+ mv "$1/stamp-it.tmp" "$1/stamp-it"
+ ])
+])dnl
+])
+
+# _IT_SUBST(VARIABLE)
+# -------------------
+# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
+#
+AC_DEFUN([_IT_SUBST],
+[
+AC_SUBST([$1])
+m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
+]
+)
+
+# deprecated macros
+AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
+# A hint is needed for aclocal from Automake <= 1.9.4:
+# AC_DEFUN([AC_PROG_INTLTOOL], ...)
+
diff --git a/m4/oln-with-lib.m4 b/scribo/demo/scribogimpplugin/m4/oln-with-lib.m4
similarity index 100%
copy from m4/oln-with-lib.m4
copy to scribo/demo/scribogimpplugin/m4/oln-with-lib.m4
diff --git a/milena/doc/outputs/accu-right-instantiation.txt b/scribo/demo/scribogimpplugin/po/POTFILES.in
similarity index 100%
copy from milena/doc/outputs/accu-right-instantiation.txt
copy to scribo/demo/scribogimpplugin/po/POTFILES.in
diff --git a/milena/sandbox/nivault/plugin-gimp/po/az.po b/scribo/demo/scribogimpplugin/po/az.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/az.po
copy to scribo/demo/scribogimpplugin/po/az.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/de.po b/scribo/demo/scribogimpplugin/po/de.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/de.po
copy to scribo/demo/scribogimpplugin/po/de.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/fr.po b/scribo/demo/scribogimpplugin/po/fr.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/fr.po
copy to scribo/demo/scribogimpplugin/po/fr.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/sk.po b/scribo/demo/scribogimpplugin/po/sk.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/sk.po
copy to scribo/demo/scribogimpplugin/po/sk.po
diff --git a/milena/sandbox/nivault/plugin-gimp/po/sv.po b/scribo/demo/scribogimpplugin/po/sv.po
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/po/sv.po
copy to scribo/demo/scribogimpplugin/po/sv.po
diff --git a/scribo/demo/scribogimpplugin/src/Makefile.am b/scribo/demo/scribogimpplugin/src/Makefile.am
new file mode 100644
index 0000000..9823ac5
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/Makefile.am
@@ -0,0 +1,75 @@
+## Process this file with automake to produce Makefile.in
+
+include $(top_srcdir)/../../../build-aux/autotroll.mk
+
+bin_PROGRAMS = scribo-plugin
+
+bindir = $(GIMP_LIBDIR)/plug-ins
+
+scribo_plugin_SOURCES = \
+ main.cc \
+ preprocessing_options.cc \
+ segmentation_options.cc \
+ ocr_options.cc \
+ general_options.cc \
+ preferences_dialog.cc \
+ config.cc \
+ option_widget.cc \
+ process.cc \
+ preprocess.cc \
+ runner.cc
+
+BUILT_SOURCES = preprocessing_options.moc.cc \
+ preprocessing_options.ui.h \
+ segmentation_options.moc.cc \
+ segmentation_options.ui.h \
+ ocr_options.moc.cc \
+ ocr_options.ui.h \
+ preferences_dialog.moc.cc \
+ preferences_dialog.ui.h \
+ general_options.moc.cc \
+ general_options.ui.h \
+ process.moc.cc \
+ preprocess.moc.cc \
+ runner.moc.cc
+
+nodist_scribo_plugin_SOURCES = $(BUILT_SOURCES)
+
+CLEANFILES = $(BUILT_SOURCES)
+
+noinst_HEADERS = preprocessing_options.hh \
+ segmentation_options.hh \
+ ocr_options.hh \
+ general_options.hh \
+ preferences_dialog.hh \
+ config.hh \
+ option_widget.hh \
+ runner.hh
+
+scribo_plugin_CPPFLAGS = \
+ $(QT_CPPFLAGS) $(AM_CPPFLAGS) \
+ $(TESSERACT_CPPFLAGS) \
+ -DLOCALEDIR=\""$(LOCALEDIR)"\" \
+ -DDATADIR=\""$(DATADIR)"\" \
+ -I$(top_srcdir) \
+ -I$(srcdir) \
+ -I$(top_builddir) \
+ -I$(OLN)/milena \
+ -I$(OLN)/scribo \
+ -I$(OLN)/scribo/demo/viewer \
+ @GIMP_CFLAGS@ \
+ -DNDEBUG -DMLN_WO_GLOBAL_VARS
+
+scribo_plugin_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -O3
+scribo_plugin_LDFLAGS = $(QT_LDFLAGS) $(TESSERACT_LDFLAGS) $(LDFLAGS)
+scribo_plugin_LDADD = $(QT_LIBS) $(LDADD) $(GIMP_LIBS)
+
+EXTRA_DIST = \
+ general_options.ui \
+ preferences_dialog.ui \
+ preprocessing_options.ui\
+ segmentation_options.ui \
+ ocr_options.ui
+
+
+
diff --git a/milena/sandbox/nivault/plugin-gimp/src/build-image.hh b/scribo/demo/scribogimpplugin/src/build-image.hh
similarity index 100%
copy from milena/sandbox/nivault/plugin-gimp/src/build-image.hh
copy to scribo/demo/scribogimpplugin/src/build-image.hh
diff --git a/scribo/demo/scribogimpplugin/src/build-image.hxx b/scribo/demo/scribogimpplugin/src/build-image.hxx
new file mode 100644
index 0000000..9a226d1
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/build-image.hxx
@@ -0,0 +1,103 @@
+/* GIMP Plug-in Template
+ * Copyright (C) 2000-2004 Michael Natterer <mitch(a)gimp.org> (the "Author").
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Author of the
+ * Software shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Author.
+ */
+
+#include "build-image.hh"
+
+typedef mln::gimp_image<GIMP_RGB_IMAGE> I;
+
+static I ima;
+
+const I& get_ima()
+{
+ return ima;
+}
+
+struct toto : mln::Function_v2v<toto>
+{
+ typedef mln::value::rgb8 result;
+ mln::value::rgb8 operator()(const mln::value::rgb8& c) const
+ {
+ return mln::value::rgb8(255 - c.red(), 255 - c.green(), 255 - c.blue());
+ }
+};
+
+void build_milena_image(GimpPixelRgn *in,
+ GimpPixelRgn *out)
+{
+ I tmp(in);
+// g_message(region->dirty ? "saaale" : "pas saaale");
+// g_message(region->shadow ? "shadoooow" : "pas shadoooow");
+ ima = tmp;
+ mln::point2d p1(0,0);
+ mln::point2d p2(0,5);
+ mln::point2d p3(20,50);
+// mln::io::ppm::save(ima, "/goinfre/out.ppm");
+ std::cout << p1 << " : " << ima(p1) << std::endl;
+ std::cout << p2 << " : " << ima(p2) << std::endl;
+ std::cout << p3 << " : " << ima(p3) << std::endl;
+// mln::data::fill(ima, mln::literal::blue);
+
+ // toto fun;
+ // mln::image2d<mln::value::rgb8>
+ // tmp2 = mln::data::transform(ima, fun);
+ // mln::border::resize(tmp2, 0);
+
+ gimp_pixel_rgn_set_rect(out,
+ (const guchar *) ima.buffer(),
+ 0,
+ 0,
+ out->w,
+ out->h);
+
+ gimp_drawable_flush (out->drawable);
+ gimp_drawable_merge_shadow (out->drawable->drawable_id, TRUE);
+}
+
+gboolean draw_milena_image(GtkWidget* area,
+ GdkEventExpose *event,
+ gpointer data)
+{
+ GimpDrawable* drawable = gimp_drawable_preview_get_drawable((GimpDrawablePreview *)area);
+ assert(drawable != NULL);
+ GimpPixelRgn region;
+ std::stringstream ss;
+ gimp_pixel_rgn_init(®ion,
+ drawable,
+ 0,
+ 0,
+ drawable->width,
+ drawable->height,
+ FALSE,
+ FALSE);
+
+// gimp_pixel_rgn_set_rect(®ion,
+// (const guchar *) ima.buffer(),
+// 0,
+// 0,
+// drawable->width,
+// drawable->height);
+}
diff --git a/scribo/demo/viewer/config.cc b/scribo/demo/scribogimpplugin/src/config.cc
similarity index 100%
copy from scribo/demo/viewer/config.cc
copy to scribo/demo/scribogimpplugin/src/config.cc
diff --git a/scribo/demo/viewer/config.hh b/scribo/demo/scribogimpplugin/src/config.hh
similarity index 100%
copy from scribo/demo/viewer/config.hh
copy to scribo/demo/scribogimpplugin/src/config.hh
diff --git a/scribo/demo/scribogimpplugin/src/general_options.cc b/scribo/demo/scribogimpplugin/src/general_options.cc
new file mode 100644
index 0000000..903a1c3
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/general_options.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+#include "general_options.hh"
+#include "config.hh"
+
+
+general_options::general_options(QWidget *parent)
+ : OptionWidget(parent)
+{
+ setupUi(this);
+}
+
+general_options::~general_options()
+{
+}
+
+
+void general_options::load_config()
+{
+}
+
+
+void general_options::save_config()
+{
+}
diff --git a/scribo/demo/scribogimpplugin/src/general_options.hh b/scribo/demo/scribogimpplugin/src/general_options.hh
new file mode 100644
index 0000000..123671e
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/general_options.hh
@@ -0,0 +1,38 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef SCRIBO_DEMO_VIEWER_GENERAL_OPTIONS_HH
+# define SCRIBO_DEMO_VIEWER_GENERAL_OPTIONS_HH
+
+# include <QtGui>
+# include <general_options.ui.h>
+# include "option_widget.hh"
+
+class general_options : public OptionWidget, private Ui::GeneralOptions
+{
+ Q_OBJECT;
+
+public:
+ general_options(QWidget *parent = 0);
+ ~general_options();
+
+ virtual void load_config();
+ virtual void save_config();
+
+
+};
+
+#endif // ! SCRIBO_DEMO_VIEWER_GENERAL_OPTIONS_HH
diff --git a/scribo/demo/scribogimpplugin/src/general_options.ui b/scribo/demo/scribogimpplugin/src/general_options.ui
new file mode 100644
index 0000000..81bcf3e
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/general_options.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GeneralOptions</class>
+ <widget class="QWidget" name="GeneralOptions">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt; font-weight:600;">Document Image Layout Analysis</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt; font-weight:600;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">Please select options and parameters for the layout analysis.</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">This algorithms produces a new image with different layers for each kind of elements in the document:</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">- Text</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">- Pictures</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">- Separators</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">- Others</span></p></body></html></string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/scribo/demo/scribogimpplugin/src/gimp-image.hh b/scribo/demo/scribogimpplugin/src/gimp-image.hh
new file mode 100644
index 0000000..63d9686
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/gimp-image.hh
@@ -0,0 +1,471 @@
+// Copyright (C) 2007, 2011 EPITA Research and Development Laboratory
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef __IMAGEGIMP_HH__
+# define __IMAGEGIMP_HH__
+
+extern "C"
+{
+# include <libgimp/gimp.h>
+# include <libgimp/gimpui.h>
+}
+
+# include <mln/core/internal/image_primary.hh>
+
+# include <mln/core/alias/box2d.hh>
+# include <mln/value/set.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/literal/all.hh>
+
+# include <iostream>
+# include <sstream>
+
+namespace mln
+{
+
+ // Fwd decl.
+ template <GimpImageType TI> struct gimp_image;
+
+ namespace internal
+ {
+
+ template <GimpImageType TI>
+ struct data< gimp_image<TI> >
+ {
+ /// Constructor.
+ /// {
+ data(GimpPixelRgn* rgn_);
+ /// }
+
+ /// Destructor.
+ ~data();
+
+ /// Gimp region.
+ GimpPixelRgn* rgn_;
+
+ ///Pointer to pixel buffer.
+ mln_value(gimp_image<TI>)* buffer_;
+
+ // FIXME: currently not initialized but may be faster! See if
+ // Gimp supports such things.
+ ///Pointer to an array of pointer on images lines.
+ mln_value(gimp_image<TI>)** array_;
+
+ /// theoretical box
+ box2d b_;
+
+ /// Smap data between images.
+ void swap_(data< gimp_image<TI> >& other_);
+ };
+
+ /// Trait that give mln type from gimp value tag.
+ template <GimpImageType TI>
+ struct gimp_value_tag_to_mln
+ {
+ typedef void type;
+ };
+
+ template <>
+ struct gimp_value_tag_to_mln<GIMP_RGB_IMAGE>
+ {
+ typedef value::rgb8 type;
+ };
+
+ } // end of namespace mln::internal
+
+ namespace trait
+ {
+
+ template <GimpImageType TI>
+ struct image_< gimp_image<TI> > : default_image_< mln::value::rgb8, gimp_image<TI> >
+ {
+ // misc
+ typedef trait::image::category::primary category;
+ typedef trait::image::speed::fast speed;
+ typedef trait::image::size::regular size;
+
+ // value
+ typedef trait::image::vw_io::none vw_io;
+ typedef trait::image::vw_set::none vw_set;
+ typedef trait::image::value_access::computed value_access;
+ typedef trait::image::value_storage::one_block value_storage;
+ typedef trait::image::value_browsing::site_wise_only value_browsing;
+ typedef trait::image::value_alignment::with_grid value_alignment;
+ typedef trait::image::value_io::read_write value_io;
+
+
+ // site / domain
+ typedef trait::image::pw_io::read_write pw_io;
+ typedef trait::image::localization::basic_grid localization;
+ typedef trait::image::dimension::two_d dimension;
+
+ // extended domain
+ typedef trait::image::ext_domain::none ext_domain;
+ typedef trait::image::ext_value::multiple ext_value;
+ typedef trait::image::ext_io::read_only ext_io;
+ };
+
+ } // end of namespace mln::trait
+
+
+
+ /*! \brief Basic 2D image class.
+ *
+ */
+ template <GimpImageType TI>
+ struct gimp_image
+ : public internal::image_primary<typename internal::gimp_value_tag_to_mln<TI>::type,
+ box2d, gimp_image<TI> >
+ {
+ // Warning: just to make effective types appear in Doxygen:
+ typedef box2d pset;
+ typedef point2d psite;
+ typedef point2d point;
+ typedef dpoint2d dpoint;
+ typedef mln_fwd_piter(box2d) fwd_piter;
+ typedef mln_bkd_piter(box2d) bkd_piter;
+ // End of warning.
+
+ typedef typename internal::gimp_value_tag_to_mln<TI>::type T;
+
+ /// Value associated type.
+ typedef T value;
+
+ /// Return type of read-only access.
+ typedef const T& rvalue;
+
+ /// Return type of read-write access.
+ typedef T& lvalue;
+
+
+ /// Skeleton.
+ typedef gimp_image<TI> skeleton;
+
+
+ /// Value_Set associated type.
+ typedef mln::value::set<value> vset;
+
+
+ /// Constructor without argument.
+ gimp_image();
+
+ /// Constructor with a gimp region.
+ gimp_image(GimpPixelRgn* rgn);
+
+ /// Initialise an image from a gimp region.
+ void init_(GimpPixelRgn* rgn);
+
+ /// Test if \p p is valid.
+ bool has(const point2d& p) const;
+
+ /// Give the set of values of the image.
+ const vset& values() const;
+
+ /// Give the definition domain.
+ const box2d& domain() const;
+
+ /// Give the border thickness.
+ unsigned border() const;
+
+ /// Give the number of cells (points including border ones).
+ std::size_t nelements() const;
+
+ /// const-only access to the image value located at point \p p.
+ const T& operator()(const point& p) const;
+
+ // FIXME: does not work! We need a shell object for enabling writing!
+ /// Read-write access to the image value located at point \p p.
+ T& operator()(const point& p);
+
+ /// Fast Image method
+
+ /// Give a hook to the value buffer.
+ // const T* buffer() const;
+
+ // /// Give a hook to the value buffer.
+ // T* buffer();
+
+ /// Gimp Image method
+
+ /// Give a hook to the GimpPixelRgn.
+ GimpPixelRgn* gimp_region();
+
+ /// Give a hook to the GimpDrawable.
+ GimpDrawable* gimp_drawable();
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+ template <GimpImageType TI>
+ data< gimp_image<TI> >::data(GimpPixelRgn* rgn)
+ : rgn_(rgn)
+ {
+ mln_assertion(rgn != NULL);
+// buffer_ = (typename gimp_image<TI>::value*) rgn->data;
+ b_ = make::box2d(rgn->y, rgn->x,
+ rgn->y + rgn->h - 1,
+ rgn->x + rgn->w - 1);
+ }
+
+ template <GimpImageType TI>
+ data< gimp_image<TI> >::~data()
+ {
+ }
+
+ template <GimpImageType TI>
+ void
+ data< gimp_image<TI> >::swap_(data< gimp_image<TI> >& other_)
+ {
+ data< gimp_image<TI> > self_ = *this;
+ *this = other_;
+ other_ = self_;
+ }
+
+ } // end of namespace mln::internal
+
+ // gimp_image<TI>
+
+
+ template <GimpImageType TI>
+ gimp_image<TI>::gimp_image()
+ {
+ }
+
+ template <GimpImageType TI>
+ gimp_image<TI>::gimp_image(GimpPixelRgn* rgn)
+ {
+ init_(rgn);
+ }
+
+ template <GimpImageType TI>
+ void
+ gimp_image<TI>::init_(GimpPixelRgn* rgn)
+ {
+ mln_precondition(! this->is_valid());
+ this->data_ = new internal::data< gimp_image<TI> >(rgn);
+ }
+
+
+ template <GimpImageType TI>
+ const typename gimp_image<TI>::vset&
+ gimp_image<TI>::values() const
+ {
+ return vset::the();
+ }
+
+
+ template <GimpImageType TI>
+ const box2d&
+ gimp_image<TI>::domain() const
+ {
+ mln_precondition(this->is_valid());
+ return this->data_->b_;
+ }
+
+
+ template <GimpImageType TI>
+ unsigned
+ gimp_image<TI>::border() const
+ {
+ return 0;
+ }
+
+
+ template <GimpImageType TI>
+ std::size_t
+ gimp_image<TI>::nelements() const
+ {
+ mln_precondition(this->is_valid());
+ return this->data_->b_.nsites();
+ }
+
+
+ template <GimpImageType TI>
+ bool
+ gimp_image<TI>::has(const point2d& p) const
+ {
+ mln_precondition(this->is_valid());
+ return this->data_->b_.has(p);
+ }
+
+
+ template <GimpImageType TI>
+ const mln_value(gimp_image<TI>)&
+ gimp_image<TI>::operator()(const point& p) const
+ {
+ // mln_precondition(this->has(p));
+ // FIXME HERE value*) this->data_->rgn->data
+
+ static mln::value::rgb8 c;
+ gimp_pixel_rgn_get_pixel(this->data_->rgn_,
+ (guchar *) &c,
+ p[1], p[0]);
+ return c;
+ }
+
+ template <GimpImageType TI>
+ mln_value(gimp_image<TI>)&
+ gimp_image<TI>::operator()(const point& p)
+ {
+ // mln_precondition(this->has(p));
+ static mln::value::rgb8 c;
+ gimp_pixel_rgn_get_pixel(this->data_->rgn_,
+ (guchar *) &c,
+ p[1], p[0]);
+ return c;
+ }
+
+ // template <GimpImageType TI>
+ // const mln_value(gimp_image<TI>)*
+ // gimp_image<TI>::buffer() const
+ // {
+ // mln_precondition(this->is_valid());
+ // return this->data_->buffer_;
+ // }
+
+
+ // template <GimpImageType TI>
+ // mln_value(gimp_image<TI>)*
+ // gimp_image<TI>::buffer()
+ // {
+ // mln_precondition(this->is_valid());
+ // return this->data_->buffer_;
+ // }
+
+ template <GimpImageType TI>
+ GimpPixelRgn*
+ gimp_image<TI>::gimp_region()
+ {
+ return this->data_->rgn_;
+ }
+
+ template <GimpImageType TI>
+ GimpDrawable*
+ gimp_image<TI>::gimp_drawable()
+ {
+ return this->data_->rgn_->drawable;
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+
+# include <mln/core/trait/pixter.hh>
+# include <mln/core/dpoints_pixter.hh>
+# include <mln/core/pixter2d.hh>
+# include <mln/core/w_window.hh>
+
+
+namespace mln
+{
+
+ namespace trait
+ {
+
+ // pixter
+
+
+ template <GimpImageType TI>
+ struct fwd_pixter< gimp_image<TI> >
+ {
+ typedef fwd_pixter2d< gimp_image<TI> > ret;
+ };
+
+
+ template <GimpImageType TI>
+ struct fwd_pixter< const gimp_image<TI> >
+ {
+ typedef fwd_pixter2d< const gimp_image<TI> > ret;
+ };
+
+
+ template <GimpImageType TI>
+ struct bkd_pixter< gimp_image<TI> >
+ {
+ typedef bkd_pixter2d< gimp_image<TI> > ret;
+ };
+
+
+ template <GimpImageType TI>
+ struct bkd_pixter< const gimp_image<TI> >
+ {
+ typedef bkd_pixter2d< const gimp_image<TI> > ret;
+ };
+
+ // qixter
+
+ template <typename W, GimpImageType TI>
+ struct fwd_qixter< gimp_image<TI>, W >
+ {
+ typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
+ };
+
+ template <typename W, GimpImageType TI>
+ struct fwd_qixter< const gimp_image<TI>, W >
+ {
+ typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
+ };
+
+ template <typename W, GimpImageType TI>
+ struct bkd_qixter< gimp_image<TI>, W >
+ {
+ typedef mln::internal::fixme ret;
+ };
+
+ // nixter
+
+ template <typename N, GimpImageType TI>
+ struct fwd_nixter< gimp_image<TI>, N >
+ {
+ typedef dpoints_fwd_pixter< gimp_image<TI> > ret;
+ };
+
+ template <typename N, GimpImageType TI>
+ struct fwd_nixter< const gimp_image<TI>, N >
+ {
+ typedef dpoints_fwd_pixter< const gimp_image<TI> > ret;
+ };
+
+ template <typename N, GimpImageType TI>
+ struct bkd_nixter< gimp_image<TI>, N >
+ {
+ typedef mln::internal::fixme ret;
+ };
+
+ } // end of namespace mln::trait
+
+} // end of namespace mln
+
+
+#endif // ! __GIMP_IMAGE_HH__
diff --git a/scribo/demo/scribogimpplugin/src/main.cc b/scribo/demo/scribogimpplugin/src/main.cc
new file mode 100644
index 0000000..855a6ad
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/main.cc
@@ -0,0 +1,323 @@
+#include "config.h"
+
+extern "C"
+{
+#include <libgimp/gimp.h>
+}
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <iostream>
+
+#undef MLN_WO_GLOBAL_VARS
+#include <gimp-image.hh>
+
+#include <QApplication>
+#include <QMainWindow>
+#include <QGtkStyle>
+#include <QObject>
+
+
+#include <mln/core/image/image2d.hh>
+#include <mln/debug/filename.hh>
+#include <mln/math/pi.hh>
+#include <mln/data/paste.hh>
+#include <mln/border/resize.hh>
+#include <mln/io/ppm/save.hh>
+
+#include <preferences_dialog.hh>
+
+extern "C"
+{
+ static void query_proc(void);
+ static void run_proc(const gchar* name,
+ gint nparams,
+ const GimpParam* param,
+ gint* nreturn_vals,
+ GimpParam** return_vals);
+}
+
+// int copy_to_gimp(QImage& image);
+
+GimpPlugInInfo PLUG_IN_INFO =
+{
+ NULL,
+ NULL,
+ query_proc,
+ run_proc
+};
+
+
+// FIXME: Useful ?
+void qisMessageHandler(QtMsgType type, const char *msg )
+{
+ (void) type;
+ (void) msg;
+ //simply ignore all messages
+}
+
+
+int main(int argc, char **argv)
+{
+ int result;
+
+ std::cout << "Main is called" << std::endl;
+
+ // FIXME: useful?
+ //install the message handler, if the the environment variable
+ //DEBUG_QUITEINSANE_GIMPPLUGIN isn't set
+ const char* env_v = getenv("DEBUG_QUITEINSANE_GIMPPLUGIN");
+ if(env_v == NULL)
+ qInstallMsgHandler(qisMessageHandler);
+
+ QApplication app(0, 0);
+ //app.setQuitOnLastWindowClosed(false);
+
+
+ result = gimp_main(&PLUG_IN_INFO, argc, argv);
+ std::cout << "Exiting gimp main" << std::endl;
+
+ return result;
+}
+
+
+
+extern "C"
+{
+ static void query_proc(void)
+ {
+ static GimpParamDef args[] =
+ {
+ { GIMP_PDB_INT32, "run_mode", "Interactive,non-interactive"},
+ { GIMP_PDB_IMAGE, "image_id", "Input image" },
+ { GIMP_PDB_DRAWABLE, "drawable_id", "Input drawable" }
+ };
+
+ static GimpParamDef *return_vals = NULL;
+ static int nargs = sizeof(args) / sizeof(args[0]);
+ static int nreturn_vals = 0;
+
+ gimp_install_procedure("Scribo",
+ "SCRIBO Frontend",
+ "Document Image Analysis",
+ "Olena Team",
+ "Copyright EPITA/LRDE",
+ "2011",
+ "_Analyse Layout...",
+ "RGB*, GRAY*",
+ GIMP_PLUGIN,
+ nargs, nreturn_vals,
+ args, return_vals);
+
+ gimp_plugin_menu_register ("Scribo",
+ "<Image>/Olena/Scribo/");
+
+ }
+
+
+ static void run_proc(const gchar* name,
+ gint nparams,
+ const GimpParam* param,
+ gint* nreturn_vals,
+ GimpParam** return_vals)
+ {
+ static GimpParam values[1];
+ GimpRunMode run_mode;
+
+ (void) name;
+ (void) nparams;
+
+ /* Setting mandatory output values */
+ *nreturn_vals = 1;
+ *return_vals = values;
+
+ /* Getting run_mode - we won't display a dialog if
+ * we are in NONINTERACTIVE mode */
+ run_mode = (GimpRunMode)param[0].data.d_int32;
+
+ // Prepare for setting return status.
+ values[0].type = GIMP_PDB_STATUS;
+ values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
+
+ // ==========================
+ // Begin of GIMP2Milena image
+ // ==========================
+
+ // FIXME: move into the switch/case below.
+ GimpPixelRgn in;
+ gint32 x1, y1, x2, y2;
+
+ gint32 drawable_id = param[2].data.d_drawable;
+ GimpDrawable *drawable = gimp_drawable_get(drawable_id);
+
+ gimp_drawable_mask_bounds(drawable_id, &x1, &y1, &x2, &y2);
+ gint32 width = drawable->width;
+ gint32 height = drawable->height;
+
+ gimp_pixel_rgn_init(&in, drawable, x1, y1, x2, y2, FALSE, FALSE);
+
+ typedef mln::gimp_image<GIMP_RGB_IMAGE> I;
+ I tmp(&in);
+ mln::image2d<mln::value::rgb8> input(height, width);
+ std::cout << "Paste data into Olena image" << std::endl;
+ mln::data::paste(tmp, input);
+ mln::io::ppm::save(input, "/tmp/gimp_out.ppm");
+ std::cout << "Paste data into Olena image: Done." << std::endl;
+
+ // // Create a new image
+ // gint32 new_image_id = gimp_image_new(width,
+ // height,
+ // gimp_image_base_type(param[1].data.d_image));
+ // /* create new layer */
+ // gint32 new_layer_id = gimp_layer_new(new_image_id,
+ // "titi",
+ // width, height,
+ // gimp_drawable_type(drawable_id),
+ // 100,
+ // GIMP_NORMAL_MODE);
+ // gimp_image_add_layer(new_image_id, new_layer_id, 0);
+ // GimpDrawable *new_drawable = gimp_drawable_get(new_layer_id);
+ // GimpPixelRgn new_region;
+ // gimp_pixel_rgn_init(&new_region, new_drawable, x1, y1, x2, y2, TRUE, TRUE);
+
+ // mln::border::resize(input, 0);
+
+ // gimp_pixel_rgn_set_rect(&new_region,
+ // (const guchar *) input.buffer(),
+ // 0,
+ // 0,
+ // new_region.w,
+ // new_region.h);
+
+ // /* Tidy up dirty drawable */
+ // gimp_drawable_flush(new_drawable);
+ // gimp_drawable_merge_shadow(new_drawable->drawable_id, TRUE);
+ // gimp_drawable_update(new_drawable->drawable_id, x1, y1, x2, y2);
+ // gimp_drawable_detach(new_drawable);
+
+ // /* free buffer */
+ // gimp_displays_flush();
+ // gimp_display_new(new_image_id);
+
+ // ==========================
+ // end of GIMP2Milena image
+ // ==========================
+
+
+
+ switch (run_mode)
+ {
+ case GIMP_RUN_INTERACTIVE:
+ {
+ preferences_dialog dialog;
+ dialog.set_current_image(input, param[1].data.d_image);
+ dialog.show();
+
+ // Run application.
+ qApp->setStyle(new QGtkStyle());
+ std::cout << "Running app" << std::endl;
+ qApp->exec();
+ std::cout << "Exiting app" << std::endl;
+
+ values[0].data.d_status = GIMP_PDB_SUCCESS;
+ }
+ break;
+
+ case GIMP_RUN_NONINTERACTIVE:
+ {
+ }
+ break;
+
+ case GIMP_RUN_WITH_LAST_VALS:
+ {
+ }
+ break;
+
+ default:
+ {
+ }
+ break;
+ }
+ }
+}
+
+
+
+// int copy_to_gimp(QImage& image)
+// {
+// int is_rgb = 0;
+// int x,y;
+// int remaining;
+// size_t tile_size;
+// GimpImageBaseType image_type = GIMP_GRAY;
+// GimpImageType drawable_type = GIMP_GRAY_IMAGE;
+// gint32 layer_ID;
+// gint32 image_ID;
+// GimpDrawable *drawable;
+// guchar *tile;
+// GimpPixelRgn region;
+// unsigned int tile_offset = 0;
+
+// tile_size = image.width() * gimp_tile_height();
+// if(image.depth() == 32)
+// {
+// is_rgb = 1;
+// tile_size *= 3;
+// image_type = GIMP_RGB;
+// drawable_type = GIMP_RGB_IMAGE;
+// }
+
+// image_ID = gimp_image_new(image.width(),image.height(),image_type);
+// layer_ID = gimp_layer_new(image_ID,"Background",image.width(),image.height(),
+// drawable_type, 100.0, GIMP_NORMAL_MODE);
+// gimp_image_set_resolution(image_ID,
+// int(double(image.dotsPerMeterX()) * 2.54 / 100.0),
+// int(double(image.dotsPerMeterY()) * 2.54 / 100.0));
+// gimp_image_add_layer(image_ID, layer_ID, 0);
+// drawable = gimp_drawable_get(layer_ID);
+// gimp_pixel_rgn_init(®ion, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE);
+// tile = g_new(guchar, tile_size);
+// x=0;
+// y=0;
+// for(y = 0; y < image.height(); y++)
+// {
+// for(x = 0; x < image.width(); x++)
+// {
+// QRgb rgb = image.pixel(x,y);
+// if(is_rgb == 1)
+// {
+// tile[tile_offset] = (guchar)qRed(rgb);
+// ++tile_offset;
+// tile[tile_offset] = (guchar)qGreen(rgb);
+// ++tile_offset;
+// tile[tile_offset] = (guchar)qBlue(rgb);
+// ++tile_offset;
+// }
+// else
+// {
+// tile[tile_offset] = (guchar)qGray(rgb);
+// ++tile_offset;
+// }
+// }
+// int tile_height = gimp_tile_height();
+// if ((y+1) % tile_height == 0)
+// {
+// gimp_pixel_rgn_set_rect(®ion, tile,0,(y+1) - tile_height,image.width(),tile_height);
+// tile_offset = 0;
+// }
+// }
+// remaining = image.height() % gimp_tile_height();
+
+// if (remaining)
+// {
+// gimp_pixel_rgn_set_rect(®ion, tile, 0, image.height() - remaining,
+// image.width(), remaining);
+// }
+
+// gimp_drawable_flush(drawable);
+// gimp_display_new(image_ID);
+// gimp_drawable_detach(drawable);
+// g_free(tile);
+// tile = 0;
+// return 0;
+// }
diff --git a/scribo/demo/scribogimpplugin/src/ocr_options.cc b/scribo/demo/scribogimpplugin/src/ocr_options.cc
new file mode 120000
index 0000000..c5f8414
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/ocr_options.cc
@@ -0,0 +1 @@
+../../viewer/ocr_options.cc
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/ocr_options.hh b/scribo/demo/scribogimpplugin/src/ocr_options.hh
new file mode 120000
index 0000000..e2b44ea
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/ocr_options.hh
@@ -0,0 +1 @@
+../../viewer/ocr_options.hh
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/ocr_options.ui b/scribo/demo/scribogimpplugin/src/ocr_options.ui
new file mode 120000
index 0000000..69e245c
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/ocr_options.ui
@@ -0,0 +1 @@
+../../viewer/ocr_options.ui
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/option_widget.cc b/scribo/demo/scribogimpplugin/src/option_widget.cc
new file mode 120000
index 0000000..2a1b3c2
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/option_widget.cc
@@ -0,0 +1 @@
+../../viewer/option_widget.cc
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/option_widget.hh b/scribo/demo/scribogimpplugin/src/option_widget.hh
new file mode 120000
index 0000000..cd3415a
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/option_widget.hh
@@ -0,0 +1 @@
+../../viewer/option_widget.hh
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/preferences_dialog.cc b/scribo/demo/scribogimpplugin/src/preferences_dialog.cc
new file mode 100644
index 0000000..8daea32
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preferences_dialog.cc
@@ -0,0 +1,326 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+#include <scribo/core/document.hh>
+
+#include "preferences_dialog.hh"
+#include "general_options.hh"
+#include "ocr_options.hh"
+#include "preprocessing_options.hh"
+#include "segmentation_options.hh"
+
+// FIXME
+#include <mln/value/qt/rgb32.hh>
+#include <mln/data/convert.hh>
+#include <mln/data/paste_without_localization.hh>
+#include <mln/core/image/dmorph/image_if.hh>
+
+
+preferences_dialog::preferences_dialog(QWidget *parent)
+ : QDialog(parent)
+{
+ setupUi(this);
+
+ // We may want to remove this useless object in the ui file.
+ delete widget;
+
+ setAttribute(Qt::WA_DeleteOnClose);
+
+ load_option_list();
+ optionList->setCurrentRow(0);
+
+ // Progress dialog setup
+ pdialog_.setModal(true);
+ pdialog_.setAutoClose(false);
+ pdialog_.setCancelButton(0);
+ connect(&runner_, SIGNAL(finished()),
+ &pdialog_, SLOT(close()));
+ connect(&runner_, SIGNAL(finished()),
+ this, SLOT(diplay_result()));
+ connect(&runner_, SIGNAL(new_step(const QString&)),
+ &pdialog_, SLOT(setWindowTitle(const QString&)));
+ connect(&runner_, SIGNAL(new_progress_max_value(int)),
+ &pdialog_, SLOT(setMaximum(int)));
+ connect(&runner_, SIGNAL(new_progress_label(const QString&)),
+ &pdialog_, SLOT(setLabelText(const QString&)));
+
+ // Runner setup
+ connect(&runner_, SIGNAL(progress(int)),
+ &pdialog_, SLOT(setValue(int)));
+
+}
+
+preferences_dialog::~preferences_dialog()
+{
+ for (int i = 0; i < widgets_.size(); ++i)
+ if (widgets_[i])
+ {
+ static_cast<OptionWidget *>(widgets_[i])->save_config();
+ delete widgets_[i];
+ }
+}
+
+
+void preferences_dialog::set_current_image(const mln::image2d<mln::value::rgb8>& ima, gint32 image_id)
+{
+ current_image_ = ima;
+ image_id_ = image_id;
+}
+
+
+void preferences_dialog::load_option_list()
+{
+ static const char *options[] = { "General", "Preprocessing", "Segmentation", "OCR", 0 };
+
+ int i;
+ for (i = 0; options[i]; ++i)
+ optionList->insertItem(i, options[i]);
+
+ widgets_.fill(0, i);
+}
+
+void preferences_dialog::on_optionList_currentRowChanged(int row)
+{
+ select_option_widget(row);
+}
+
+
+void preferences_dialog::select_option_widget(int row)
+{
+ if (row >= widgets_.size())
+ {
+ qDebug() << "select_option_widget - Hu? Something wrong... Invalid row";
+ return;
+ }
+
+ if (!widgets_[row])
+ {
+ QWidget *widget = 0;
+
+ switch (row)
+ {
+ case 0:
+ widget = new general_options(this);
+ break;
+
+ case 1:
+ widget = new preprocessing_options(this);
+ break;
+
+ case 2:
+ widget = new segmentation_options(this);
+ break;
+
+ case 3:
+ widget = new ocr_options(this);
+ break;
+
+ default:
+ qDebug() << "select_option_widget - Hu? Something wrong...";
+ }
+
+ if (widget)
+ widgets_[row] = widget;
+ }
+
+ if (horizontalLayout_2->count() == 2)
+ {
+ QWidget *current_widget = horizontalLayout_2->itemAt(1)->widget();
+ horizontalLayout_2->removeWidget(current_widget);
+ current_widget->hide();
+ }
+
+ horizontalLayout_2->insertWidget(1, widgets_[row]);
+ widgets_[row]->show();
+}
+
+
+void preferences_dialog::accept()
+{
+ // for (int i = 0; i < widgets_.size(); ++i)
+ // if (widgets_[i])
+ // {
+ // static_cast<OptionWidget *>(widgets_[i])->save_config();
+ // delete widgets_[i];
+ // }
+ hide();
+ process();
+// QDialog::accept();
+}
+
+void preferences_dialog::process()
+{
+ // Run process ?
+ reset_progress_dialog();
+ std::cout << "Starting demat" << std::endl;
+ runner_.start_demat(current_image_);
+ std::cout << "Ending demat" << std::endl;
+}
+
+
+
+
+void preferences_dialog::reject()
+{
+ for (int i = 0; i < widgets_.size(); ++i)
+ delete widgets_[i];
+ QDialog::reject();
+}
+
+void preferences_dialog::reset_progress_dialog()
+{
+ pdialog_.setValue(0);
+ pdialog_.setLabelText("");
+ pdialog_.show();
+}
+
+void preferences_dialog::diplay_result()
+{
+ std::cout << "Creating result image" << std::endl;
+
+ // Make sure there is not border in input image.
+ mln::border::resize(current_image_, 0);
+
+ // Getting retrieved document.
+ const scribo::document<L>& doc = runner_.result();
+
+ image2d<value::qt::rgb32> in_32 = data::convert(value::qt::rgb32(), current_image_);
+
+ int
+ width = current_image_.bbox().width(),
+ height = current_image_.bbox().height();
+
+ // Get active drawable in input image.
+ gint32 drawable_id = gimp_image_get_active_drawable(image_id_);
+
+ // Get coordinates of the processed area in the input image.
+ gint32 x1, y1, x2, y2;
+ gimp_drawable_mask_bounds(drawable_id, &x1, &y1, &x2, &y2);
+
+ // Create a new image
+ gint32 new_image_id = gimp_image_new(width,
+ height,
+ gimp_image_base_type(image_id_));
+
+ /* create background layer */
+ gint32 new_layer_id = gimp_layer_new(new_image_id,
+ "Background",
+ width, height,
+ gimp_drawable_type(drawable_id),
+ 100,
+ GIMP_NORMAL_MODE);
+ gimp_image_add_layer(new_image_id, new_layer_id, 0);
+
+
+ if (doc.has_text())
+ {
+ /* create new layer */
+ gint32 new_layer_id = gimp_layer_new(new_image_id,
+ "Text",
+ width, height,
+ gimp_drawable_type(drawable_id),
+ 100,
+ GIMP_NORMAL_MODE);
+ gimp_image_add_layer(new_image_id, new_layer_id, -1);
+ gimp_layer_add_alpha(new_layer_id);
+
+ GimpDrawable *new_drawable = gimp_drawable_get(new_layer_id);
+ GimpPixelRgn new_region;
+ gimp_pixel_rgn_init(&new_region, new_drawable, x1, y1, x2, y2, TRUE, TRUE);
+
+ for_all_lines(i, doc.lines())
+ if (doc.lines()(i).is_textline())
+ {
+ std::cout << "Drawing text with bbox " << doc.lines()(i).bbox() << std::endl;
+ const scribo::line_info<L>& line = doc.lines()(i);
+
+ // FIXME: Slow! gimp_pixel_rgn_set_rect does not support
+ // stride information thus, requires that relevant data in the
+ // buffer is contiguous.
+ mln::image2d<value::qt::rgb32> tmp(line.bbox(), 0);
+ mln::data::paste_without_localization(in_32 | line.bbox(), tmp);
+
+ gimp_pixel_rgn_set_rect(&new_region,
+ (const guchar *) tmp.buffer(),
+ line.bbox().pmin().col(),
+ line.bbox().pmin().row(),
+ line.bbox().width(),
+ line.bbox().height());
+ }
+
+ /* Tidy up dirty drawable */
+ gimp_drawable_flush(new_drawable);
+ gimp_drawable_merge_shadow(new_drawable->drawable_id, TRUE);
+ gimp_drawable_update(new_drawable->drawable_id, x1, y1, x2, y2);
+ gimp_drawable_detach(new_drawable);
+
+ gimp_displays_flush();
+ }
+
+
+ if (doc.has_whitespace_seps())
+ std::cout << "doc has whitespace seps!" << std::endl;
+
+
+ if (doc.has_elements())
+ {
+ /* create new layer */
+ gint32 new_layer_id = gimp_layer_new(new_image_id,
+ "Elements",
+ width, height,
+ gimp_drawable_type(drawable_id),
+ 100,
+ GIMP_NORMAL_MODE);
+ gimp_image_add_layer(new_image_id, new_layer_id, -1);
+ gimp_layer_add_alpha(new_layer_id);
+
+ GimpDrawable *new_drawable = gimp_drawable_get(new_layer_id);
+ GimpPixelRgn new_region;
+ gimp_pixel_rgn_init(&new_region, new_drawable, x1, y1, x2, y2, TRUE, TRUE);
+
+ for_all_comps(i, doc.elements())
+ if (doc.elements()(i).is_valid())
+ {
+ std::cout << "Drawing image with bbox " << doc.elements()(i).bbox() << std::endl;
+ const scribo::component_info<L>& elt = doc.elements()(i);
+
+ // FIXME: Slow! gimp_pixel_rgn_set_rect does not support
+ // stride information thus, requires that relevant data in the
+ // buffer is contiguous.
+ mln::image2d<value::qt::rgb32> tmp(elt.bbox(), 0);
+ mln::data::paste_without_localization(in_32 | elt.bbox(), tmp);
+
+ gimp_pixel_rgn_set_rect(&new_region,
+ (const guchar *) tmp.buffer(),
+ elt.bbox().pmin().col(),
+ elt.bbox().pmin().row(),
+ elt.bbox().width(),
+ elt.bbox().height());
+ }
+
+ /* Tidy up dirty drawable */
+ gimp_drawable_flush(new_drawable);
+ gimp_drawable_merge_shadow(new_drawable->drawable_id, TRUE);
+ gimp_drawable_update(new_drawable->drawable_id, x1, y1, x2, y2);
+ gimp_drawable_detach(new_drawable);
+
+ gimp_displays_flush();
+ }
+
+ /* free buffer */
+ gimp_display_new(new_image_id);
+}
diff --git a/scribo/demo/scribogimpplugin/src/preferences_dialog.hh b/scribo/demo/scribogimpplugin/src/preferences_dialog.hh
new file mode 100644
index 0000000..1e6f163
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preferences_dialog.hh
@@ -0,0 +1,70 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef SCRIBO_DEMO_VIEWER_PREFERENCES_DIALOG_HH
+# define SCRIBO_DEMO_VIEWER_PREFERENCES_DIALOG_HH
+
+extern "C"
+{
+#include <libgimp/gimp.h>
+}
+
+
+# include <QtGui>
+# include <preferences_dialog.ui.h>
+
+# include <runner.hh>
+
+# include <mln/core/image/image2d.hh>
+# include <scribo/core/def/lbl_type.hh>
+
+
+class preferences_dialog : public QDialog, private Ui::PreferencesDialog
+{
+ Q_OBJECT;
+
+ typedef mln::image2d<scribo::def::lbl_type> L;
+
+public:
+ preferences_dialog(QWidget *parent = 0);
+ ~preferences_dialog();
+
+ void set_current_image(const mln::image2d<mln::value::rgb8>& ima, gint32 image_id);
+
+private slots:
+ void on_optionList_currentRowChanged(int row);
+ virtual void accept();
+ virtual void reject();
+ void diplay_result();
+
+private: // Methods
+ void load_option_list();
+ void select_option_widget(int row);
+ void reset_progress_dialog();
+ void process();
+
+private: // Attributes
+ QVector<QWidget *> widgets_;
+
+ runner runner_;
+ QProgressDialog pdialog_;
+
+ mln::image2d<mln::value::rgb8> current_image_;
+ gint32 image_id_;
+};
+
+#endif // ! SCRIBO_DEMO_VIEWER_PREFERENCES_DIALOG_HH
diff --git a/scribo/demo/scribogimpplugin/src/preferences_dialog.ui b/scribo/demo/scribogimpplugin/src/preferences_dialog.ui
new file mode 100644
index 0000000..147c545
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preferences_dialog.ui
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PreferencesDialog</class>
+ <widget class="QDialog" name="PreferencesDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>668</width>
+ <height>418</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Preferences</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Layout Analysis</span></p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QListWidget" name="optionList">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>200</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QWidget" name="widget" native="true"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>PreferencesDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>PreferencesDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/scribo/demo/scribogimpplugin/src/preprocess.cc b/scribo/demo/scribogimpplugin/src/preprocess.cc
new file mode 120000
index 0000000..9635806
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preprocess.cc
@@ -0,0 +1 @@
+../../viewer/preprocess.cc
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/preprocess.hh b/scribo/demo/scribogimpplugin/src/preprocess.hh
new file mode 120000
index 0000000..dda1183
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preprocess.hh
@@ -0,0 +1 @@
+../../viewer/preprocess.hh
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/preprocessing_options.cc b/scribo/demo/scribogimpplugin/src/preprocessing_options.cc
new file mode 120000
index 0000000..e39fb42
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preprocessing_options.cc
@@ -0,0 +1 @@
+../../viewer/preprocessing_options.cc
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/preprocessing_options.hh b/scribo/demo/scribogimpplugin/src/preprocessing_options.hh
new file mode 120000
index 0000000..f13da3c
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preprocessing_options.hh
@@ -0,0 +1 @@
+../../viewer/preprocessing_options.hh
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/preprocessing_options.ui b/scribo/demo/scribogimpplugin/src/preprocessing_options.ui
new file mode 120000
index 0000000..be35553
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/preprocessing_options.ui
@@ -0,0 +1 @@
+../../viewer/preprocessing_options.ui
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/process.cc b/scribo/demo/scribogimpplugin/src/process.cc
new file mode 120000
index 0000000..6f4f6a8
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/process.cc
@@ -0,0 +1 @@
+../../viewer/process.cc
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/process.hh b/scribo/demo/scribogimpplugin/src/process.hh
new file mode 120000
index 0000000..3bbf208
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/process.hh
@@ -0,0 +1 @@
+../../viewer/process.hh
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/runner.cc b/scribo/demo/scribogimpplugin/src/runner.cc
new file mode 100644
index 0000000..82e83e2
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/runner.cc
@@ -0,0 +1,161 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+#include "runner.hh"
+
+#include <mln/core/image/image2d.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/io/magick/load.hh>
+
+#include "process.hh"
+#include "preprocess.hh"
+#include "config.hh"
+#include "defs.hh"
+
+
+
+using namespace mln;
+using namespace scribo::toolchain::internal;
+
+
+runner::runner(QObject *parent)
+ : QThread(parent)
+{
+ moveToThread(this);
+}
+
+
+void runner::run()
+{
+
+ switch(mode_)
+ {
+ default:
+ case Demat:
+ {
+ image2d<bool> bin_ima = preprocess(args_.at(0));
+ process(args_.at(0), bin_ima);
+ }
+ break;
+ }
+
+ emit finished();
+ qDebug() << "Done.";
+}
+
+
+void runner::stop()
+{
+ terminate();
+}
+
+
+
+// Demat related stuff
+
+void
+runner::start_demat(const image2d<value::rgb8>& image)
+{
+ args_.clear();
+ args_ << image;
+ mode_ = Demat;
+
+ QThread::start();
+}
+
+const runner::doc_t&
+runner::result() const
+{
+ return doc_;
+}
+
+void
+runner::progress_value()
+{
+ emit progress(++step_);
+}
+
+image2d<bool>
+runner::preprocess(const image2d<value::rgb8>& ima)
+{
+ emit new_step("Preprocessing");
+
+ ::preprocess f;
+
+ // Load config.
+ config * const conf = config::get_instance();
+
+ // Init runner and functor connections.
+ step_ = 0;
+ connect(&f, SIGNAL(progress()), this, SLOT(progress_value()));
+ connect(&f, SIGNAL(new_progress_label(const QString&)),
+ this, SIGNAL(new_progress_label(const QString&)));
+
+ f.enable_subsample = conf->preprocessing_subsample();
+ f.enable_fg_extraction = conf->preprocessing_remove_bg();
+ f.enable_deskew = conf->preprocessing_deskew();
+ f.enable_denoising = conf->preprocessing_remove_noise();
+
+ f.binarization_algo = static_cast<Binarization_Algo>(conf->preprocessing_bin_algo());
+
+ emit new_progress_max_value(f.nsteps());
+
+ // Perform preprocessing.
+ f(ima);
+
+ qDebug() << "Preprocess Done.";
+ return f.output;
+}
+
+
+void runner::process(const image2d<value::rgb8>& original_ima,
+ const image2d<bool>& processed_ima)
+{
+ emit new_step("Page segmentation");
+
+ ::process f("fixme.jpg");
+
+ // Init runner and functor connections.
+ step_ = 0;
+ connect(&f, SIGNAL(progress()), this, SLOT(progress_value()));
+ connect(&f, SIGNAL(new_progress_label(const QString&)),
+ this, SIGNAL(new_progress_label(const QString&)));
+
+ // Load config.
+ config * const conf = config::get_instance();
+
+ defs::FindSeparators
+ find_seps = static_cast<defs::FindSeparators>(conf->segmentation_find_seps());
+ f.enable_line_seps = (find_seps == defs::Lines
+ || find_seps == defs::LinesAndWhitespaces);
+ f.enable_whitespace_seps = (find_seps == defs::Whitespaces
+ || find_seps == defs::LinesAndWhitespaces);
+ f.enable_ocr = conf->ocr_enabled();
+ f.ocr_language = conf->ocr_language().toAscii().data();
+ f.save_doc_as_xml = false;
+
+ emit new_progress_max_value(f.nsteps());
+
+ // Perform text detection.
+ f(original_ima, processed_ima);
+
+ doc_ = f.doc;
+
+ qDebug() << "Process Done.";
+}
+
+
diff --git a/scribo/demo/scribogimpplugin/src/runner.hh b/scribo/demo/scribogimpplugin/src/runner.hh
new file mode 100644
index 0000000..d08e1a0
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/runner.hh
@@ -0,0 +1,76 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef SCRIBO_DEMO_VIEWER_RUNNER_HH
+# define SCRIBO_DEMO_VIEWER_RUNNER_HH
+
+# include <QtGui>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/value/int_u16.hh>
+# include <scribo/core/document.hh>
+# include <scribo/core/def/lbl_type.hh>
+
+using namespace mln;
+
+enum RunMode
+{
+ Demat,
+ Export
+};
+
+class runner : public QThread
+{
+ Q_OBJECT;
+
+public:
+ typedef scribo::document<image2d<scribo::def::lbl_type> > doc_t;
+
+ runner(QObject *parent = 0);
+
+ void start_demat(const image2d<value::rgb8>& filename);
+
+ const doc_t& result() const;
+
+public slots:
+ void stop();
+ void progress_value();
+
+signals:
+ void new_step(const QString& step_name);
+ void new_progress_max_value(int i);
+ void new_progress_label(const QString& msg);
+ void progress(int step);
+ void finished();
+
+private: // members
+ image2d<bool> preprocess(const image2d<value::rgb8>& ima);
+ void process(const image2d<value::rgb8>& original_ima,
+ const image2d<bool>& processed_ima);
+
+ virtual void run();
+
+private: // attributes
+ QList<image2d<value::rgb8> > args_;
+ RunMode mode_;
+ int step_;
+
+ doc_t doc_;
+};
+
+
+#endif // ! SCRIBO_DEMO_VIEWER_RUNNER_HH
diff --git a/scribo/demo/scribogimpplugin/src/segmentation_options.cc b/scribo/demo/scribogimpplugin/src/segmentation_options.cc
new file mode 120000
index 0000000..8243fb2
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/segmentation_options.cc
@@ -0,0 +1 @@
+../../viewer/segmentation_options.cc
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/segmentation_options.hh b/scribo/demo/scribogimpplugin/src/segmentation_options.hh
new file mode 120000
index 0000000..7e08b73
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/segmentation_options.hh
@@ -0,0 +1 @@
+../../viewer/segmentation_options.hh
\ No newline at end of file
diff --git a/scribo/demo/scribogimpplugin/src/segmentation_options.ui b/scribo/demo/scribogimpplugin/src/segmentation_options.ui
new file mode 120000
index 0000000..3727c19
--- /dev/null
+++ b/scribo/demo/scribogimpplugin/src/segmentation_options.ui
@@ -0,0 +1 @@
+../../viewer/segmentation_options.ui
\ No newline at end of file
--
1.7.2.5
1
0

olena-2.0-12-g9177e80 Move Otsu's threshold computation in a separate routine.
by Guillaume Lazzara 22 Nov '11
by Guillaume Lazzara 22 Nov '11
22 Nov '11
* scribo/binarization/otsu.hh,
* scribo/binarization/otsu_threshold.hh: Move threshold
computation in a separate routine.
---
scribo/ChangeLog | 8 +++
scribo/scribo/binarization/otsu.hh | 56 +-------------------
.../binarization/{otsu.hh => otsu_threshold.hh} | 31 +++++------
3 files changed, 23 insertions(+), 72 deletions(-)
copy scribo/scribo/binarization/{otsu.hh => otsu_threshold.hh} (84%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0923b28..6381a60 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,13 @@
2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Move Otsu's threshold computation in a separate routine.
+
+ * scribo/binarization/otsu.hh,
+ * scribo/binarization/otsu_threshold.hh: Move threshold
+ computation in a separate routine.
+
+2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add Niblack's binarization algorithm.
* scribo/binarization/all.hh: Update includes.
diff --git a/scribo/scribo/binarization/otsu.hh b/scribo/scribo/binarization/otsu.hh
index c96a207..6b9d492 100644
--- a/scribo/scribo/binarization/otsu.hh
+++ b/scribo/scribo/binarization/otsu.hh
@@ -27,12 +27,8 @@
# define SCRIBO_BINARIZATION_OTSU_HH
# include <mln/core/concept/image.hh>
-# include <mln/util/array.hh>
-# include <mln/geom/nsites.hh>
-# include <mln/geom/ncols.hh>
-# include <mln/geom/nrows.hh>
-# include <mln/histo/compute.hh>
+# include <scribo/binarization/otsu_threshold.hh>
# include <scribo/binarization/global_threshold.hh>
namespace scribo
@@ -72,55 +68,7 @@ namespace scribo
mlc_is_a(mln_value(I), value::Scalar)::check();
// FIXME: Check that input value is gray level.
- mln_value(I) maxval = mln_max(mln_value(I));
- unsigned nsites = geom::nsites(input);
-
- /* Histogram generation */
- histo::array<mln_value(I)> hist = mln::histo::compute(input);
-
-
- /* calculation of probability density */
- util::array<double> pdf(hist.nvalues()); //probability distribution
- for(int i = 0; i< maxval; ++i)
- pdf[i] = (double)hist[i] / nsites;
-
-
- util::array<double> cdf(hist.nvalues()); //cumulative probability distribution
- util::array<double> myu(hist.nvalues()); // mean value for separation
-
- /* cdf & myu generation */
- cdf[0] = pdf[0];
- myu[0] = 0.0; /* 0.0 times prob[0] equals zero */
-
- for(int i = 1; i < maxval; ++i)
- {
- cdf[i] = cdf[i-1] + pdf[i];
- myu[i] = myu[i-1] + i*pdf[i];
- }
-
- /* sigma maximization
- sigma stands for inter-class variance
- and determines optimal threshold value */
- int threshold = 0;
- double max_sigma = 0.0;
- util::array<double> sigma(hist.nvalues()); // inter-class variance
-
- for(int i = 0; i < maxval - 1; ++i)
- {
- if(cdf[i] != 0.0 && cdf[i] != 1.0)
- {
- double p1p2 = cdf[i] * (1.0 - cdf[i]);
- double mu1mu2diff = myu[maxval - 1] * cdf[i] - myu[i];
- sigma[i] = mu1mu2diff * mu1mu2diff / p1p2;
- }
- else
- sigma[i] = 0.0;
- if(sigma[i] > max_sigma)
- {
- max_sigma = sigma[i];
- threshold = i;
- }
- }
+ mln_value(I) threshold = otsu_threshold(input);
// Computing final result.
mln_ch_value(I,bool) output = global_threshold(input, threshold);
diff --git a/scribo/scribo/binarization/otsu.hh b/scribo/scribo/binarization/otsu_threshold.hh
similarity index 84%
copy from scribo/scribo/binarization/otsu.hh
copy to scribo/scribo/binarization/otsu_threshold.hh
index c96a207..ab663d0 100644
--- a/scribo/scribo/binarization/otsu.hh
+++ b/scribo/scribo/binarization/otsu_threshold.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_BINARIZATION_OTSU_HH
-# define SCRIBO_BINARIZATION_OTSU_HH
+#ifndef SCRIBO_BINARIZATION_OTSU_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_OTSU_THRESHOLD_HH
# include <mln/core/concept/image.hh>
# include <mln/util/array.hh>
@@ -33,8 +33,6 @@
# include <mln/geom/nrows.hh>
# include <mln/histo/compute.hh>
-# include <scribo/binarization/global_threshold.hh>
-
namespace scribo
{
@@ -43,29 +41,28 @@ namespace scribo
using namespace mln;
- /*! An implementation of Otsu's binarization algorithm.
+ /*! Compute a global binarization threshold using Otsu's algorithm.
It is based on Ocropus's implementation.
http://code.google.com/p/ocropus/
\param[in] input A gray-scale image.
- \return A binary image. True for foreground, False for
- background.
+ \return A global threshold value.
*/
template <typename I>
- mln_ch_value(I,bool)
- otsu(const Image<I>& input);
+ mln_value(I)
+ otsu_threshold(const Image<I>& input);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
- mln_ch_value(I,bool)
- otsu(const Image<I>& input_)
+ mln_value(I)
+ otsu_threshold(const Image<I>& input_)
{
- trace::entering("scribo::binarization::otsu");
+ trace::entering("scribo::binarization::otsu_threshold");
const I& input = exact(input_);
mln_precondition(input.is_valid());
@@ -101,7 +98,7 @@ namespace scribo
/* sigma maximization
sigma stands for inter-class variance
and determines optimal threshold value */
- int threshold = 0;
+ mln_value(I) threshold = literal::zero;
double max_sigma = 0.0;
util::array<double> sigma(hist.nvalues()); // inter-class variance
@@ -122,10 +119,8 @@ namespace scribo
}
}
- // Computing final result.
- mln_ch_value(I,bool) output = global_threshold(input, threshold);
-
- return output;
+ trace::exiting("scribo::binarization::otsu_threshold");
+ return threshold;
}
# endif // ! MLN_INCLUDE_ONLY
@@ -134,4 +129,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_BINARIZATION_OTSU_HH
+#endif // ! SCRIBO_BINARIZATION_OTSU_THRESHOLD_HH
--
1.7.2.5
1
0

22 Nov '11
* scribo/binarization/all.hh: Update includes.
* scribo/binarization/internal/compute_local_threshold.hh,
* scribo/binarization/internal/compute_sauvola_threshold.hh,
* scribo/binarization/internal/first_pass_functor.hh,
* scribo/binarization/internal/local_threshold_debug.hh,
* scribo/binarization/internal/sauvola_debug.hh,
* scribo/binarization/internal/sauvola_formula.hh,
* scribo/binarization/sauvola.hh,
* scribo/binarization/sauvola_ms.hh,
* scribo/binarization/sauvola_threshold.hh,
* scribo/binarization/sauvola_threshold_image.hh: Revamp code in
order to share some parts with Niblack's algorithm.
* scribo/binarization/internal/niblack_formula.hh,
* scribo/binarization/niblack.hh,
* scribo/binarization/niblack_threshold.hh: New.
* src/binarization/Makefile.am
* tests/binarization/Makefile.am: Add new targets.
* src/binarization/niblack.cc: New tool.
* tests/binarization/niblack.cc: New test.
* tests/binarization/niblack.ref.pbm: New test data.
---
scribo/ChangeLog | 31 ++
scribo/scribo/binarization/all.hh | 5 +-
.../internal/compute_local_threshold.hh | 224 +++++++++++++++
.../internal/compute_sauvola_threshold.hh | 285 ------------------
.../binarization/internal/first_pass_functor.hh | 24 +-
.../binarization/internal/local_threshold_debug.hh | 88 ++++++
.../binarization/internal/niblack_formula.hh | 105 +++++++
.../scribo/binarization/internal/sauvola_debug.hh | 87 ------
.../binarization/internal/sauvola_formula.hh | 121 ++++++++
scribo/scribo/binarization/niblack.hh | 218 ++++++++++++++
scribo/scribo/binarization/niblack_threshold.hh | 299 +++++++++++++++++++
scribo/scribo/binarization/sauvola.hh | 24 +-
scribo/scribo/binarization/sauvola_ms.hh | 21 +-
scribo/scribo/binarization/sauvola_threshold.hh | 296 +++++++++++++++++++
.../scribo/binarization/sauvola_threshold_image.hh | 301 --------------------
scribo/src/binarization/Makefile.am | 12 +-
scribo/src/binarization/niblack.cc | 106 +++++++
.../binarization/pgm_sauvola_threshold_image.cc | 7 +-
scribo/tests/binarization/Makefile.am | 3 +
scribo/tests/binarization/niblack.cc | 52 ++++
scribo/tests/binarization/niblack.ref.pbm | Bin 0 -> 32884 bytes
21 files changed, 1597 insertions(+), 712 deletions(-)
create mode 100644 scribo/scribo/binarization/internal/compute_local_threshold.hh
delete mode 100644 scribo/scribo/binarization/internal/compute_sauvola_threshold.hh
create mode 100644 scribo/scribo/binarization/internal/local_threshold_debug.hh
create mode 100644 scribo/scribo/binarization/internal/niblack_formula.hh
delete mode 100644 scribo/scribo/binarization/internal/sauvola_debug.hh
create mode 100644 scribo/scribo/binarization/internal/sauvola_formula.hh
create mode 100644 scribo/scribo/binarization/niblack.hh
create mode 100644 scribo/scribo/binarization/niblack_threshold.hh
create mode 100644 scribo/scribo/binarization/sauvola_threshold.hh
delete mode 100644 scribo/scribo/binarization/sauvola_threshold_image.hh
create mode 100644 scribo/src/binarization/niblack.cc
create mode 100644 scribo/tests/binarization/niblack.cc
create mode 100644 scribo/tests/binarization/niblack.ref.pbm
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 5aa2a06..0923b28 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,34 @@
+2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add Niblack's binarization algorithm.
+
+ * scribo/binarization/all.hh: Update includes.
+
+ * scribo/binarization/internal/compute_local_threshold.hh,
+ * scribo/binarization/internal/compute_sauvola_threshold.hh,
+ * scribo/binarization/internal/first_pass_functor.hh,
+ * scribo/binarization/internal/local_threshold_debug.hh,
+ * scribo/binarization/internal/sauvola_debug.hh,
+ * scribo/binarization/internal/sauvola_formula.hh,
+ * scribo/binarization/sauvola.hh,
+ * scribo/binarization/sauvola_ms.hh,
+ * scribo/binarization/sauvola_threshold.hh,
+ * scribo/binarization/sauvola_threshold_image.hh: Revamp code in
+ order to share some parts with Niblack's algorithm.
+
+ * scribo/binarization/internal/niblack_formula.hh,
+ * scribo/binarization/niblack.hh,
+ * scribo/binarization/niblack_threshold.hh: New.
+
+ * src/binarization/Makefile.am
+ * tests/binarization/Makefile.am: Add new targets.
+
+ * src/binarization/niblack.cc: New tool.
+
+ * tests/binarization/niblack.cc: New test.
+
+ * tests/binarization/niblack.ref.pbm: New test data.
+
2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a new tool for global thresholding.
diff --git a/scribo/scribo/binarization/all.hh b/scribo/scribo/binarization/all.hh
index 6f40505..5530861 100644
--- a/scribo/scribo/binarization/all.hh
+++ b/scribo/scribo/binarization/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -50,6 +51,6 @@ namespace scribo
# include <scribo/binarization/sauvola.hh>
# include <scribo/binarization/sauvola_ms.hh>
# include <scribo/binarization/sauvola_ms_split.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
+# include <scribo/binarization/sauvola_threshold.hh>
#endif // ! SCRIBO_BINARIZATION_ALL_HH
diff --git a/scribo/scribo/binarization/internal/compute_local_threshold.hh b/scribo/scribo/binarization/internal/compute_local_threshold.hh
new file mode 100644
index 0000000..147ef0f
--- /dev/null
+++ b/scribo/scribo/binarization/internal/compute_local_threshold.hh
@@ -0,0 +1,224 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_COMPUTE_LOCAL_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_INTERNAL_COMPUTE_LOCAL_THRESHOLD_HH
+
+
+/// \file
+///
+/// \brief Compute a threshold with Local's binarization formula.
+
+# include <algorithm>
+# include <cmath>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/binarization/internal/local_threshold_debug.hh>
+
+
+
+// extern mln::image2d<double> skewness;
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ namespace internal
+ {
+
+ using namespace mln;
+
+
+ /*! \brief Compute a point wise threshold according to a local
+ binarization formula.
+
+ \param[in] p A site.
+ \param[in] simple An integral image of mean values.
+ \param[in] squared An integral image of squared mean values.
+ \param[in] win_width Window width.
+ \param[in] k Control the threshold value in the local
+ window. The higher, the lower the threshold
+ form the local mean m(x, y).
+ \param[in] R Maximum value of the standard deviation (128
+ for grayscale documents).
+ \param[in] formula The function to use to compute the local
+ threshold.
+
+ \return A threshold.
+ */
+ template <typename P, typename J, typename F>
+ double
+ compute_local_threshold(const P& p,
+ const J& simple,
+ const J& squared,
+ int win_width, double K, double R,
+ const F& formula);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename P, typename J, typename F>
+ double
+ compute_local_threshold(const P& p,
+ const J& simple,
+ const J& squared,
+ int win_width, double K, double R,
+ const F& formula)
+ {
+ mln_precondition(simple.nrows() == squared.nrows());
+ mln_precondition(simple.ncols() == squared.ncols());
+
+ // Window half width.
+ int w_2 = win_width >> 1;
+
+ int row_min = std::max(0, p.row() - w_2 - 1);
+ int col_min = std::max(0, p.col() - w_2 - 1);
+
+ int row_max = std::min(static_cast<int>(simple.nrows()) - 1,
+ p.row() + w_2);
+ int col_max = std::min(static_cast<int>(simple.ncols()) - 1,
+ p.col() + w_2);
+
+
+ double wh = (row_max - row_min) * (col_max - col_min);
+
+ // Mean.
+ double m_x_y_tmp = (simple.at_(row_max, col_max)
+ + simple.at_(row_min, col_min)
+ - simple.at_(row_max, col_min)
+ - simple.at_(row_min, col_max));
+
+ double m_x_y = m_x_y_tmp / wh;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local mean
+ debug_mean(p) = m_x_y * mean_debug_factor;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Standard deviation.
+ double s_x_y_tmp = (squared.at_(row_max, col_max)
+ + squared.at_(row_min, col_min)
+ - squared.at_(row_max, col_min)
+ - squared.at_(row_min, col_max));
+
+ double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local standard deviation
+ debug_stddev(p) = s_x_y * stddev_debug_factor;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Thresholding.
+ // skewness_ = skewness(p);
+ // b = (p == point2d(5,5));
+ double t_x_y = formula(m_x_y, s_x_y, K, R);
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ double alpha = K * (1 - s_x_y / R);
+ debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
+ debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
+# endif // !SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ return t_x_y;
+ }
+
+
+ template <typename P, typename J, typename F>
+ double
+ compute_local_threshold_single_image(const P& p,
+ const J& integral,
+ int win_width,
+ double K, double R,
+ const F& formula)
+ {
+ // Window half width.
+ int w_2 = win_width >> 1;
+
+ int row_min = std::max(0, p.row() - w_2);
+ int col_min = std::max(0, p.col() - w_2);
+
+ int row_max = std::min(static_cast<int>(integral.nrows()) - 1,
+ p.row() + w_2);
+ int col_max = std::min(static_cast<int>(integral.ncols()) - 1,
+ p.col() + w_2);
+
+
+ double wh = (row_max - row_min + 1) * (col_max - col_min + 1);
+
+ // Mean.
+ double m_x_y_tmp = (integral.at_(row_max, col_max).first()
+ + integral.at_(row_min, col_min).first()
+ - integral.at_(row_max, col_min).first()
+ - integral.at_(row_min, col_max).first());
+
+ double m_x_y = m_x_y_tmp / wh;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local mean
+ debug_mean(p) = m_x_y * mean_debug_factor;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Standard deviation.
+ double s_x_y_tmp = (integral.at_(row_max, col_max).second()
+ + integral.at_(row_min, col_min).second()
+ - integral.at_(row_max, col_min).second()
+ - integral.at_(row_min, col_max).second());
+
+ double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local standard deviation
+ debug_stddev(p) = s_x_y * stddev_debug_factor;
+# endif // !SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Thresholding.
+ double t_x_y = formula(m_x_y, s_x_y, K, R);
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ double alpha = K * (1 - s_x_y / R);
+ debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
+ debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
+# endif // !SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ return t_x_y;
+ }
+
+
+#endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_COMPUTE_LOCAL_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/internal/compute_sauvola_threshold.hh b/scribo/scribo/binarization/internal/compute_sauvola_threshold.hh
deleted file mode 100644
index d3ca07f..0000000
--- a/scribo/scribo/binarization/internal/compute_sauvola_threshold.hh
+++ /dev/null
@@ -1,285 +0,0 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_BINARIZATION_INTERNAL_COMPUTE_SAUVOLA_THRESHOLD_HH
-# define SCRIBO_BINARIZATION_INTERNAL_COMPUTE_SAUVOLA_THRESHOLD_HH
-
-
-/// \file
-///
-/// \brief Compute a threshold with Sauvola's binarization formula.
-
-# include <algorithm>
-# include <cmath>
-
-# include <mln/core/image/image2d.hh>
-# include <mln/value/int_u8.hh>
-
-# include <scribo/binarization/internal/sauvola_debug.hh>
-
-
-// Setup default Sauvola's formulae parameters values.
-// These macros may be used in other variant of Sauvola's algorithm.
-//
-// Values are set according to the following reference: "Automatic
-// Evaluation of Document Binarization Results", Badekas and al, 2005
-//
-// Badekas et al. said 0.34 was best.
-# define SCRIBO_DEFAULT_SAUVOLA_K 0.34
-//
-// 128 is best for grayscale documents.
-# define SCRIBO_DEFAULT_SAUVOLA_R 128
-
-
-namespace scribo
-{
-
- namespace binarization
- {
-
- namespace internal
- {
-
- using namespace mln;
-
-
- /*! \brief Compute a point wise threshold according Sauvola's
- binarization.
-
- \param[in] p A site.
- \param[in] simple An integral image of mean values.
- \param[in] squared An integral image of squared mean values.
- \param[in] win_width Window width.
- \param[in] k Control the threshold value in the local
- window. The higher, the lower the threshold
- form the local mean m(x, y).
- \param[in] R Maximum value of the standard deviation (128
- for grayscale documents).
-
- \return A threshold.
- */
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width, double K, double R);
-
- /// \overload
- /// K is set to 0.34 and R to 128.
- //
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width);
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
-
- /*! \brief compute Sauvola's threshold applying directly the formula.
-
- \param[in] m_x_y Mean value.
- \param[in] s_x_y Standard deviation.
- \param[in] k Control the threshold value in the local
- window. The higher, the lower the threshold
- form the local mean m(x, y).
- \param[in] R Maximum value of the standard deviation (128
- for grayscale documents).
-
- \return A threshold.
- */
- inline
- double
- sauvola_threshold_formula(const double m_x_y, const double s_x_y,
- const double K, const double R)
- {
- return m_x_y * (1.0 + K * ((s_x_y / R) - 1.0));
- }
-
- /// \overload
- /// K is set to 0.34 and R to 128.
- //
- inline
- double
- sauvola_threshold_formula(double m_x_y, double s_x_y)
- {
- return sauvola_threshold_formula(m_x_y, s_x_y,
- SCRIBO_DEFAULT_SAUVOLA_K,
- SCRIBO_DEFAULT_SAUVOLA_R);
- }
-
-
-
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width, double K, double R)
- {
- mln_precondition(simple.nrows() == squared.nrows());
- mln_precondition(simple.ncols() == squared.ncols());
-
- // Window half width.
- int w_2 = win_width >> 1;
-
- int row_min = std::max(0, p.row() - w_2 - 1);
- int col_min = std::max(0, p.col() - w_2 - 1);
-
- int row_max = std::min(static_cast<int>(simple.nrows()) - 1,
- p.row() + w_2);
- int col_max = std::min(static_cast<int>(simple.ncols()) - 1,
- p.col() + w_2);
-
-
- double wh = (row_max - row_min) * (col_max - col_min);
-
- // Mean.
- double m_x_y_tmp = (simple.at_(row_max, col_max)
- + simple.at_(row_min, col_min)
- - simple.at_(row_max, col_min)
- - simple.at_(row_min, col_max));
-
- double m_x_y = m_x_y_tmp / wh;
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local mean
- debug_mean(p) = m_x_y * mean_debug_factor;
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Standard deviation.
- double s_x_y_tmp = (squared.at_(row_max, col_max)
- + squared.at_(row_min, col_min)
- - squared.at_(row_max, col_min)
- - squared.at_(row_min, col_max));
-
- double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local standard deviation
- debug_stddev(p) = s_x_y * stddev_debug_factor;
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Thresholding.
- double t_x_y = sauvola_threshold_formula(m_x_y, s_x_y, K, R);
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- double alpha = K * (1 - s_x_y / R);
- debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
- debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
-# endif // !SCRIBO_SAUVOLA_DEBUG
-
- return t_x_y;
- }
-
-
- template <typename P, typename J>
- double
- compute_sauvola_threshold_single_image(const P& p,
- const J& integral,
- int win_width,
- double K, double R)
- {
- // Window half width.
- int w_2 = win_width >> 1;
-
- int row_min = std::max(0, p.row() - w_2);
- int col_min = std::max(0, p.col() - w_2);
-
- int row_max = std::min(static_cast<int>(integral.nrows()) - 1,
- p.row() + w_2);
- int col_max = std::min(static_cast<int>(integral.ncols()) - 1,
- p.col() + w_2);
-
-
- double wh = (row_max - row_min + 1) * (col_max - col_min + 1);
-
- // Mean.
- double m_x_y_tmp = (integral.at_(row_max, col_max).first()
- + integral.at_(row_min, col_min).first()
- - integral.at_(row_max, col_min).first()
- - integral.at_(row_min, col_max).first());
-
- double m_x_y = m_x_y_tmp / wh;
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local mean
- debug_mean(p) = m_x_y * mean_debug_factor;
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Standard deviation.
- double s_x_y_tmp = (integral.at_(row_max, col_max).second()
- + integral.at_(row_min, col_min).second()
- - integral.at_(row_max, col_min).second()
- - integral.at_(row_min, col_max).second());
-
- double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local standard deviation
- debug_stddev(p) = s_x_y * stddev_debug_factor;
-# endif // !SCRIBO_SAUVOLA_DEBUG
-
- // Thresholding.
- double t_x_y = sauvola_threshold_formula(m_x_y, s_x_y, K, R);
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- double alpha = K * (1 - s_x_y / R);
- debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
- debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
-# endif // !SCRIBO_SAUVOLA_DEBUG
-
- return t_x_y;
- }
-
-
-
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width)
- {
- return compute_sauvola_threshold(p, simple, squared, win_width,
- SCRIBO_DEFAULT_SAUVOLA_K,
- SCRIBO_DEFAULT_SAUVOLA_R);
- }
-
-
-#endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::binarization::internal
-
- } // end of namespace scribo::binarization
-
-} // end of namespace scribo
-
-#endif // ! SCRIBO_BINARIZATION_INTERNAL_COMPUTE_SAUVOLA_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/internal/first_pass_functor.hh b/scribo/scribo/binarization/internal/first_pass_functor.hh
index 0b1a7ac..8da401b 100644
--- a/scribo/scribo/binarization/internal/first_pass_functor.hh
+++ b/scribo/scribo/binarization/internal/first_pass_functor.hh
@@ -37,7 +37,11 @@
# include <mln/value/int_u8.hh>
# include <mln/data/fill.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
+# include <scribo/binarization/internal/sauvola_formula.hh>
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+# include <scribo/binarization/internal/local_threshold_debug.hh>
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
namespace scribo
@@ -67,8 +71,11 @@ namespace scribo
mln::util::array<int> dp;
double K_;
+ double R_;
+
+ sauvola_formula formula_;
- first_pass_functor(const I& input, double K);
+ first_pass_functor(const I& input, double K, double R);
void exec(double mean, double stddev);
void finalize();
@@ -88,10 +95,11 @@ namespace scribo
template <typename I>
- first_pass_functor<I>::first_pass_functor(const I& input, double K)
+ first_pass_functor<I>::first_pass_functor(const I& input, double K, double R)
: input(input),
pxl(input),
- K_(K)
+ K_(K),
+ R_(R)
{
res = 0;
pxl.start();
@@ -100,10 +108,10 @@ namespace scribo
initialize(parent, input);
initialize(msk, input);
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
initialize(debug_mean, input);
initialize(debug_stddev, input);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
mln::extension::fill(msk, false);
@@ -124,9 +132,7 @@ namespace scribo
unsigned p = pxl.offset();
value::int_u8 t_p;
- mln::convert::from_to(sauvola_threshold_formula(mean, stddev,
- K_,
- SCRIBO_DEFAULT_SAUVOLA_R),
+ mln::convert::from_to(formula_(mean, stddev, K_, R_),
t_p);
msk.element(p) = input.element(p) < t_p;
diff --git a/scribo/scribo/binarization/internal/local_threshold_debug.hh b/scribo/scribo/binarization/internal/local_threshold_debug.hh
new file mode 100644
index 0000000..a9da06c
--- /dev/null
+++ b/scribo/scribo/binarization/internal/local_threshold_debug.hh
@@ -0,0 +1,88 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_LOCAL_THRESHOLD_DEBUG_HH
+# define SCRIBO_BINARIZATION_INTERNAL_LOCAL_THRESHOLD_DEBUG_HH
+
+/// \file
+///
+/// \brief Declare all debug related variables for local based
+/// algorithms.
+
+
+/// FIXME: A struct may be a bit better...
+
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+ namespace internal
+ {
+
+ char* stddev_image_output = 0;
+ char* mean_image_output = 0;
+ char* threshold_image_output = 0;
+
+ char* scale_image_output = 0;
+
+ char* alpham_image_output = 0;
+ char* alphacond_image_output = 0;
+
+ // Declare debug images.
+ image2d<double> debug_stddev;
+ image2d<double> debug_mean;
+ image2d<double> debug_threshold;
+
+ image2d<double> debug_alpham;
+ image2d<bool> debug_alphacond;
+
+ double mean_debug_factor = 1.0;
+ double stddev_debug_factor = 1.0;
+ double alpham_debug_factor = 2.0;
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_LOCAL_THRESHOLD_DEBUG_HH
diff --git a/scribo/scribo/binarization/internal/niblack_formula.hh b/scribo/scribo/binarization/internal/niblack_formula.hh
new file mode 100644
index 0000000..54dbc9b
--- /dev/null
+++ b/scribo/scribo/binarization/internal/niblack_formula.hh
@@ -0,0 +1,105 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_NIBLACK_FORMULA_HH
+# define SCRIBO_BINARIZATION_INTERNAL_NIBLACK_FORMULA_HH
+
+
+/// \file
+///
+/// \brief Routines computing a threshold using Niblack's binarization
+/// formula.
+
+// \fixme Having an unused parameter to fulfill the required interface
+// may not be the best solution...
+
+// Setup default Niblack's formula parameters values.
+# define SCRIBO_DEFAULT_NIBLACK_K -0.2
+
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ namespace internal
+ {
+
+ struct niblack_formula
+ {
+
+ /*! \brief compute a threshold using Niblack's formula.
+
+ \param[in] m_x_y Mean value.
+ \param[in] s_x_y Standard deviation.
+ \param[in] k Control the threshold value in the local
+ window. The higher, the lower the threshold
+ form the local mean m(x, y).
+ \param[in] R Maximum value of the standard deviation (128
+ for grayscale documents). Unused in this formula.
+
+ \return A threshold.
+ */
+ double operator()(const double m_x_y, const double s_x_y,
+ const double K, const double R) const;
+
+ /*!
+ \overload K = 0.34.
+ */
+ double operator()(const double m_x_y, const double s_x_y) const;
+
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ double
+ niblack_formula::operator()(const double m_x_y, const double s_x_y,
+ const double K, const double /*R*/) const
+ {
+ return m_x_y + K * s_x_y;
+ }
+
+ inline
+ double
+ niblack_formula::operator()(const double m_x_y, const double s_x_y) const
+ {
+ return (*this)(m_x_y, s_x_y,
+ SCRIBO_DEFAULT_NIBLACK_K, 128);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_NIBLACK_FORMULA_HH
diff --git a/scribo/scribo/binarization/internal/sauvola_debug.hh b/scribo/scribo/binarization/internal/sauvola_debug.hh
deleted file mode 100644
index 0f8ccf0..0000000
--- a/scribo/scribo/binarization/internal/sauvola_debug.hh
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_DEBUG_HH
-# define SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_DEBUG_HH
-
-/// \file
-///
-/// \brief Declare all debug related variables for Sauvola*
-/// algorithms.
-
-
-/// FIXME: A struct may be a bit better...
-
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
-
-# ifndef MLN_INCLUDE_ONLY
-
-
-namespace scribo
-{
-
- namespace binarization
- {
-
- using namespace mln;
-
- namespace internal
- {
-
- char* stddev_image_output = 0;
- char* mean_image_output = 0;
- char* threshold_image_output = 0;
-
- char* scale_image_output = 0;
-
- char* alpham_image_output = 0;
- char* alphacond_image_output = 0;
-
- // Declare debug images.
- image2d<double> debug_stddev;
- image2d<double> debug_mean;
- image2d<double> debug_threshold;
-
- image2d<double> debug_alpham;
- image2d<bool> debug_alphacond;
-
- double mean_debug_factor = 1.0;
- double stddev_debug_factor = 1.0;
- double alpham_debug_factor = 2.0;
-
- } // end of namespace scribo::binarization::internal
-
- } // end of namespace scribo::binarization
-
-} // end of namespace scribo
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
-
-#endif // ! SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_DEBUG_HH
diff --git a/scribo/scribo/binarization/internal/sauvola_formula.hh b/scribo/scribo/binarization/internal/sauvola_formula.hh
new file mode 100644
index 0000000..3251abd
--- /dev/null
+++ b/scribo/scribo/binarization/internal/sauvola_formula.hh
@@ -0,0 +1,121 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_FORMULA_HH
+# define SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_FORMULA_HH
+
+
+/// \file
+///
+/// \brief Routines computing a threshold using Sauvola's binarization
+/// formula.
+
+
+// Setup default Sauvola's formula parameters values.
+// These macros may be used in other variant of Sauvola's algorithms.
+//
+// Values are set according to the following reference: "Automatic
+// Evaluation of Document Binarization Results", Badekas and al, 2005
+//
+// Badekas et al. said 0.34 was best for Sauvola.
+# define SCRIBO_DEFAULT_SAUVOLA_K 0.34
+//
+// 128 is best for grayscale documents.
+# define SCRIBO_DEFAULT_SAUVOLA_R 128
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ namespace internal
+ {
+
+ struct sauvola_formula
+ {
+
+ /*! \brief Compute a threshold using Sauvola's formula.
+
+ \param[in] m_x_y Mean value.
+ \param[in] s_x_y Standard deviation.
+ \param[in] k Control the threshold value in the local
+ window. The higher, the lower the threshold
+ form the local mean m(x, y).
+ \param[in] R Maximum value of the standard deviation (128
+ for grayscale documents).
+
+ \return A threshold.
+ */
+ double operator()(const double m_x_y, const double s_x_y,
+ const double K, const double R) const;
+
+ /*!
+ \overload K = 0.34 and R = 128.
+ */
+ double operator()(const double m_x_y, const double s_x_y) const;
+
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ bool b;
+ double skewness_;
+
+ inline
+ double
+ sauvola_formula::operator()(const double m_x_y, const double s_x_y,
+ const double K, const double R) const
+ {
+ // if (b)
+ // std::cout << skewness_ << " - " << (K * -1 * skewness_) << std::endl;
+ // volatile double new_t = ((skewness_ < 0) ? -skewness_ : 1 * m_x_y * (1.0 + K * ((s_x_y / R) - 1.0)));
+ // volatile double old_t = (m_x_y * (1.0 + K * ((s_x_y / R) - 1.0)));
+ // if (skewness_ > 0)
+ // if (new_t != old_t)
+ // std::cout << skewness_ << " - " << new_t << " vs " << old_t << std::endl;
+
+ return m_x_y * (1.0 + K * ((s_x_y / R) - 1.0));
+ }
+
+ inline
+ double
+ sauvola_formula::operator()(const double m_x_y, const double s_x_y) const
+ {
+ return (*this)(m_x_y, s_x_y,
+ SCRIBO_DEFAULT_SAUVOLA_K, SCRIBO_DEFAULT_SAUVOLA_R);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_FORMULA_HH
diff --git a/scribo/scribo/binarization/niblack.hh b/scribo/scribo/binarization/niblack.hh
new file mode 100644
index 0000000..e66e7b4
--- /dev/null
+++ b/scribo/scribo/binarization/niblack.hh
@@ -0,0 +1,218 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_NIBLACK_HH
+# define SCRIBO_BINARIZATION_NIBLACK_HH
+
+/// \file
+///
+///
+
+# include <mln/core/concept/image.hh>
+# include <mln/data/transform.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/binarization/niblack_threshold.hh>
+# include <scribo/binarization/local_threshold.hh>
+# include <scribo/binarization/internal/local_threshold_debug.hh>
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+# include <mln/io/pgm/save.hh>
+# include <mln/io/pbm/save.hh>
+# include <mln/data/saturate.hh>
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+
+ /*! \brief Convert an image into a binary image.
+
+ \input[in] input An image.
+ \input[in] window_size The window size.
+ \input[in] K Niblack's formulae constant.
+
+ \return A binary image.
+
+ */
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size, double K);
+
+
+
+ /*! \brief Convert an image into a binary image.
+
+ Niblack's formulae constant K is set to 0.34.
+
+ \input[in] input An image.
+ \input[in] window_size The window size.
+
+ \return A binary image.
+
+ */
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size);
+
+
+ /// \overload
+ /// The window size is set to 11.
+ //
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementations.
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size, double K)
+ {
+ trace::entering("scribo::binarization::impl::generic::niblack");
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I,value::int_u8)
+ threshold_image = binarization::niblack_threshold(input, window_size, K);
+
+ mln_ch_value(I, bool)
+ output = local_threshold(input, threshold_image);
+
+ trace::exiting("scribo::binarization::impl::generic::niblack");
+ return output;
+ }
+
+ } // end of namespace scribo::binarization::impl::generic
+
+
+ } // end of namespace scribo::binarization::impl
+
+
+
+ // Dispatch
+
+ namespace internal
+ {
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack_dispatch(const mln_value(I)&,
+ const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ return impl::generic::niblack(input, window_size, K);
+ }
+
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack_dispatch(const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ typedef mln_value(I) V;
+ return niblack_dispatch(V(), input, window_size, K);
+ }
+
+ } // end of namespace scribo::binarization::internal
+
+
+
+ // Facades
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size, double K)
+ {
+ trace::entering("scribo::binarization::niblack");
+
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I, bool)
+ output = internal::niblack_dispatch(input, window_size, K);
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ if (internal::stddev_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_stddev),
+ internal::stddev_image_output);
+ if (internal::mean_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_mean),
+ internal::mean_image_output);
+ if (internal::threshold_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_threshold),
+ internal::threshold_image_output);
+
+ if (internal::alpham_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_alpham),
+ internal::alpham_image_output);
+ if (internal::alphacond_image_output)
+ io::pbm::save(internal::debug_alphacond, internal::alphacond_image_output);
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+
+ trace::exiting("scribo::binarization::niblack");
+ return output;
+ }
+
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size)
+ {
+ return niblack(input, window_size, SCRIBO_DEFAULT_NIBLACK_K);
+ }
+
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input)
+ {
+ return niblack(input, 11);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_BINARIZATION_NIBLACK_HH
diff --git a/scribo/scribo/binarization/niblack_threshold.hh b/scribo/scribo/binarization/niblack_threshold.hh
new file mode 100644
index 0000000..db4a74e
--- /dev/null
+++ b/scribo/scribo/binarization/niblack_threshold.hh
@@ -0,0 +1,299 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_NIBLACK_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_NIBLACK_THRESHOLD_HH
+
+/// \file
+///
+/// Compute an image of local threshold using Niblack algorithm.
+
+/// \fixme return type too restrictive!
+/// \fixme Revamp code and merge with sauvola_threshold.hh.
+
+# include <algorithm>
+# include <cmath>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/int_u.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/core/init_integral_image.hh>
+# include <scribo/binarization/internal/compute_local_threshold.hh>
+# include <scribo/binarization/internal/niblack_formula.hh>
+
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+ /*! \brief Compute an image of local threshold using Niblack algorithm.
+
+ \input[in] input A gray level image.
+ \input[in] window_size The window size.
+ \input[out] simple The sum of all intensities of \p input.
+ \input[out] squared The sum of all squared intensities of \p
+ input.
+
+ \return An image of local thresholds.
+
+ */
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared);
+
+ /// \overload
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K);
+
+ /// \overload
+ /// K is set to 0.34
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size);
+
+
+ /// \overload
+ /// The window size is set to 11.
+ //
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation
+
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ niblack_threshold(const Image<I>& input_, unsigned window_size,
+ double K,
+ Image<J>& simple_,
+ Image<J>& squared_)
+ {
+ trace::entering("scribo::binarization::impl::generic::niblack_threshold");
+
+ const I& input = exact(input_);
+ J& simple = exact(simple_);
+ J& squared = exact(squared_);
+
+ mln_assertion(input.is_valid());
+ mln_assertion(simple.is_valid());
+ mln_assertion(squared.is_valid());
+
+ typedef mln_value(I) V;
+ typedef mln_site(I) P;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ initialize(internal::debug_mean, input);
+ initialize(internal::debug_stddev, input);
+ initialize(internal::debug_threshold, input);
+ initialize(internal::debug_alpham, input);
+ initialize(internal::debug_alphacond, input);
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ mln_concrete(I) output;
+ initialize(output, input);
+
+ const mln::def::coord
+ nrows = static_cast<mln::def::coord>(input.nrows()),
+ ncols = static_cast<mln::def::coord>(input.ncols());
+
+
+ internal::niblack_formula formula;
+ for(mln::def::coord row = 0; row < nrows; ++row)
+ for(mln::def::coord col = 0; col < ncols; ++col)
+ {
+ // FIXME: Setting R parameter to 128 should not be
+ // hard-coded. Even though it is not used in Niblack's
+ // formula, this parameter is used for debug images and
+ // should be adapted to the data range values.
+ double t = internal::compute_local_threshold(P(row, col), simple,
+ squared, window_size,
+ K,
+ 128,
+ formula);
+ mln::convert::from_to(t, output.at_(row, col));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ internal::debug_threshold.at_(row, col) = t;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+ }
+
+ trace::exiting("scribo::binarization::impl::generic::niblack_threshold");
+ return output;
+ }
+
+ } // end of namespace scribo::binarization::impl::generic
+
+
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ niblack_threshold_gl(const I& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ return impl::generic::niblack_threshold(input, window_size, K,
+ simple, squared);
+ }
+
+
+ } // end of namespace scribo::binarization::impl
+
+
+
+
+ // Dispatch
+
+ namespace internal
+ {
+
+ template <unsigned n, typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u<n>)
+ niblack_threshold_dispatch(const value::int_u<n>&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ return impl::niblack_threshold_gl(input, window_size, K,
+ simple, squared);
+ }
+
+
+ template <typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold_dispatch(const mln_value(I)&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ // No dispatch for this kind of value type.
+ mlc_abort(I)::check();
+
+ typedef mln_ch_value(I,bool) output_t;
+ return output_t();
+ }
+
+
+ } // end of namespace scribo::binarization::internal
+
+
+
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ trace::entering("scribo::binarization::niblack_threshold");
+
+ mln_precondition(mln_site_(I)::dim == 2);
+ mln_precondition(exact(input).is_valid());
+
+ typedef mln_value(I) value_t;
+ mln_ch_value(I, value::int_u8)
+ output = internal::niblack_threshold_dispatch(value_t(),
+ exact(input),
+ window_size,
+ K,
+ exact(simple),
+ exact(squared));
+
+ trace::exiting("scribo::text::ppm2pbm");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ mln_ch_value(I, double)
+ simple = init_integral_image(input, scribo::internal::identity_),
+ squared = init_integral_image(input, scribo::internal::square_);
+
+ return niblack_threshold(input, window_size,
+ K, simple, squared);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size)
+ {
+ return niblack_threshold(input, window_size,
+ SCRIBO_DEFAULT_NIBLACK_K);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input)
+ {
+ return niblack_threshold(input, 11);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_BINARIZATION_NIBLACK_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/sauvola.hh b/scribo/scribo/binarization/sauvola.hh
index 45891c3..fc3e104 100644
--- a/scribo/scribo/binarization/sauvola.hh
+++ b/scribo/scribo/binarization/sauvola.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -35,15 +35,15 @@
# include <mln/data/transform.hh>
# include <mln/value/int_u8.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
+# include <scribo/binarization/sauvola_threshold.hh>
# include <scribo/binarization/local_threshold.hh>
-# include <scribo/binarization/internal/sauvola_debug.hh>
+# include <scribo/binarization/internal/local_threshold_debug.hh>
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
# include <mln/io/pgm/save.hh>
# include <mln/io/pbm/save.hh>
# include <mln/data/saturate.hh>
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
namespace scribo
{
@@ -110,11 +110,11 @@ namespace scribo
trace::entering("scribo::binarization::impl::generic::sauvola");
mln_precondition(exact(input).is_valid());
+ mln_ch_value(I,value::int_u8)
+ threshold_image = binarization::sauvola_threshold(input, window_size, K);
+
mln_ch_value(I, bool)
- output = local_threshold(input,
- binarization::sauvola_threshold_image(input,
- window_size,
- K));
+ output = local_threshold(input, threshold_image);
trace::exiting("scribo::binarization::impl::generic::sauvola");
return output;
@@ -168,7 +168,7 @@ namespace scribo
mln_ch_value(I, bool)
output = internal::sauvola_dispatch(input, window_size, K);
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::stddev_image_output)
io::pgm::save(data::saturate(value::int_u8(), internal::debug_stddev),
internal::stddev_image_output);
@@ -184,7 +184,7 @@ namespace scribo
internal::alpham_image_output);
if (internal::alphacond_image_output)
io::pbm::save(internal::debug_alphacond, internal::alphacond_image_output);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
trace::exiting("scribo::binarization::sauvola");
diff --git a/scribo/scribo/binarization/sauvola_ms.hh b/scribo/scribo/binarization/sauvola_ms.hh
index c1a3414..36629f9 100644
--- a/scribo/scribo/binarization/sauvola_ms.hh
+++ b/scribo/scribo/binarization/sauvola_ms.hh
@@ -60,16 +60,15 @@
# include <scribo/core/macros.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
# include <scribo/binarization/internal/first_pass_functor.hh>
# include <scribo/canvas/integral_browsing.hh>
-# ifdef SCRIBO_SAUVOLA_DEBUG
-# include <scribo/binarization/internal/sauvola_debug.hh>
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+# include <scribo/binarization/internal/local_threshold_debug.hh>
# include <mln/io/pgm/save.hh>
# include <scribo/make/debug_filename.hh>
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
@@ -179,7 +178,7 @@ namespace scribo
// 1st pass
scribo::binarization::internal::first_pass_functor< image2d<int_u8> >
- f(sub, K);
+ f(sub, K, SCRIBO_DEFAULT_SAUVOLA_R);
scribo::canvas::integral_browsing(integral_sum_sum_2,
ratio,
w_local_w, w_local_h,
@@ -259,10 +258,10 @@ namespace scribo
} // end of 2nd pass
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
io::pbm::save(f.msk,
scribo::make::debug_filename(internal::threshold_image_output).c_str());
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
return f.t_sub;
}
@@ -923,18 +922,18 @@ namespace scribo
}
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::scale_image_output)
io::pgm::save(e_2, internal::scale_image_output);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
// Propagate scale values.
e_2 = transform::influence_zone_geodesic(e_2, c8());
-// # ifdef SCRIBO_SAUVOLA_DEBUG
+// # ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
// if (internal::scale_image_output)
// io::pgm::save(e_2, internal::scale_image_output);
-// # endif // ! SCRIBO_SAUVOLA_DEBUG
+// # endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
// Binarize
image2d<bool>
diff --git a/scribo/scribo/binarization/sauvola_threshold.hh b/scribo/scribo/binarization/sauvola_threshold.hh
new file mode 100644
index 0000000..df46e95
--- /dev/null
+++ b/scribo/scribo/binarization/sauvola_threshold.hh
@@ -0,0 +1,296 @@
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_HH
+
+/// \file
+///
+/// Compute an image of local threshold using Sauvola algorithm.
+
+/// \fixme return type too restrictive!
+
+# include <algorithm>
+# include <cmath>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/int_u.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/core/init_integral_image.hh>
+# include <scribo/binarization/internal/compute_local_threshold.hh>
+# include <scribo/binarization/internal/sauvola_formula.hh>
+
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+ /*! \brief Compute an image of local threshold using Sauvola algorithm.
+
+ \input[in] input A gray level image.
+ \input[in] window_size The window size.
+ \input[out] simple The sum of all intensities of \p input.
+ \input[out] squared The sum of all squared intensities of \p
+ input.
+
+ \return An image of local thresholds.
+
+ */
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared);
+
+ /// \overload
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K);
+
+ /// \overload
+ /// K is set to 0.34
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size);
+
+
+ /// \overload
+ /// The window size is set to 11.
+ //
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation
+
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ sauvola_threshold(const Image<I>& input_, unsigned window_size,
+ double K,
+ Image<J>& simple_,
+ Image<J>& squared_)
+ {
+ trace::entering("scribo::binarization::impl::generic::sauvola_threshold");
+
+ const I& input = exact(input_);
+ J& simple = exact(simple_);
+ J& squared = exact(squared_);
+
+ mln_assertion(input.is_valid());
+ mln_assertion(simple.is_valid());
+ mln_assertion(squared.is_valid());
+
+ typedef mln_value(I) V;
+ typedef mln_site(I) P;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ initialize(internal::debug_mean, input);
+ initialize(internal::debug_stddev, input);
+ initialize(internal::debug_threshold, input);
+ initialize(internal::debug_alpham, input);
+ initialize(internal::debug_alphacond, input);
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Sauvola Algorithm with I.I.
+
+ mln_concrete(I) output;
+ initialize(output, input);
+
+ const mln::def::coord
+ nrows = static_cast<mln::def::coord>(input.nrows()),
+ ncols = static_cast<mln::def::coord>(input.ncols());
+
+ internal::sauvola_formula formula;
+ for(mln::def::coord row = 0; row < nrows; ++row)
+ for(mln::def::coord col = 0; col < ncols; ++col)
+ {
+ double t = internal::compute_local_threshold(P(row, col), simple,
+ squared, window_size,
+ K,
+ SCRIBO_DEFAULT_SAUVOLA_R,
+ formula);
+ mln::convert::from_to(t, output.at_(row, col));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ internal::debug_threshold.at_(row, col) = t;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+ }
+
+ trace::exiting("scribo::binarization::impl::generic::sauvola_threshold");
+ return output;
+ }
+
+ } // end of namespace scribo::binarization::impl::generic
+
+
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ sauvola_threshold_gl(const I& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ return impl::generic::sauvola_threshold(input, window_size, K,
+ simple, squared);
+ }
+
+
+ } // end of namespace scribo::binarization::impl
+
+
+
+
+ // Dispatch
+
+ namespace internal
+ {
+
+ template <unsigned n, typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u<n>)
+ sauvola_threshold_dispatch(const value::int_u<n>&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ return impl::sauvola_threshold_gl(input, window_size, K,
+ simple, squared);
+ }
+
+
+ template <typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold_dispatch(const mln_value(I)&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ // No dispatch for this kind of value type.
+ mlc_abort(I)::check();
+
+ typedef mln_ch_value(I,bool) output_t;
+ return output_t();
+ }
+
+
+ } // end of namespace scribo::binarization::internal
+
+
+
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ trace::entering("scribo::binarization::sauvola_threshold");
+
+ mln_precondition(mln_site_(I)::dim == 2);
+ mln_precondition(exact(input).is_valid());
+
+ typedef mln_value(I) value_t;
+ mln_ch_value(I, value::int_u8)
+ output = internal::sauvola_threshold_dispatch(value_t(),
+ exact(input),
+ window_size,
+ K,
+ exact(simple),
+ exact(squared));
+
+ trace::exiting("scribo::text::ppm2pbm");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ mln_ch_value(I, double)
+ simple = init_integral_image(input, scribo::internal::identity_),
+ squared = init_integral_image(input, scribo::internal::square_);
+
+ return sauvola_threshold(input, window_size,
+ K, simple, squared);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size)
+ {
+ return sauvola_threshold(input, window_size,
+ SCRIBO_DEFAULT_SAUVOLA_K);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input)
+ {
+ return sauvola_threshold(input, 11);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/sauvola_threshold_image.hh b/scribo/scribo/binarization/sauvola_threshold_image.hh
deleted file mode 100644
index 94cd688..0000000
--- a/scribo/scribo/binarization/sauvola_threshold_image.hh
+++ /dev/null
@@ -1,301 +0,0 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_IMAGE_HH
-# define SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_IMAGE_HH
-
-/// \file
-///
-/// Compute an image of local threshold using Sauvola algorithm.
-
-/// \fixme return type too restrictive!
-
-# include <algorithm>
-# include <cmath>
-
-# include <mln/core/image/image2d.hh>
-# include <mln/value/int_u.hh>
-# include <mln/value/int_u8.hh>
-
-# include <scribo/core/init_integral_image.hh>
-# include <scribo/binarization/internal/compute_sauvola_threshold.hh>
-
-
-
-namespace scribo
-{
-
- namespace binarization
- {
-
- using namespace mln;
-
- /*! \brief Compute an image of local threshold using Sauvola algorithm.
-
- \input[in] input An image.
- \input[in] window_size The window size.
- \input[out] simple The sum of all intensities of \p input.
- \input[out] squared The sum of all squared intensities of \p
- input.
-
- \return An image of local thresholds.
-
- */
- template <typename I, typename J>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K,
- Image<J>& simple,
- Image<J>& squared);
-
- /// \overload
- template <typename I>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K);
-
- /// \overload
- /// K is set to 0.34
- template <typename I>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size);
-
-
- /// \overload
- /// The window size is set to 11.
- //
- template <typename I>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input);
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- // Implementation
-
-
- namespace impl
- {
-
- namespace generic
- {
-
- template <typename I, typename J>
- inline
- mln_concrete(I)
- sauvola_threshold_image(const Image<I>& input_, unsigned window_size,
- double K,
- Image<J>& simple_,
- Image<J>& squared_)
- {
- trace::entering("scribo::binarization::impl::generic::sauvola_threshold_image");
-
- const I& input = exact(input_);
- J& simple = exact(simple_);
- J& squared = exact(squared_);
-
- mln_assertion(input.is_valid());
- mln_assertion(simple.is_valid());
- mln_assertion(squared.is_valid());
-
- typedef mln_value(I) V;
- typedef mln_site(I) P;
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- initialize(internal::debug_mean, input);
- initialize(internal::debug_stddev, input);
- initialize(internal::debug_threshold, input);
- initialize(internal::debug_alpham, input);
- initialize(internal::debug_alphacond, input);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Sauvola Algorithm with I.I.
-
- mln_concrete(I) output;
- initialize(output, input);
-
- const mln::def::coord
- nrows = static_cast<mln::def::coord>(input.nrows()),
- ncols = static_cast<mln::def::coord>(input.ncols());
-
-
- for(mln::def::coord row = 0; row < nrows; ++row)
- for(mln::def::coord col = 0; col < ncols; ++col)
- {
-# ifdef SCRIBO_SAUVOLA_DEBUG
-
- double t = internal::compute_sauvola_threshold(P(row, col), simple,
- squared, window_size,
- K,
- SCRIBO_DEFAULT_SAUVOLA_R);
- mln::convert::from_to(t, output.at_(row, col));
- internal::debug_threshold.at_(row, col) = t;
-# else
- mln::convert::from_to(
- internal::compute_sauvola_threshold(P(row, col), simple,
- squared, window_size,
- K,
- SCRIBO_DEFAULT_SAUVOLA_R),
- output.at_(row, col));
-# endif // ! SCRIBO_SAUVOLA_DEBUG
- }
-
- trace::exiting("scribo::binarization::impl::generic::sauvola_threshold");
- return output;
- }
-
- } // end of namespace scribo::binarization::impl::generic
-
-
-
- template <typename I, typename J>
- inline
- mln_concrete(I)
- sauvola_threshold_image_gl(const I& input, unsigned window_size,
- double K,
- Image<J>& simple,
- Image<J>& squared)
- {
- return impl::generic::sauvola_threshold_image(input, window_size, K,
- simple, squared);
- }
-
-
- } // end of namespace scribo::binarization::impl
-
-
-
-
- // Dispatch
-
- namespace internal
- {
-
- template <unsigned n, typename I, typename J>
- inline
- mln_ch_value(I, value::int_u<n>)
- sauvola_threshold_image_dispatch(const value::int_u<n>&, const I& input,
- unsigned window_size,
- double K,
- J& simple,
- J& squared)
- {
- return impl::sauvola_threshold_image_gl(input, window_size, K,
- simple, squared);
- }
-
-
- template <typename I, typename J>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image_dispatch(const mln_value(I)&, const I& input,
- unsigned window_size,
- double K,
- J& simple,
- J& squared)
- {
- // No dispatch for this kind of value type.
- mlc_abort(I)::check();
-
- typedef mln_ch_value(I,bool) output_t;
- return output_t();
- }
-
-
- } // end of namespace scribo::binarization::internal
-
-
-
- template <typename I, typename J>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K,
- Image<J>& simple,
- Image<J>& squared)
- {
- trace::entering("scribo::binarization::sauvola_threshold_image");
-
- mln_precondition(mln_site_(I)::dim == 2);
- mln_precondition(exact(input).is_valid());
-
- typedef mln_value(I) value_t;
- mln_ch_value(I, value::int_u8)
- output = internal::sauvola_threshold_image_dispatch(value_t(),
- exact(input),
- window_size,
- K,
- exact(simple),
- exact(squared));
-
- trace::exiting("scribo::text::ppm2pbm");
- return output;
- }
-
-
- template <typename I>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K)
- {
- mln_ch_value(I, double)
- simple = init_integral_image(input, scribo::internal::identity_),
- squared = init_integral_image(input, scribo::internal::square_);
-
- return sauvola_threshold_image(input, window_size,
- K, simple, squared);
- }
-
-
- template <typename I>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size)
- {
- return sauvola_threshold_image(input, window_size,
- SCRIBO_DEFAULT_SAUVOLA_K);
- }
-
-
- template <typename I>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input)
- {
- return sauvola_threshold_image(input, 11);
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::binarization
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_IMAGE_HH
diff --git a/scribo/src/binarization/Makefile.am b/scribo/src/binarization/Makefile.am
index 315e621..567972a 100644
--- a/scribo/src/binarization/Makefile.am
+++ b/scribo/src/binarization/Makefile.am
@@ -46,6 +46,7 @@ if HAVE_MAGICKXX
sauvola_ms_debug
utilexec_PROGRAMS = \
+ niblack \
otsu \
sauvola \
sauvola_ms \
@@ -60,6 +61,13 @@ if HAVE_MAGICKXX
$(MAGICKXX_LDFLAGS)
+ niblack_SOURCES = niblack.cc
+ niblack_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(MAGICKXX_CPPFLAGS)
+ niblack_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
+
+
otsu_SOURCES = otsu.cc
otsu_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
@@ -80,7 +88,7 @@ if HAVE_MAGICKXX
sauvola_debug_SOURCES = sauvola_debug.cc
sauvola_debug_CPPFLAGS = $(AM_CPPFLAGS) \
- -DSCRIBO_SAUVOLA_DEBUG \
+ -DSCRIBO_LOCAL_THRESHOLD_DEBUG \
$(MAGICKXX_CPPFLAGS)
sauvola_debug_LDFLAGS = $(AM_LDFLAGS) \
$(MAGICKXX_LDFLAGS)
@@ -94,7 +102,7 @@ if HAVE_MAGICKXX
sauvola_ms_debug_SOURCES = sauvola_ms_debug.cc
sauvola_ms_debug_CPPFLAGS = $(AM_CPPFLAGS) \
- -DSCRIBO_SAUVOLA_DEBUG \
+ -DSCRIBO_LOCAL_THRESHOLD_DEBUG \
$(MAGICKXX_CPPFLAGS)
sauvola_ms_debug_LDFLAGS = $(AM_LDFLAGS) \
$(MAGICKXX_LDFLAGS)
diff --git a/scribo/src/binarization/niblack.cc b/scribo/src/binarization/niblack.cc
new file mode 100644
index 0000000..4b7ed91
--- /dev/null
+++ b/scribo/src/binarization/niblack.cc
@@ -0,0 +1,106 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/value/int_u8.hh>
+#include <mln/io/magick/load.hh>
+#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_luma.hh>
+
+#include <scribo/binarization/niblack.hh>
+#include <scribo/debug/option_parser.hh>
+#include <scribo/debug/logger.hh>
+
+static const scribo::debug::arg_data arg_desc[] =
+{
+ { "input.*", "An image." },
+ { "output.pbm", "A binary image." },
+ {0, 0}
+};
+
+
+// --enable/disable-<name>
+static const scribo::debug::toggle_data toggle_desc[] =
+{
+ // name, description, default value
+ {0, 0, false}
+};
+
+
+// --<name> <args>
+static const scribo::debug::opt_data opt_desc[] =
+{
+ // name, description, arguments, check args function, number of args, default arg
+ { "debug-prefix", "Enable debug image outputs. Prefix image name with that "
+ "given prefix.", "<prefix>", 0, 1, 0 },
+ { "k", "Niblack's formulae parameter", "<value>", 0, 1, "-0.2" },
+ { "verbose", "Enable verbose mode", 0, 0, 0, 0 },
+ { "win-size", "Window size", "<size>", 0, 1, "101" },
+ {0, 0, 0, 0, 0, 0}
+};
+
+
+
+int main(int argc, char *argv[])
+{
+ using namespace mln;
+
+ scribo::debug::option_parser options(arg_desc, toggle_desc, opt_desc);
+
+ if (!options.parse(argc, argv))
+ return 1;
+
+ // Enable debug output.
+ if (options.is_set("debug-prefix"))
+ {
+ scribo::debug::logger().set_filename_prefix(options.opt_value("debug-prefix").c_str());
+ scribo::debug::logger().set_level(scribo::debug::All);
+ }
+
+ Magick::InitializeMagick(*argv);
+
+ trace::entering("main");
+
+ bool verbose = options.is_set("verbose");
+ unsigned w = atoi(options.opt_value("win-size").c_str());
+ double k = atof(options.opt_value("k").c_str());
+
+ if (verbose)
+ std::cout << "Using w=" << w << " and k=" << k << std::endl;
+
+ image2d<value::rgb8> input;
+ io::magick::load(input, options.arg("input.*"));
+
+ // Convert to Gray level image.
+ image2d<value::int_u8>
+ input_1_gl = data::transform(input, mln::fun::v2v::rgb_to_luma<value::int_u8>());
+
+ image2d<bool> out = scribo::binarization::niblack(input_1_gl, w, k);
+
+ io::pbm::save(out, options.arg("output.pbm"));
+
+ trace::exiting("main");
+}
diff --git a/scribo/src/binarization/pgm_sauvola_threshold_image.cc b/scribo/src/binarization/pgm_sauvola_threshold_image.cc
index a38784a..69e2e15 100644
--- a/scribo/src/binarization/pgm_sauvola_threshold_image.cc
+++ b/scribo/src/binarization/pgm_sauvola_threshold_image.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -25,7 +26,7 @@
#include <mln/io/pgm/all.hh>
-#include <scribo/binarization/sauvola.hh>
+#include <scribo/binarization/sauvola_threshold.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
@@ -67,7 +68,7 @@ int main(int argc, char *argv[])
image2d<value::int_u8> input;
io::pgm::load(input, argv[1]);
- image2d<value::int_u8> out = scribo::binarization::sauvola_threshold_image(input, w, k);
+ image2d<value::int_u8> out = scribo::binarization::sauvola_threshold(input, w, k);
io::pgm::save(out, argv[2]);
diff --git a/scribo/tests/binarization/Makefile.am b/scribo/tests/binarization/Makefile.am
index b8ab2d9..a2962bb 100644
--- a/scribo/tests/binarization/Makefile.am
+++ b/scribo/tests/binarization/Makefile.am
@@ -21,6 +21,7 @@
include $(top_srcdir)/scribo/tests/tests.mk
EXTRA_DIST = \
+ niblack.res.pbm \
sauvola_ms.ref.pbm \
sauvola.ref.pbm \
otsu.ref.pbm
@@ -28,6 +29,7 @@ EXTRA_DIST = \
check_PROGRAMS = \
global_threshold \
local_threshold \
+ niblack \
otsu \
sauvola \
sauvola_ms
@@ -35,6 +37,7 @@ check_PROGRAMS = \
global_threshold_SOURCES = global_threshold.cc
local_threshold_SOURCES = local_threshold.cc
+niblack_SOURCES = niblack.cc
otsu_SOURCES = otsu.cc
sauvola_SOURCES = sauvola.cc
sauvola_ms_SOURCES = sauvola_ms.cc
diff --git a/scribo/tests/binarization/niblack.cc b/scribo/tests/binarization/niblack.cc
new file mode 100644
index 0000000..99a58e2
--- /dev/null
+++ b/scribo/tests/binarization/niblack.cc
@@ -0,0 +1,52 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#include <mln/core/image/image2d.hh>
+#include <mln/data/compare.hh>
+#include <mln/value/int_u8.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pbm/load.hh>
+#include <mln/io/pbm/save.hh>
+
+#include <scribo/binarization/niblack.hh>
+
+#include "tests/data.hh"
+
+int main()
+{
+ using namespace mln;
+
+ image2d<value::int_u8> input;
+ io::pgm::load(input, MILENA_IMG_DIR "/lena.pgm");
+
+ image2d<bool> bin = scribo::binarization::niblack(input, 101);
+
+ image2d<bool> ref;
+ io::pbm::load(ref, SCRIBO_TESTS_DIR "binarization/niblack.ref.pbm");
+
+ mln_assertion(bin == ref);
+}
diff --git a/scribo/tests/binarization/niblack.ref.pbm b/scribo/tests/binarization/niblack.ref.pbm
new file mode 100644
index 0000000000000000000000000000000000000000..83cf4fb746f4638a7834af48108d7b79fd58fd61
GIT binary patch
literal 32884
zcmcJY4|H7Bedq6+8Eb?Qn!&h5EJAOHb0C|hu^ea+YvVTr64=u;X4{@^Hf`5(5<;?v
z#0sRrEXMB&k%(?7a+d5a-2(ES{z=biw{?5E2|f8U&oMz{OOc!OBxXa=Ga{Ha290fk
zM%L)v{eFM<zBg|qmF(F)dqMBrKfllY{qFDndH=_^T)lBi?WS8lb?Y5_K6C3wYahP5
z_6wi5{nk(Iscn1baIN<7&wOU=Uu@mFmpSje{f>{``p#R&KJl47@BG*upx%4Szx?Iv
zYrlBwowx3}<0Buh?fKM4Yd7Bd*;{YlJNC(2KlPc~`}cf!FDl)8$KAEJz5f?)eD6Qs
z_;cIdRm0!L<we8LQVd%|N!ZQG*BdrslD}7~XyesiON>b%8o09m-~0;n<n$j*^*i<E
zC+I)h{(s>Y&1(LU)%w5veX*n|{_|6-R;Cm4nadva4$LNBF}~TSlxK@RaKSeM`p+dz
z@|w+moqWOad(q;D%<}X1@0fYvwd6~UWQDzB<zCtJ6$nApCQVzNm6+9Eak<9a`K$l=
zS$*~UlAFx*U2`kn$rK(}=cbI&N`+Q5E;S?~{N=x5GmTl^ZvNnpRk-oH?`;3>*1hJ%
zda8f%qyK&v`ND21s@1eaR<-}DjiUoKwMT8d{$t<y##{gDN!TBX+@JrCPn<L+QmP?I
zqpNmr$Di205*pL|`t^VGHl_4~5B&Vf)}+zS`1UVdK50y>Jj*9)AkTkA5_6$>_3V%S
zTW!n6YIyU{{Gl<8*LAAD<sCap-VNt=>PV~K_T|E~Ir;k7fBmTPyzu5L7U#Y?xudR>
zZxwy?Lo+Zh?Z1}lotAvtej7LUnjb!U>866Zu#`OT;&a>gKC}Y+1Cd+#_At7>sS2Sa
zo9g9hiLiyK%)(rw@_g{_0X<y$^5?I(<R7-a@Om}XzZh-1T4w8<V6l2h_NbAeEQtm4
z#>xM5XLWNyscRnmsihm|_BNuFZ!|X?G#E9-Ktv<eyIUeT|4aJ04aE;0QtB&Dmj+&)
zHkkj)j;)oi>Gy@;-T2k&fl%bF{y^djiCLNc*5rO&QhQ6+zqt1Tv#3+vyyO0AhzVdV
z#Y8wYCydo^`4tm>{gXHRa<6`y3QPS@247ft3cMxEmq#_ET(^O@X33J2_OV%Md`}mT
zc=w;DZrbw&z5CA^Q?-mgw`oTs<DvCG8VRTg;a;=A)ZE<6Pk-K1eM(&tec|}UN0SG%
zPW7ML{kwCR02@LIqSciKBV0dqrr#`|ykyGLy(m3?^Lw7&^Z0%gx)Jvm*Z*KT<71`1
zJ4f8{S4kYxe_``z9rmb#R`-qG^rb;W9skl7ehW>G&KJo@sgoA5<H!1F(S%RlT-9Jy
zU8(A@cj0d$>U!+V+bh%Hy^x&Fc<cX*m}$(b=0p9%KoII1>%-T-y^fgk|BpX6H;D;k
zQ^<bGB9<5LnR^@89UA`=lrea!@E<;2h9S=WMAoaO*iWZlY<W9=TxYf~zk260Lc@He
zCO>|d6<NXdJqryuUTR~bZ7zGF&>0NB(Y(l3Nc~EUj&%4HGY6z49F2CowcqMrG(UKv
zY#pjfCDdCY@9ekoZD~JrIIGxy2)m?o+5F>S@3>^ps#-~HLL!wEk+#$pBfCq#^YP-V
zpD2IJ@-V;l9`)yNfGb-TAQ3)V&HJ{t<saR<@pG2vwoteNTgO|8M6A)swrOX-@XIDK
z|Go778VYTw(Y2ZVEH>tI<XFr-f^Gj+n=tJio1V6;Y&H2V|Cw<}%A9kA<*$)cW98f@
zH>duS3MAnq?M{bW#SmPs<pW7ITIZhjMg^2jNw!`7HxVR->Ef@G)b<a2>uvQ8&M~Or
zMJH)@aVWEYm44qej9I+&ncp!t=6Ngx9sgOr3Bj1zHtGDgo2kXQ7cM=hH4F2h+x})C
zN6}UMUJmZF;cGi~UY<uK-p#k5NHZUMhMfO?{MgEG^ywN4yMh&T+tyaM<fds6^_iOc
zg}JXss+MQzfNuS59t0S=c-#NxeRqGqs>ErOC~)*3I7z!}Z?)Z@=Gy7{D=1u9Ha{Nm
zY@b`uZM*m+a7}i(w*7YgFPt&=s8Lv~9cfMJ=6!d_?c%3wD*pNzRp-)%Y1;{1yxD5I
zKegZLU$8P~lhy-c>h{3Su(XD5e%f|l%G>rgtjy9i%j#{VIV9o~UhRLB*&<6gXL4ra
z<S+T&X;u1lMr|Ki$&eYjunzA^XQsYcbIVO^rLgVpe>Z!xUbXf+{?*-Q)NUK6U#$D>
z5z9$nXFZm-Us6tFv31X}aVOYmz-s;O0O91U{=lYw{NYx%T1IID-kcZxJ-dZ(tUUj=
ziX3K;bY^zeKVHx<#I|C@X7OjmLc}nFpPAQN&7#Cz$3S+q{wU*pNQ(VVWbT=rKWJDQ
zTPwDf*BQ^YTHaCrID_fIrHsMJr9Bl&CN{2Kpc$`xDNIHinBHlKo!~0_(~fa`zWqrQ
zHg~7En`Wpa%aKTjZ*kUI-nT{5CffaDiDF}W_D%REc`LQkLcSTj_?47T6|HAKRwf(<
zI_(by`f*@tmyQ1@tw37`tjCL0aYz533A5N(s{7xZP5EeDK5Z5b1LSS{w+gfC;eSv=
zH~w|QRp18tD*YCq{leSo?D^;17wYQqEAMdw&{e(K{~caae~wRPtJU7^@A><$I{nUp
zR)0GBvu?!z%k1yHL6CRCt=ArTCR}h8*!J7wuU(-~5ZheXuR8k2g&6A9+N)jg*A90h
zcvbtO_4ut){il?Q`g;eGyIcjai2hT2Tl9-NJYR_C)qVA!uf><7`fUfS;+=X0&vop#
z=ij(GtpEExQL*7FaIQ|PlYQ#cZa$DvPklSDIrLQM2sc!^c$ZgD=w9c4oND?w`!Gx3
z``>ljk;i6JB5S`r`DC`Usn0`4cI@Zz*Q~@!l|KBf`>uM7DF)37*#3l~65OD~Sz(^v
zC1v1SM?c&1u{#@9mbVKmFH<#@VJ6OM<J5knhD?akNU3e=ea}C0TWYQ}mipuDBos0d
zDvr1Qm^9&QW*KGgIdA;jg{MRlHxwlwt>JxWW23A;u953U4gVFlJh|tqb10C296A5h
z8P6PqDCMnwAJPfkwW+WE$dNBu7+d7X{EKLW1ZE&a0m^*jSbmq`?Ih&C<=Wyl?-`Ng
zCPJ3jpDv>5@QFglTl?*Z*Q#E9Yw3#O&&;M3#NdfWDzI6OFKV74_{g*Rr4%{ix>uEY
zc%f+nd8<FP8CG1C$GiF6DE+fUuGub9_ZOY8J<}#1E0<->RU0PAcl<BwH}2`^s_Ln!
zJ`gsDIHIxGib%?rX}F(dFov=!%<X$pU6Qqb4ey3;sX{*0U-AOS52LyFmx>K08Kk)(
z{dcjXVTgpmfR>QA4*4aP#!4Skg)IZ6a$xNJ2sTn~F4(aKnMiOo5O5v!kzx4|G1je>
zdbU2W5s4Y**Z~}}$lf<_yoZ}_koF;9`2%K-gRS7HYOk(chW0xbphEV4ETb3^rV%d8
z_?D#KKoQFds%O*Y(N7PVcEB7fA9Cj=fJiHa^)Al)f043s!q<EIHXZ*P(*(p20SGC~
zQGnohU--;_9@iiEYCw6_!FZr=yE#E&1Zd&VO?mMrvOq?8{ktLB=Baz(E!RGI2OQ(v
zCwwT?KqB>)+{8pJK5|;vE04V^p7fr)>(N;G*?PzEg0jfnA`)qvg)Qy3{4`=o0q48L
z-+Aq>r`2^W9~lfR4%hGnWTC)^fYrJcF&UbLcMbe-Ol^-LAYm0RGMRoKBD_QCYT~6=
z>8Vf8#okP0X>qFcpIrdf^0q~+>5YSMU+w-Eue#s!v*nIvhGKsJ5ff7x{DmlXS^Imh
zVcDp9i@IUklb35XRHm?mNcs<3pUD^$g5#Mb?JrETtcH^QJ*Q&TJII=Ch*SNN6+r|c
zr{9kM-4KqHx2Z7jH)F3Tb#-82Y|&yQw7ZRhJp-GE9jg?+*GDWGK-L|-XNIv0k+uQl
zL5D{X1Dl6k#*1^GW=V3-vo&j97auwO6hR>9cGmwPGW0-Qc`fsNy^F_)_r?FznGS#C
zkmt^}zaKGu9<n}S{y1{Fki{Tk+P2vWON&xo^!ElL2!7U_e8g5vmO)buc=~)5-)a9|
zTzi66g&|Xc$3w`bLHGz|$gqvI<;d}oWvj$Zi37+`efK7pJS(DdLclsAdP}1W@swvi
za(wJ8@0*1By#dp{^MQ1&q7?b9mJi(&bMEcp=Zx8p#jmt&s`=EgDw9h?oazs{hHtli
zW0u;y+T9h*KQt=c+empiO+pc^jk&j7K|b>ze0ziq+0z$3GZ4vW3R7NA^E3*<N7x~V
zeb^(%w%?mG%i@S(^T=sU_h+Z;@EO#Q3alH}<1bn;zuB&1{e8^b{X3)dbSJc_PJ;?<
zHHgvfuJ#xI%ABD7%l~F!@e<A1HAfK%a+*vYDQp>h7GTeM*lo1!1fIy?Iod+|9_r&|
ztP3gc=Dd|g86uhgz#na?jaBGq?q_zA(o|sW$2Qd;vJ||Jow%)Vaae4r9;LptbmF+U
zpAt4CtWR5I*fE4G!M>xvU?w;=M;ptN&92c;LHGk@KB5|Xgb>j#-rKoYZsF{y_v^3u
z5gR&92^V<i*LKcg#~=mRXZj0%GKq$4xp3<F>+XlTocq9*L>Zxow9Mpg{pybmd3E8V
z!^`4+r&@LzY8(_1@9;j##eeGZ0~Px3^R4<hX=t90iVg4_6i&ZHQ<vB&eWfAqUC^93
zyvqH6isqaf^Hx85GPB?EedG(hK~#+4-NiWy$OijZ{O=>?=3f_Y?f1!hy>~rW*7R;j
zVcB4hM-~tY5OX};p6O5dX`FpljoOI|D;u&Q*i>^cGGuN{_c;f-h~pC<%ceJ?cT{1m
zT>i)@6`_`Az%%ww^4?UNy!x~r8MD@jxZSkW-j;R0;{(ah>-QR>f5VIF?!&&NIzuo~
zL6d_5AqM1J(KUVxb1RThH}xqK1tMt@-|n$hQ;}=4<wGe!McMep30DCBmxr%6_0aIi
zznj70gy?6FS@${pYxsiKXhVNN)r(E-*1jcCGRtjTlul&~N}Vga?DsHZFn+duvo9X!
zl{CUhZj8@OQ`PK{wY=+KRMfG5H}xy8Ffi^U-T8lDdFMVm{@3H79|NJ(^NCc_x<3iY
zx0G|A<(&rT_fcra&ulw5#XI*OV_tx4Yk7+?^0IgHuba2)@2|GdeuQc*Frw6s-qXV2
zp>v)u+l13^`OD&vhV*K5ROis+ZiUJbM4$*VX$ukak!kI}tttHZbyzx2(FJbY7;K9m
z)56p12wi;tKH+6;I>}PY2aMtfVE1nQ^_jPdzqsajv~-H4)7-d_r0%opw{Nq%^k1Wd
zud;Dc9#CkO8-&z-mJcMa+y0AdhK{JdwStjg%dwr7g}@lsVrRcA@6!KPExhXW?d-8t
zgpQxKNympa<#^kFxSd3U>cfGt6DK9Q_Yld(5@J3|ZT}%xD$=2`W2T!+Q^eEt5zzqo
zR)3GPUuPG-DblrH#c$1c)Vf^5=^JM6R2R{mAfI*yqJGBr!m3d`vBi#=xzNbP=_2;9
z1Vq^{w*3PDxd0cjZrMreq_BHEi%MH_ypIygm%yLE0#Gsg^XD#H1{Y;MNFA$r>bL%*
zS4VLBz&A4G7erh(cP-wQO-PX?#Nh1j@LT`_be}B0RtDSU<rHwXrpYxt-Ytnjb2KAu
z<hfRm<w#q7mt4c+0I*K?zuL@jE@ZaTnB{ouKeitWIJT*IkZ4fs)DdoN5I%4TS5=3{
zm2`0>yYP2X;Y(j~G3?%)H@X*hrGiXcCen1%&oX3$xFgxB^@shB)d6><!c1HaLkq_`
z8J17W*Vqq__}P6INHr+A7;)=D3<eY3hBZ7!LSSBWXCIJhP%b#?)(|Gh(@+U(c<2x3
z#yh-7Jv=4Nun75d`mz6fWOw`z{bu%3lb*ND3UiP$X?PPJ)h4L>``4thb_HL4APBP@
zIee7UWVe2rrOPJ4g=i{(8qY4}-S?CD!)4Q|*poMR67t!z6FK+E^8Y6K<9>s;19Cv)
z@sUiNR%zIrjc;eao4>R_^6!lUcj98bH#_W;OT$m%gCKkKAZxQZSq*~}#>xPd(r1!|
zILloBQGYX-eh@o4FyX9Emd|FR4S7e_@IG?$d^q<Qaxl+|N!!Q%x#zr`H$343<V$e2
zbn(fhvU){oN8;l^pjzb)-!6))0*8NXEg!EWSBm?m^q@J<JP~p|&O);+eCRTmU};YO
z^4|S>rIgojI!Lb4n*%3}U0e~-(B-_~^h>37TAaP674pU<&ILWZ=#_Yp3R7`(zAwDP
z4PUeJk;v(9K8)eBfGl1z;4&8HW1WL}qI_AtQvONs0TMa=?V~S-CdAOijeOJ45b(~V
z;#m85hTEC`w4Z!l|3{A6gCE~A{4&Z_`G*-Fui{Uw<>T#IP99I<NFZyCDo<v-R+7bW
zCINT(WGU_FUyj~=o^;<robnalNyB_wW!Yt{90$)**M2N(i}8@{?&-5f$EP&P)nMSn
zG4+ex)Bko9v$Vr6#Diry@0>n48}+CX1V%!~L#om>{gYu7`(6C2&kgR9Q^s(%5|!jx
zh8)aU1-dSf;h);S3_PzN6K(#7BfGikCFb#dmZGyxkY$MAEb)|WA%rx_1C%)bfj_x;
zDB!tE+XN72d2s>)5|E+|o#}t>5E22(a{Tgm$hp640<DTg+zu<J)}r}*UYO%wt-3^q
zUs%3Rx_=qB;&3kk0z*EkV}Ot^-7hX<&Qe-ghc~7mC$A@yQQS!6)zA)~q6knOO81G$
zl0`m1%=MovRGvADoCRjx%!dj4D8QgGdZha@e&uGzr}{&Poi7(W3v|@e_*2=bi<~tw
zCp-GDXe0tKsebUu78yRXF?#MGioGK!XK0roY6U~dfRj-!d`JHR&ON44yb$%NViS+z
zv+is5pm|o%;b!p`$EW%OvzYP<cR(=!RV5uP5&KcPU);nx<gr75NU9(4c91Y<0k2^7
z;5lNa`xJTf0h)w}gmxV%AJJ4l;;rd6%U;9lTRnIbq(%ZJDMGB9|3mHgRKE`ip8U4M
zm(cV+w4rxj2n?Ym`eOhc{l}T|QJB+zLatpZF-itiU7weBUo0mr5wa!1D$OfQ1&HMM
zdFlT77$pPheszA@eNl<4mPU4tkC5_nJbZmZj@_*oCB0r>sWORT2HnH<BR9t%t0Tq!
zN%bQ>DXRw;R@GbR?ekstC8~hOeb!H9*2nO7<b6aOuTe57*G^j1a3cjSNM|1||M9rd
zc7Mi8Z{+woN@nDgQFHQwA4t0oM+0q4tQee0=qnGY9AATrrpPaA@(3ftp^*T~!AH#N
z@W+_)QSR&?g^T96dYQPOWckCrBpV<Rh1UHYUi#06fa7@r-Vk{-lzi{Dl!xa>o%=<j
zNS&xUYaCz4%m}39kzR}*gsa9Si4FMBiTP>XQoWmhGUeOqr!9ZmWGbuFcISQ>am-$R
z_@Qq8Z!`|wIN4cgt6vkox_2t&buDo2&-moyH+S>@R>|7UX*QxZqpW&^pYc`Sxj$RJ
z%qiW)7xwFb_skZcXrC(eqOgbz8zQ(ZLJmTh=ADX=;%KmrDHxizfOL%2gNII4MurVB
z1SyUXrg`nRAl2cE2gswvCu1BqWc-ve*&LtZCb_SR_YNG&_?qgeqp+hZR^?QG$}gY$
zCM3#8x{fvE5f)<{cyJS06<BCP6VpC|cy9SItw)jU*ssjtK!i_HY(s=w0o}Z2erNeI
zriNsPFY&%>1OL5@?AnGH)0c%d@b0fhes1}Y4?A-9%lT>u@u(N~0KFK~H?T0a{AflK
z?<`*?iID8*FPfKl?hp!J^{_hZ%W#Zcd+Kf-=JM$`Hqow2=b6`oc8DaZ?G^rnlf!O3
ze&vxa{Xb<|Ildk$Z+<<#<CEpT>*D{5Y5VOtAn`Er>vu=RnGVm>S>z&gc=Ky6Y5V_t
z@Bk9~5W9{8=t7=XYx(Z^hx<mtCm8+EKb+S@7df6XF2KcI{x?1sz*{UoqWmxwlp(r?
zUwq2(wgfl8(Y8igjZ*)OBb-eLwh?Gzh+G7l%aY`2B<T*@e#EAbfKd_hUmEC49xD=R
zWaoLage3dl@`yFyJq)u5`TGa38s-A@Yh>s6#UJcPvP=I0f$0B`H^~>lcgCOZw8g^j
z9Q0h;?x0vhJhvp61KsTpF!L#E+kedv5BQz1mQNN~9rfGyHv%V&zDNFdA7@D?=v2SW
zI?yoYh4(sM{8yT@C5b2ff2@z5=>+f*#4(H{V5nXG)jE>YV*NjDOJ3;_KI->v+HE7{
zM-We!pHsb!v8^w4@w=>K+^>eKXhTo1ny=^hmfF;;FrD?^Tb+1})BYOH49Kr^s#vA}
zMXfeZjpq4uVCs_U9rdbmzSYI=)(}sZuVaY%+;rOSbQN&qi5%Zik7JVMU9Y@e!wW<2
z0iW5A;j$e1xBw~DyvS4i-NOfbMMGTlp<1eb2h$nPS7ejGn4Xd<>S8H-hKOti@Db&m
z{-qjE5RvZUxqSBZs~%P88z{~Z%L4cq;v$bsS#mE&x~u*0SJKymbDu(AwLG1%jHLRh
z58*WH>T&hi@e@ix(pOg3fgi2}NaJk8g;jj}AS*z~^jAYDhhgByR8L<`_&CKg{l3eo
z3!URR-S9Sh`yD)UEA`ceD5!mI8PfLqk}~Fx*5g~aLj9neIc^@kj)IuAPCiyw#zcIV
zKBP309sidaSo?}5K0d_k&GmaB2roN-VO6>^W<knJ0_m*(E`WSgPDT%tFKw>hgLEq!
zuSTnK69t()D{o^e*ZvaZW89xQyc6q3&t}E7=rjxnu}6Sp7yp$p%V+v8hfrK@UmqVp
zL2;7|-;+@5lZN|N@$+xgrGkv7BJg`gKZ{3z-d_kmOScOTS*ssX68_<9HQ~!h$@n=B
z5%4$EUoM=d)x4~pQ;V^kur2S@D!!4_yLkd}`KjXgNj!t__DH?qS@*GTyrI?2FVD&h
z$oz-t9OCxL<jckJ8SrYDe0$4@*e;mSW3j^983@Q`Seko(ok<zLa4vcrxy!S!mnSBQ
zUaWfAYygoZ#*gZ5-dt$nI<d@u^gmlroS0Ct9Vggn+ks1vEVrxJij*<u9u5y8mFMSB
z)Y3!S!8a`*iA2DB#KeB-7Gx~>(^A;cFEz(KLzmt+fe9$%OlLe}#TN9Z{PO8PwWZR%
zl<RAt+F0%1UO0-&2jQ75G4VCtuIccfJoE=O7K;C*|M`lRiTe*+b6-*IkXGAl4nUI7
zk4>uo`QirV<$21D4uRjIeBoUWqh9y}Jk#kx`P-XrWL};RsAtEWTkpGwOEruUt>Vdu
zl6gM)zB<G_%S->W#Z9$uesAGYRgP#UwZfC|kjCu{Yk#VLs)j;_Z2XgNsV44_WBLCe
z`548p;bKf)j3`xn-HD^f$eU(J3*XW2ofyZR60LfvCqglNh{wt5f_N4GuQdu8s6WR~
zc*2XHG>XCFiHN!YZ7H6sI&oJw@tplWEG`#thn<ZrH+Uk4;YtadJd;0zv<w$x&eRZ>
zkm~PcKgazg?*&djkz+a6J;!g!@n1e7Fg6{25E=)2VLvAwUWQC+D25Y?aH|JDZaIsz
z)6e;2L&~es!LX%9s@H>$F`D7xeS8*dd5%5dVI)JVPP&M{ls`YNpu@+iH(33bVTwTs
zFZ%FAC=#Cb`+}R-h^sRHn1TI<sDch3tp?!h_=E<Zf=b&XnB0o_LgkjFTE@p9kicKY
zYahBEy5y^KQnZ~{;t`%*Jb)?FYWm>494|MB<ccEY6^<VdcuoJT<wL%?5ch{>nEu-t
z3SZ9-KQWb*X?MzxVwm)nn-@JicZg+Z)U;`#Q2ghkY0zKK_y{5x@Yp!s1K%q7@kMiU
zPqJ*m;9{nYHCbL;vOJw0pkjm?Wx^a^7=`<L+M`!B&|+C8a4yvzE#pS6OgW7_@Lc2>
zV#pvLTc^K&G{ER>MpsRmM_4vzcrF!V(G~tLk>|DRvaFETNQ1On*~e&Vaa><DYg)(!
z-+~z4nG!zPj6C59<C;n%?F%Q?AvMZXVqX8;3?QkScOIJsEZUGrxO9<Emp>$VytR_t
zU$TgIuf4^C+fGW`VA~1siP~!0k3prpq%Qq}{1uHP_8lH)Upm75{VGNcaxqPgpxl@c
z)0unZ<#?_{j!*3euT|I_Tnu9r`o>HUqX`|}Ldg6ph;Sxi2TNri8V|i2SN8{tmY0e%
zelZgLQkOCR%ZlWAykVp3VT50SxEh6lF;X#Ru{>61kI{a|M^>bZPkPi%aoiKUJSv6h
zO8{-W&&ELgGG>^#86qL}*tzx>!gjwZgRi_COJUnbIl{^g%Ts^GYn6G$@gE3VZ8du$
z@+&izZ~3HQ|A@6Y&hzy(d~pS<<m`Op&n!fW-Q4sAH^~?#HbNx4bBfOFPVI*oEj7ES
zD@!uAG4un$jQQ+Zo})4CH)lVRu{SI4xdxhzi$llnKPVAvztztXE(<aCj`z99KYjpY
zf=&b<1&&X)<#?emreuWW{U6|T%6lGzZMqq1R;n}p&NVz&7%9fywL={A7^d!QY<cNl
zlI}}F*pKeE`eSe*%dofh<K7Lb3ed1UQ7DyWyg5Kg&dQ8u`$J}Sc)mK{!&P=TGIgj)
zI{eR5vWt(_@Sgvg)`P(S?%8Q{HNR{UiW_?k1_tVU$wk}_D%6wuKYpLuAN1nDN1nYQ
zlHABm4P<tBn7Nv-#C`RBA$S#G0QtuLMu*g~Alp12JGGtmD?h&WL^G^{uR~RUMNlYi
zW*o1jVkS_Rn4RM*N0;WKKnovt^OKI}xkMoG*mZlJpP8T0!t)t3MpMWCv#WUyzp`W^
z;`~>cIy$R{G@m-b_7EnD05`uUF%)I`5w`;=<A*Oc<;T@fL>@mF)y3QXw|tn^<x3>x
z^;o%G8QkQ9FY%*NE_YVcB-0;B85kv*%fNieOnEit$3y$xwKGPBhp#9&G6Rt?$>VnZ
zXgq*%Jg2`cO?f>Q#5>2{72=Yn?}p?61_xSeL;FKnSAmzjb8C1tW}+~9cQ^{eW|Ey)
z1X2yAdF{6Z0uwr(`olES`u}bd-K{?xj)A|x?39<aMF8us`z|@hv;S7{*DW4dR;Pro
zn87@sAjOd5=|9Qqj33_|IXm_YdS3ZugOl%8ssSy@rb=o*^{?iS9(nol=lPQpxb30J
zs7Qxaq{SE75JbO?qWw0~(O)q~Ub^XPJayR>G{DE1{<t_mT-qFGylqp5SLVpGPrZ8q
z{2k$g7@RR*Bb3lAiml`W#{*l<d(%<n(cxL}A2tKvBc%h&w<?+u%UcY$J6G|#Jbj-(
zFt+fZQdcHB&^h2k%QuViG5;#wPQQ-*{#HFy6aEVLUiiTAK5lB^Fe>(24Ek5``hf2Z
z)=!*#MyW=q(cq5#?l_v~U+;C(x1+zcOYMl_lQ^&hK07Dk<3<Vi>Y1??^~;Y97&vz|
zKhX@--6}fy6fRuK8ociCzC2UR^RUG(ADRBCC{Qggntw{wR9VBhD)T>H2lAmGBQw*_
zQHm@CWJ*tHwbN@Cqxl)~$ikq_?7!L%AxYkM_QMt*SqOQ4e>pNI!S4VM3$y;~RSihS
z!i(7}807)75RfT7q18}ffBETf9?zY3APX9zKqO47D#AIQb-BV0zf<im_lEPH_Q=E9
z*y5~;Dk6yb?hACp*Wve72JYe&BEL0?@!CviD{#)Xyf1kW3Tz=_(j<-R<Z5LgJgax$
zie315D*;#RpooU3-|`WYcpwqB-|+`Z)uEAl$T!bxz}oD!oy3zfQSucx77-6u^ZW6p
z%i%kXzD~uvL_^yC<VZqg!nYWcrwt(^;(w<f{Jt0O!C8}cJVbug%U<Db;-;)fLVv)h
zEG3NO`2%><<-;M)+B}}_VS)Nv5y&<$Kjqo#&=xS0G0lfd@fD^K1x550G<e6XgxgYQ
z$|tpS`D9Iw$E=HrrV$4PWT4MF_Dc<U9;KM!5;}aKaM#65$3q<27&9K<0_p@XHRunS
z!)td}f|$=J>@QUG<z~8>^6r-%ot!K`xB(e5y)J)%7xS~ztru7!hHw6*M=-Dm<CvF(
z;Opz?KcLV9Q?pC*okI*^d)6laHkP+<@_h%TE*~+UQH^uECPwhW(m8fb^rrk5VI3ia
zjK{e#jGn5rVphGDM<MLDKK;A(_{58&-t+xd%=Jh^c!~9A!Sc3EFRsHEUn|D--lD$}
zm%&h3Hy<<0y$DM0x{8tMGpfr;IaYneNxAHh!P0gjb{9i3<&Uq!SB5T#Y9+jE6@?gn
z1qjPgC#xgM@yEJ&JAVDganq}(c+}{WZzIwPd7h)&m7rGPqoE<(blap($WODidXO*g
z!DJO^<fx+cAKEXAJ_?a(_3zkO)VOasCOlphE2w8OmXSOkufvZF6(e<7JQ5y-aFh47
zJ`j>i12XdZbN2fb(ff85z_&*NE}Jp^_k6&Dr3SYv(xa)>@jCkP#V7dIU_kLm_)wxj
zGPJ9GT6*+N`0;o@RQj!og>YX_KN*nMN@Lnx)WxskzloUlWBsH&KMiBGhsxgXTOPwE
z4!GoGz4ipMScZU1pZkf3623Y5B9j_%^}YZxi5Bg5RT&?5wcn@M<T&_}Z{}kkmwUwP
zPi<wv1BgPIO#gJ$z<y*&K&j8jlxKN!I<V_IUVcOj!9qWYf1LNm3w~gh!j!+!C!QRW
z9aJLNUQg<4^|#B=@E+ecxNU0JO8&SCLNXw`n0RV`eJ$TAw@T^;zjBh&*4Ue6V4JHi
zMvjR=>y(ey^3C$s`oNdvQ0sW>qbrN#fn<ELj{oAy>wW47_+1dTjooPVPyAtr=hBF<
zj{eAR4yq%;1K|wrxW!P0hr5=K?<Jy<fj>r9^CA}cPYkMWH)etbTMqG$I^I48&GU!4
z+Am^y=kS2~?Z#2Rk@2_N_Mh9xEZ|xDX}_&Iw|?y0H{$(vL)>qNuX?LE4(}L)m+6!F
zU$4X8J2v8d?i+afP?SMJz16J|k)MtTuhafD`uB~E6vq$Xo@2u*<Fjejh0)-B%Z;eC
z|BtQH{=4ImqL+l@;4zXJYVI86J6cXh73Q?F=#_QsKMfvB?r(y(!v`y9DEj$hl^hWs
z7A2bzufu;j8pd@Nh=v<J(6`HqV=FxB$avc~IsboJ4Wqb$(UbB@?ag>-r2US+WgY$d
z)G$8(n@+wF$XtPJXOXefr^6rY;(cn-cvJ#@u8nieSYT|<&-6z~b@)fRc<D-gK-GHS
zu(sLmh7X8~{t5o@T0RQ#OSQr;cX&Gh#k?;4uqHQtd=Ur=qTl%TCoCY35U_|rBf%e~
zw5fO<{yJT!{oTB8<?Zz8@T2SSmvF%1M&T4r;IeSZ`h1k<?bj)KyNXI`zi;N2u)J1X
z4Sb?5fobpl)c!8s9sjQ-f2v{@+HDlOkUlIClQNzuzf-Y9^=9(?Ey3h=o#L4TEuZ=C
z&^r7M9KMzOuI^|DPt~mA^*a0@pV=kQzua8Q%Z%>$9|F#PRvfS?dO#hrycx^!ZkSje
z`4pA)#g~{2b&2X>5Bvd)*knHrgjp4#$gSdark`>FMf4b_N4SPBO|x_rpF%d@r-VMu
zN0A{7gm6#CfS+Y)3uU?ar_+uRSK0YDPb3@&rFl7ChM?tvu`<ybNDMh{C{D<$Y~dqe
zNcXJILso7jCv~S^x>cdi@T}(htSW4Q$Fb(!sr|SS!P1WXue%h)T(;#alj6VQJMT4N
zq~6WS5Yh#}`cFguVS*^(&MlOpf4WEbr-u$0KUP-|Mo3o)Is7rh9RBIAoWk8B%g4;J
z`tj@tA$+MnF?h@69nOBAS{Py!%KG<2k5+X`GB-lR@$IKX|CzE0XIctxU`g;P#UKqp
z7C-NmAh}wiVt=dT=_34x#C%%~IzALJZYT+H^CyBJl4d&n%{~tX25qz$=gNc5{y@aI
zi5;JMLJDkM;^eqb;T4CV?Vsfrf{!{r6ftgE!sGZkY$4{^?zf#34U(sJyh5r|{UOC9
zSXnQzL&4hboFWHh4aay9TEBp&*1FfVKc%tPY(GR3L=ad)n<8M0<M<`_56rV>VL4id
zk5e8H0vXO8{0ToXhDdxv%glymDPHS;Yd1v?W_*koZD3vZ#cGq+Jkr`4ptIvtf5;*m
z><~trS}hY{&uj`z#&~D%v`+R0#{8%`;M(6{kqZzMQ>oF8KaD;6lLAwb@Ma;vC08re
z?@-xMn)X|-hln8~;~$G~_&Tk_#9uV6R;ph>w}~BZdlI}v46-ROO@1EyF7R#YuR|VE
zSzx<uS0O@1452$HvaHns@1&YfZbQNTDh@R`f$rkjZs8-A0TD;CU&v#8gvF=46RoRY
z*iP7@YLIG3k=;<84D|>RGO_Gao=e*OM~}9ajp-jE&k*K#x@#RCUZ4;jdHbe1Iq~#$
z=u6-7-S%??+o{Hyfkbwn@hTas6r%wAl;!*Fp@r2mKwkJqz|j$ok3>J8=MO7WF8O%e
zHmk+{p>96T*-u^r0o&p6epICZ{;1_kmG1V#-=hBoU^(7C=i^|gVZr6iyZHsp{sSLC
zO%_r<?FbDS=y%Tv5g!9TF$sPpqWvXb2k4C~pr=GXmv2U}BX6Hm^6*s$f8QK#HY}xl
zn8AoZukc(!G9Ityi2q&&uSUIM#B<hGEaT7DT|Am7JnY~xgDvI}#y)2ie#{$}pPd!H
zreHrR>jcNM{Ta_!qbMPRx#^8Jao2YFYq9j79|av4F}KuHF?d$P8tw0zfY<5__+JW*
zd9(@pYj|DU@8UHv1RUSdORIStzs`C`T6c%W43Wo#SfxL5d{zCkb$M@o{77<LfC-fH
z*HB#+Qhr$er3ShY!P$QXM=$TRil5yX;MX6T8`ztx^~X;CsPg9Q>fhntPzB*<8a_@&
zsDE?~k9T>*7F&;aoKsx<|Aqo`T8+%`>pS6Vcv=~Xe7bQwZXclew#PD_wZZ;@8N9S*
zCYwFO@PD|<e|UjasyZZm3<AOF7e0=LK7uo>_GGK4hN8|J7}f&$4LC%PDIePy5(wRV
z<wf$vW(hu4VH`rP6XZA8WT_328I#U<jt1PooqQ2R?W>xlF{Dkr8*-iCc=IHbuE!VS
z$UBRo<f`VzF;&N>+CJnuL4Jb`$w)jNK?6c)$1nARS6c$`#U}p!lQ-ezFrZ0$DbLYV
zj87=90R_Tijf$Db1@Sx1FEhSyz6z{<%kRP4C(B`npU%OET7ID}%Yf+T5-qJEUyi+!
zH*G>Q5%-O9YR17T-e-De)Zw{A=6R*&$e-#*b?|>c`A*Qj#O*Mm1djQzKSVCaPbJ1R
z#1CE%%;NJyb<xj~T(JBpHOV}=%E6;K%f}ht43_M>shRx?X%&`V5dE_J^>3#AA<D`7
zF-{xLYlbUx@@{K+js1}?HI0_Bv&-kBY5U0sShlOzV*#A)=Cgx<<29!r_)*+r&g;Kh
zgTHwRh4LH1WfKL6uPl5OTM3q55MGu)*qgKebkwh^dnl<MfjM{x7zj2kTWn&Vv4um_
z4?a?FN25FKpKtc7UhuQVs|qjr&B|s{46)qGw7<BHm!%@MAgBLm41SEKz!OTdX3KxD
zYUzxZZ2Zh}tbRS?(f@^FJfN!b%W-c|KlqSj)Y0!VZS0L<Nbo*`(+_^I*t`UM84?NZ
zC8hkodzZRPFbp!Ekt7bd<JaxOl+qzm;0KEM9GHANG<<;J^uO<&g}szVNT1$@OyGc3
z*hZ;r{1#aWo=~?3=IGu){*@SW)1Q=aTSbE7Z(w2>9_sm5-F$qxs>V1X4^%M%P^}Ii
z*wm$W5kP3M<8TELaEIpippK6HSU+$Kd=YQK4h;Vucq5NeII=%Mc?8RwdqTv|>Vhgq
zRg4m`A5y9qU9YPr@a9)<t@t>WA2UwDs#aUDV`%XU5o5l`%`$*WROsSy1*J|;;{%|&
zs*o4Y-lA2R0D|NHS`r%k%@yz>Mg3mA7}c6{;9(2-i4c+>s;lyD>=Af%h|mbJ;aSwr
zlrBzrxSqoyy8JlG9^}G`MM~Bwyz~6tuOJh_@gd`!zn|_c=XrQ9@*WLC`BjsQZyr*f
zPl9|Xdu~>=Qn#FUQ;x@AQuQqlZEsASLX5nujB!*_cUlZT43mX7D6Rf9$Fm8e#m9Yf
zQsy@LQSARA8si+8422p0`^bLA`$mVybgYBljb|_`k?6PoN)sOT)(RF&+#>;|H2WK`
zDmee2QDrdo;h}N`KYd63Qe$}-Q+s<uDo6%otVkRKtSH~K*#0|%*TzcviP|83Eaj;1
z7)N6N@s55osCEmC4OEnM`7p*t6e7v@9+W=3d9Zv4Pw+Gnm<Pgthil0-78{{gZHU>&
z8^*xP_#y8dxqoD^eAwsvf2iI5%Od7<4GG^uhdC>3IK=7GKbq?2oADmb+6F4e%SS^b
zpr1E0FlcX)gir^wnmDcc;++`iY5Ot!iaHvpyiz>6+wn47TQ?#V2rf>yF)>l?jG<rb
zr~bE;wHmIR!ZTR%zMHO1CPGU^aJq|X3>H3d2Opp?<0s$n=H=MryXESf#=LM4_|z4M
z)zvcjDCN}#=$~nhPY544{tPssl@cOEy#}KciFx&n?+XH?#Y*safqS(04HTluv5x{<
zaxr7l=}JvACPQ4|QpWW^elJ+vkFTzZVf&8q*T{z^@>5BBj~NFL7Kkn6HQ$GIN9iTa
z;h<GdkX(Bb>xb|GdCVV5Nr)N8!h&8!L>Dm$J3Ow~!29^O$xz0DA{}GDGu*nGM|%tE
zd|2W5Wet48{p4rZ7u2E!dIKfhzuO-oAAFB0zmW0QLaMLl8Mbagd<h=^Bb)=S_*?u4
zG2_yMh~aH-Ts7lWqW~q~t9^Y>us^JCG5strop~N<*B2Dw^czuSc){7f55u>w54k85
zBI94v3PEt&m%<}+v*K?_IewTzgZP8eXBo%zqaORRi7GTCE-gcmEI&K&I#kLhBV^>~
za!|;4I{i#iMam0=hrLoHBE!PlvpmZW7HWMMcg}tsi6scL4nHQJ-{N~qlqF9<s&FBG
zd%Naa{eF71m)aC^5i<SA^kVrfDa#x3>cTJLCI&i?@gTi=;DJgxo}*R<Fe2n5`dj*M
zKMS^fUU|c?n(@F5f77lpX&+^E@jB0oW!t`plNwA90=``rFd7aqiQ7sD84q!+_hFpr
zmsVc?uu{jMi9le_3*eeVOxgt?<JoaqaTMX%WPqBbXL&~T!8=2d3hZ?WiXg<J34`?|
z>WY;b!caj`o-d9^y(8PES(k@TZv-*R5Q13P#UpRf@)#!p8YcSHMD&h<Yo(X)56jr$
zXFqgy6EM@SS*PgF^QDPssBiFI`Vtpk=m-f+s`EpMGfH1z`*D~a$v6#C{gtDU-#3UK
zKcQQ-b(u*XK~ilHTs#Y&cEqZZ#3|25`uO*gCnCRRcl%L9@foevXiS|&?g-8(c$)Nz
z<?*I3^e1BEWxo~s-@DB`M48U(>vxc;+S(Y!(111!zj6}M&<^iUHHT)dYH<E;jZ*iS
z$H}<P(2V=iZyI()8NUzt`m&>~{_>^fe<J=4l)7LCjn%JFgc9uh$nNoNSOELSkRM+*
z+3GJoEIhTiV7oSy6hQLW_!<(}JNs`zG`eJ_T|WPB&9@QH4w>ns4TO(aQla|;N?`Bw
zGe5d?GAUp19Df3p<1!83VNx}6JX^FMYa;8xKn+kt5%M?u{wu3_=^D%@hKO=pcJY#`
zykp+Q7blYQ?`xYS3W>OE*7EcSzv`lXSP?*sv1t25QaSS3kbvtiR`8dag%px`2mLY9
zpUL>l{<u;EzkC2qlTTrVFy?tA^ZbS_5$ccNA^IVwe-wN<ey*{Dxt;JlUQ9xNNk+^l
zkB`M;;H70^zqADWTshv)9~#S<Z{~y#I{YK#ISf|u!~Mm%VsmGR%JRJY$cEET&s}>M
z&PU+ak_e(-S~5K3Eljj_`mnFl`^J3gaf(^}B(DCT+Kq!hYIJ<)#@I;zIQXCvrP5-u
zdEw@6{<cu#U0uo?VgWukatrf7rMNKP_9rp^e2a3slDyK**Ug`cyFwESZ$h`Q_W3v%
zzTr<|{2(g}a%}T_NyB5_Lx}Oml|nlj4SAUf!k_WKg@g#ZP2<rz^aPRuU)Y=2;l_hF
zZhB_C>KiJ~#dlX`7P{PT=Du6X^Q<XB_W{I)szOu^iQdoq#o6ZFQ!g8xtvyt_awJCS
zG@~-&LdzF<2`HC|0SX|oal$XpHupcZCHL=ap~Rd%_M}edFZ$UFt-ECURGfY~bmRDC
z<=NK$YmO|&+1f?Ec`!z4z^LfQj^Z->0`h^)-+1Kfmx3=J4D5Xd$}^mK;t<4riBmr!
z9BvnL_@q2X@}?uL-<@giFCO3C3Psp$PW<gbl<t-k6gyt?9q&BvsT*2HXOjKJS4O(u
d96b^JvQo9JDbJxzbz8yn1X}Dz#{V7vzX5`IYFq#S
literal 0
HcmV?d00001
--
1.7.2.5
1
0
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch gimpplugin has been created
at 6c0b45ce7368a98b667f55af8c63c750931b822c (commit)
- Log -----------------------------------------------------------------
6c0b45c backup
069c248 backup basic plugin
bab624b New GIMP image wrapper.
ad921ba First attempts for gimp plugin
9177e80 Move Otsu's threshold computation in a separate routine.
2fb4b79 Add Niblack's binarization algorithm.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
* mln/border/duplicate.hh,
* mln/border/mirror.hh,
* mln/canvas/browsing/internal/graph_first_search.hh,
* mln/convert/impl/from_float_to_value.hh,
* mln/convert/to_qimage.hh,
* mln/core/image/complex_window_piter.hh,
* mln/extension/fill.hh,
* mln/fun/spe/binary.hh,
* mln/fun/spe/unary.hh,
* mln/fun/x2x/rotation.hh,
* mln/io/fld/max_components.hh,
* mln/labeling/flat_zones.hh,
* mln/labeling/value.hh,
* mln/morpho/reconstruction/by_dilation/union_find.hh,
* mln/opt/element.hh,
* mln/registration/get_rot.hh,
* mln/subsampling/antialiased.hh,
* mln/subsampling/gaussian_subsampling.hh,
* mln/topo/skeleton/is_simple_point.hh,
* mln/transform/influence_zone_geodesic.hh,
* mln/util/object_id.hh,
* mln/value/lut_vec.hh,
* mln/world/binary_2d/enlarge.hh: Avoid unused variable warnings.
* mln/accu/internal/couple.hh,
* mln/convert/from_to.hxx,
* mln/core/faces_psite.hh,
* mln/core/image/ch_piter.hh,
* mln/core/image/dmorph/extended.hh,
* mln/core/image/dmorph/extension_fun.hh,
* mln/core/image/dmorph/extension_ima.hh,
* mln/core/image/dmorph/extension_val.hh,
* mln/core/image/dmorph/hexa.hh,
* mln/core/image/dmorph/sub_image_if.hh,
* mln/core/image/dmorph/transformed_image.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/graph_elt_mixed_window.hh,
* mln/core/image/graph_elt_window.hh,
* mln/core/image/graph_elt_window_if.hh,
* mln/core/image/graph_window_piter.hh,
* mln/core/image/image2d.hh,
* mln/core/image/imorph/labeled_image.hh,
* mln/core/image/imorph/plain.hh,
* mln/core/image/imorph/safe.hh,
* mln/core/image/vmorph/cast_image.hh,
* mln/core/image/vmorph/fun_image.hh,
* mln/core/image/vmorph/thru_image.hh,
* mln/core/image/vmorph/thrubin_image.hh,
* mln/core/image/vmorph/violent_cast_image.hh,
* mln/core/internal/is_masked_impl_selector.hh,
* mln/core/internal/pixel_impl.hh,
* mln/core/routine/init.hxx,
* mln/core/site_set/attic/p_faces_piter.hh,
* mln/core/site_set/p_faces.hh,
* mln/core/site_set/p_if.hh,
* mln/core/site_set/p_transformed.hh,
* mln/debug/println.spe.hh,
* mln/io/pbm/save.hh,
* mln/io/pgm/save.hh,
* mln/morpho/attribute/height.hh,
* mln/morpho/attribute/sharpness.hh,
* mln/morpho/attribute/volume.hh,
* mln/morpho/tree/data.hh,
* mln/topo/center_only_iter.hh,
* mln/topo/face.hh,
* mln/topo/face_data.hh,
* mln/trait/image_from_grid.hh,
* mln/trait/images.hh,
* mln/value/float01.hh,
* mln/value/float01_f.hh,
* mln/value/graylevel.hh,
* mln/value/graylevel_f.hh,
* mln/value/internal/gray_.hh,
* mln/value/internal/gray_f.hh: Make forward declarations
consistent with declarations.
* mln/core/concept/box.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/image/graph_window_if_piter.hh: Add explicit 'this'.
* mln/data/fill.hh: Make sure declarations are made before use.
* mln/geom/chamfer.hh,
* mln/morpho/tree/compute_attribute_image.hh: Do not set default
argument values in declaration.
* mln/accu/line.hh: Use def::coord.
* mln/algebra/vec.hh,
* mln/convert/from_to.hxx,
* mln/core/image/dmorph/sub_image.hh,
* mln/core/internal/site_set_iterator_base.hh,
* mln/core/site_set/box.hh,
* mln/core/site_set/p_array.hh,
* mln/core/site_set/p_edges.hh,
* mln/core/site_set/p_vertices.hh: Make forward declaration
consistent with declaration.
* mln/value/builtin/carrays.hh: Explicitly convert to char *.
* mln/convert/impl/from_double_to_value.hh,
* mln/convert/impl/from_int_to_value.hh,
* mln/core/point.hh,
* mln/opt/element.hh: Avoid unused variable warning.
* mln/convert/impl/from_image_to_site_set.hh: Remove useless local variable.
---
milena/ChangeLog | 111 ++++++++++++++++++++
milena/mln/accu/internal/couple.hh | 7 +-
milena/mln/accu/line.hh | 17 ++--
milena/mln/algebra/vec.hh | 5 +-
milena/mln/border/duplicate.hh | 4 +-
milena/mln/border/mirror.hh | 3 +-
milena/mln/convert/from_to.hxx | 4 +-
milena/mln/convert/impl/from_double_to_value.hh | 9 +-
milena/mln/convert/impl/from_float_to_value.hh | 8 +-
milena/mln/convert/impl/from_image_to_site_set.hh | 4 +-
milena/mln/convert/impl/from_int_to_value.hh | 6 +-
milena/mln/convert/to_qimage.hh | 2 +
milena/mln/core/concept/box.hh | 3 +-
milena/mln/core/dpoints_pixter.hh | 25 +++--
milena/mln/core/faces_psite.hh | 5 +-
milena/mln/core/image/ch_piter.hh | 5 +-
milena/mln/core/image/complex_window_piter.hh | 5 +-
milena/mln/core/image/dmorph/extended.hh | 5 +-
milena/mln/core/image/dmorph/extension_fun.hh | 5 +-
milena/mln/core/image/dmorph/extension_ima.hh | 6 +-
milena/mln/core/image/dmorph/extension_val.hh | 5 +-
milena/mln/core/image/dmorph/hexa.hh | 5 +-
milena/mln/core/image/dmorph/sub_image.hh | 6 +-
milena/mln/core/image/dmorph/sub_image_if.hh | 7 +-
milena/mln/core/image/dmorph/transformed_image.hh | 7 +-
milena/mln/core/image/flat_image.hh | 5 +-
milena/mln/core/image/graph_elt_mixed_window.hh | 7 +-
milena/mln/core/image/graph_elt_window.hh | 4 +-
milena/mln/core/image/graph_elt_window_if.hh | 7 +-
milena/mln/core/image/graph_window_if_piter.hh | 4 +-
milena/mln/core/image/graph_window_piter.hh | 6 +-
milena/mln/core/image/image2d.hh | 2 +-
milena/mln/core/image/imorph/labeled_image.hh | 5 +-
milena/mln/core/image/imorph/plain.hh | 5 +-
milena/mln/core/image/imorph/safe.hh | 5 +-
milena/mln/core/image/vmorph/cast_image.hh | 5 +-
milena/mln/core/image/vmorph/fun_image.hh | 4 +-
milena/mln/core/image/vmorph/thru_image.hh | 8 +-
milena/mln/core/image/vmorph/thrubin_image.hh | 4 +-
milena/mln/core/image/vmorph/violent_cast_image.hh | 5 +-
.../mln/core/internal/is_masked_impl_selector.hh | 7 +-
milena/mln/core/internal/pixel_impl.hh | 2 +-
milena/mln/core/internal/site_set_iterator_base.hh | 6 +-
milena/mln/core/point.hh | 3 +-
milena/mln/core/routine/init.hxx | 7 +-
milena/mln/core/site_set/attic/p_faces_piter.hh | 4 +-
milena/mln/core/site_set/p_array.hh | 4 +-
milena/mln/core/site_set/p_edges.hh | 5 +-
milena/mln/core/site_set/p_faces.hh | 5 +-
milena/mln/core/site_set/p_if.hh | 6 +-
milena/mln/core/site_set/p_transformed.hh | 5 +-
milena/mln/core/site_set/p_vertices.hh | 4 +-
milena/mln/data/fill.hh | 4 +-
milena/mln/debug/println.spe.hh | 5 +-
milena/mln/extension/fill.hh | 2 +
milena/mln/fun/spe/binary.hh | 1 +
milena/mln/fun/spe/unary.hh | 4 +-
milena/mln/fun/x2x/rotation.hh | 7 +-
milena/mln/geom/chamfer.hh | 5 +-
milena/mln/io/fld/max_components.hh | 3 +-
milena/mln/io/pbm/save.hh | 7 +-
milena/mln/io/pgm/save.hh | 7 +-
milena/mln/labeling/flat_zones.hh | 10 +-
milena/mln/labeling/value.hh | 4 +-
milena/mln/morpho/attribute/height.hh | 5 +-
milena/mln/morpho/attribute/sharpness.hh | 5 +-
milena/mln/morpho/attribute/volume.hh | 5 +-
.../reconstruction/by_dilation/union_find.hh | 18 ++--
milena/mln/morpho/tree/compute_attribute_image.hh | 9 +-
milena/mln/morpho/tree/data.hh | 4 +-
milena/mln/opt/element.hh | 9 +-
milena/mln/registration/get_rot.hh | 9 ++-
milena/mln/subsampling/antialiased.hh | 10 ++
milena/mln/subsampling/gaussian_subsampling.hh | 5 +-
milena/mln/topo/center_only_iter.hh | 7 +-
milena/mln/topo/face.hh | 4 +-
milena/mln/topo/face_data.hh | 4 +-
milena/mln/topo/skeleton/is_simple_point.hh | 1 -
milena/mln/trait/image_from_grid.hh | 5 +-
milena/mln/trait/images.hh | 11 +-
milena/mln/transform/influence_zone_geodesic.hh | 7 +-
milena/mln/util/object_id.hh | 4 +-
milena/mln/value/float01.hh | 5 +-
milena/mln/value/float01_f.hh | 5 +-
milena/mln/value/graylevel.hh | 2 +-
milena/mln/value/graylevel_f.hh | 5 +-
milena/mln/value/internal/gray_.hh | 17 +++-
milena/mln/value/internal/gray_f.hh | 14 ++-
milena/mln/value/lut_vec.hh | 5 +-
milena/mln/world/binary_2d/enlarge.hh | 6 +-
90 files changed, 436 insertions(+), 207 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index e9d45f1..dcc6da5 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -132,6 +132,117 @@
* mln/io/dicom/load.hh: Fix invalid data while loading large
image.
+2011-04-28 Guillaume Lazzara <lazzara(a)fidji.lrde.epita.fr>
+
+ Fix warnings with Clang/g++ 4.6.x
+
+ * mln/border/duplicate.hh,
+ * mln/border/mirror.hh,
+ * mln/canvas/browsing/internal/graph_first_search.hh,
+ * mln/convert/impl/from_float_to_value.hh,
+ * mln/convert/to_qimage.hh,
+ * mln/core/image/complex_window_piter.hh,
+ * mln/extension/fill.hh,
+ * mln/fun/spe/binary.hh,
+ * mln/fun/spe/unary.hh,
+ * mln/fun/x2x/rotation.hh,
+ * mln/io/fld/max_components.hh,
+ * mln/labeling/flat_zones.hh,
+ * mln/labeling/value.hh,
+ * mln/morpho/reconstruction/by_dilation/union_find.hh,
+ * mln/opt/element.hh,
+ * mln/registration/get_rot.hh,
+ * mln/subsampling/antialiased.hh,
+ * mln/subsampling/gaussian_subsampling.hh,
+ * mln/topo/skeleton/is_simple_point.hh,
+ * mln/transform/influence_zone_geodesic.hh,
+ * mln/util/object_id.hh,
+ * mln/value/lut_vec.hh,
+ * mln/world/binary_2d/enlarge.hh: Avoid unused variable warnings.
+
+ * mln/accu/internal/couple.hh,
+ * mln/convert/from_to.hxx,
+ * mln/core/faces_psite.hh,
+ * mln/core/image/ch_piter.hh,
+ * mln/core/image/dmorph/extended.hh,
+ * mln/core/image/dmorph/extension_fun.hh,
+ * mln/core/image/dmorph/extension_ima.hh,
+ * mln/core/image/dmorph/extension_val.hh,
+ * mln/core/image/dmorph/hexa.hh,
+ * mln/core/image/dmorph/sub_image_if.hh,
+ * mln/core/image/dmorph/transformed_image.hh,
+ * mln/core/image/flat_image.hh,
+ * mln/core/image/graph_elt_mixed_window.hh,
+ * mln/core/image/graph_elt_window.hh,
+ * mln/core/image/graph_elt_window_if.hh,
+ * mln/core/image/graph_window_piter.hh,
+ * mln/core/image/image2d.hh,
+ * mln/core/image/imorph/labeled_image.hh,
+ * mln/core/image/imorph/plain.hh,
+ * mln/core/image/imorph/safe.hh,
+ * mln/core/image/vmorph/cast_image.hh,
+ * mln/core/image/vmorph/fun_image.hh,
+ * mln/core/image/vmorph/thru_image.hh,
+ * mln/core/image/vmorph/thrubin_image.hh,
+ * mln/core/image/vmorph/violent_cast_image.hh,
+ * mln/core/internal/is_masked_impl_selector.hh,
+ * mln/core/internal/pixel_impl.hh,
+ * mln/core/routine/init.hxx,
+ * mln/core/site_set/attic/p_faces_piter.hh,
+ * mln/core/site_set/p_faces.hh,
+ * mln/core/site_set/p_if.hh,
+ * mln/core/site_set/p_transformed.hh,
+ * mln/debug/println.spe.hh,
+ * mln/io/pbm/save.hh,
+ * mln/io/pgm/save.hh,
+ * mln/morpho/attribute/height.hh,
+ * mln/morpho/attribute/sharpness.hh,
+ * mln/morpho/attribute/volume.hh,
+ * mln/morpho/tree/data.hh,
+ * mln/topo/center_only_iter.hh,
+ * mln/topo/face.hh,
+ * mln/topo/face_data.hh,
+ * mln/trait/image_from_grid.hh,
+ * mln/trait/images.hh,
+ * mln/value/float01.hh,
+ * mln/value/float01_f.hh,
+ * mln/value/graylevel.hh,
+ * mln/value/graylevel_f.hh,
+ * mln/value/internal/gray_.hh,
+ * mln/value/internal/gray_f.hh: Make forward declarations
+ consistent with declarations.
+
+ * mln/core/concept/box.hh,
+ * mln/core/dpoints_pixter.hh,
+ * mln/core/image/graph_window_if_piter.hh: Add explicit 'this'.
+
+ * mln/data/fill.hh: Make sure declarations are made before use.
+
+ * mln/geom/chamfer.hh,
+ * mln/morpho/tree/compute_attribute_image.hh: Do not set default
+ argument values in declaration.
+
+ * mln/accu/line.hh: Use def::coord.
+
+ * mln/algebra/vec.hh,
+ * mln/convert/from_to.hxx,
+ * mln/core/image/dmorph/sub_image.hh,
+ * mln/core/internal/site_set_iterator_base.hh,
+ * mln/core/site_set/box.hh,
+ * mln/core/site_set/p_array.hh,
+ * mln/core/site_set/p_edges.hh,
+ * mln/core/site_set/p_vertices.hh: Make forward declaration
+ consistent with declaration.
+
+ * mln/value/builtin/carrays.hh: Explicitly convert to char *.
+
+ * mln/convert/impl/from_double_to_value.hh,
+ * mln/convert/impl/from_int_to_value.hh,
+ * mln/core/point.hh,
+ * mln/opt/element.hh: Avoid unused variable warning.
+
+ * mln/convert/impl/from_image_to_site_set.hh: Remove useless local variable.
+
2010-12-10 Roland Levillain <roland(a)lrde.epita.fr>
Ensure non implemented reconstructions on sets abort at run time.
diff --git a/milena/mln/accu/internal/couple.hh b/milena/mln/accu/internal/couple.hh
index 43550fd..55c6cc4 100644
--- a/milena/mln/accu/internal/couple.hh
+++ b/milena/mln/accu/internal/couple.hh
@@ -53,10 +53,11 @@ namespace mln
///
/// \todo Check that, when T is not provided, A1 and A2 have the same value.
template <typename A1, typename A2, typename R, typename E>
- struct couple
- : base<R,E>,
- mlc_equal(mln_argument(A1), mln_argument(A2))::check_t
+ class couple
+ : public base<R,E>,
+ public mlc_equal(mln_argument(A1), mln_argument(A2))::check_t
{
+ public:
typedef mln_argument(A1) argument;
/// Manipulators.
diff --git a/milena/mln/accu/line.hh b/milena/mln/accu/line.hh
index c6022ef..75be6b3 100644
--- a/milena/mln/accu/line.hh
+++ b/milena/mln/accu/line.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -63,8 +64,8 @@ namespace mln
typename I, typename O>
void
line(const Image<I>& input,
- const mln_site(I)& p_start, unsigned len,
- unsigned half_length,
+ const mln_site(I)& p_start, def::coord len,
+ def::coord half_length,
Image<O>& output);
@@ -98,7 +99,7 @@ namespace mln
mln_precondition(input.is_valid());
mln_precondition(output.is_valid());
}
-
+
} // end of namespace mln::accu::internal
@@ -107,7 +108,7 @@ namespace mln
namespace generic
{
-
+
template <typename Meta_Accu, unsigned Dir,
typename I, typename O>
void
@@ -212,8 +213,8 @@ namespace mln
typename I, typename O>
void
line_fastest(const Image<I>& input_,
- const mln_site(I)& p_start, unsigned len,
- unsigned half_length,
+ const mln_site(I)& p_start, def::coord len,
+ def::coord half_length,
Image<O>& output_)
{
typedef mln_site(I) P;
@@ -371,7 +372,7 @@ namespace mln
half_length,
output);
}
-
+
} // end of namespace mln::accu::internal
diff --git a/milena/mln/algebra/vec.hh b/milena/mln/algebra/vec.hh
index 22ebc02..dc526ec 100644
--- a/milena/mln/algebra/vec.hh
+++ b/milena/mln/algebra/vec.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -55,7 +56,7 @@ namespace mln
// Forward declarations.
namespace algebra {
template <unsigned n, typename T> class vec;
- template <unsigned d, typename C> class h_vec;
+ template <unsigned d, typename C> struct h_vec;
template <unsigned n, unsigned m, typename T> class mat;
}
diff --git a/milena/mln/border/duplicate.hh b/milena/mln/border/duplicate.hh
index 4d836cc..059dc77 100644
--- a/milena/mln/border/duplicate.hh
+++ b/milena/mln/border/duplicate.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -227,6 +228,7 @@ namespace mln
void duplicate_dispatch_on(trait::image::speed::any,
const Image<I>& ima)
{
+ (void) ima;
// No-op.
}
diff --git a/milena/mln/border/mirror.hh b/milena/mln/border/mirror.hh
index 793ef21..adeb057 100644
--- a/milena/mln/border/mirror.hh
+++ b/milena/mln/border/mirror.hh
@@ -199,7 +199,8 @@ namespace mln
{
trace::warning("border::mirror for 3D image is not implemented,"
" so image borders have not been mirrored!");
- mln::internal::fixme();
+ (void) ima;
+ // FIXME write it!
}
diff --git a/milena/mln/convert/from_to.hxx b/milena/mln/convert/from_to.hxx
index 7891e9a..e99c3f6 100644
--- a/milena/mln/convert/from_to.hxx
+++ b/milena/mln/convert/from_to.hxx
@@ -63,13 +63,13 @@ namespace mln
template <typename D> class neighb;
template <typename D> class window;
- template <typename D, typename W> class w_window;
+ template <typename D, typename W> struct w_window;
template <typename T> struct image1d;
namespace algebra {
template <unsigned n, typename T> class vec;
- template <unsigned d, typename C> class h_vec;
+ template <unsigned d, typename C> struct h_vec;
}
namespace fun {
diff --git a/milena/mln/convert/impl/from_double_to_value.hh b/milena/mln/convert/impl/from_double_to_value.hh
index 757fb55..fd2b32a 100644
--- a/milena/mln/convert/impl/from_double_to_value.hh
+++ b/milena/mln/convert/impl/from_double_to_value.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -86,9 +87,11 @@ namespace mln
template <typename V>
inline
void
- from_double_to_value(const double& /* from */,
- Value<V>& /* to */)
+ from_double_to_value(const double& from,
+ Value<V>& to)
{
+ (void) from;
+ (void) to;
mlc_abort(V)::check();
}
diff --git a/milena/mln/convert/impl/from_float_to_value.hh b/milena/mln/convert/impl/from_float_to_value.hh
index b50173b..aa880d8 100644
--- a/milena/mln/convert/impl/from_float_to_value.hh
+++ b/milena/mln/convert/impl/from_float_to_value.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -87,9 +87,11 @@ namespace mln
template <typename V>
inline
void
- from_float_to_value(const float& /* from */,
- Value<V>& /* to */)
+ from_float_to_value(const float& from,
+ Value<V>& to)
{
+ (void) from;
+ (void) to;
mlc_abort(V)::check();
}
diff --git a/milena/mln/convert/impl/from_image_to_site_set.hh b/milena/mln/convert/impl/from_image_to_site_set.hh
index 2bdbcff..65873b6 100644
--- a/milena/mln/convert/impl/from_image_to_site_set.hh
+++ b/milena/mln/convert/impl/from_image_to_site_set.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -107,7 +108,6 @@ namespace mln
const std::pair< mln_value(I), p_run<P> >&)
{
s.clear();
- mln_value(I) O = literal::zero;
mln_fwd_piter(I) p(input.domain());
p.start();
for (;;)
diff --git a/milena/mln/convert/impl/from_int_to_value.hh b/milena/mln/convert/impl/from_int_to_value.hh
index b17040b..c22dfb1 100644
--- a/milena/mln/convert/impl/from_int_to_value.hh
+++ b/milena/mln/convert/impl/from_int_to_value.hh
@@ -74,9 +74,11 @@ namespace mln
template <typename V>
inline
void
- from_int_to_value(const int& /* from */,
- Value<V>& /* to */)
+ from_int_to_value(const int& from,
+ Value<V>& to)
{
+ (void) from;
+ (void) to;
mlc_abort(V)::check();
}
diff --git a/milena/mln/convert/to_qimage.hh b/milena/mln/convert/to_qimage.hh
index cd00cdc..a7c8512 100755
--- a/milena/mln/convert/to_qimage.hh
+++ b/milena/mln/convert/to_qimage.hh
@@ -254,6 +254,8 @@ namespace mln
inline
QImage to_qimage_dispatch(const Image<I>& ima, V&)
{
+ (void) ima;
+
// Not supported yet!
mlc_abort(I)::check();
return QImage();
diff --git a/milena/mln/core/concept/box.hh b/milena/mln/core/concept/box.hh
index 849a8e4..26fe1b9 100644
--- a/milena/mln/core/concept/box.hh
+++ b/milena/mln/core/concept/box.hh
@@ -133,7 +133,8 @@ namespace mln
{
return
exact(this)->is_valid()
- ? 1 + exact(this)->pmax()[i] - exact(this)->pmin()[i]
+ ? static_cast<unsigned>(1 + exact(this)->pmax()[i]
+ - exact(this)->pmin()[i])
: 0u;
}
diff --git a/milena/mln/core/dpoints_pixter.hh b/milena/mln/core/dpoints_pixter.hh
index 8020fcc..eb19c2b 100644
--- a/milena/mln/core/dpoints_pixter.hh
+++ b/milena/mln/core/dpoints_pixter.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -27,7 +28,7 @@
# define MLN_CORE_DPOINTS_PIXTER_HH
/// \file
-///
+///
/// \brief Definition of forward and backward mln::dpoint-based
/// iterators for pixels iterations.
///
@@ -51,7 +52,7 @@ namespace mln
/// \brief A generic forward iterator on the pixels of a
/// dpoint-based window or neighborhood.
- ///
+ ///
/// Parameter \c I is the image type.
template <typename I>
class dpoints_fwd_pixter
@@ -62,7 +63,7 @@ namespace mln
public:
/// \brief Constructor (using an image).
- ///
+ ///
/// \param[in] image The image to iterate over.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -74,7 +75,7 @@ namespace mln
const Pref& p_ref);
/// \brief Constructor (using a generalized pixel).
- ///
+ ///
/// \param[in] pxl_ref Center (generalized) pixel to iterate around.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -134,7 +135,7 @@ namespace mln
/// \brief A generic backward iterator on the pixels of a
/// dpoint-based window or neighborhood.
- ///
+ ///
/// Parameter \c I is the image type.
template <typename I>
class dpoints_bkd_pixter
@@ -145,7 +146,7 @@ namespace mln
public:
/// \brief Constructor (using an image).
- ///
+ ///
/// \param[in] image The image to iterate over.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -157,7 +158,7 @@ namespace mln
const Pref& p_ref);
/// \brief Constructor (using a generalized pixel).
- ///
+ ///
/// \param[in] pxl_ref Center (generalized) pixel to iterate around.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -257,7 +258,7 @@ namespace mln
{
mln_invariant(value_ref_ != 0 || p_ref_ != 0);
if (p_ref_)
- return image_(*p_ref_);
+ return this->image_(*p_ref_);
else
return **value_ref_;
}
@@ -286,7 +287,7 @@ namespace mln
if (is_valid())
{
if (p_ref_)
- this->value_ptr_ = & image_(*p_ref_) + *i_;
+ this->value_ptr_ = & this->image_(*p_ref_) + *i_;
else
this->value_ptr_ = * value_ref_ + *i_;
}
@@ -368,7 +369,7 @@ namespace mln
{
mln_invariant(value_ref_ != 0 || p_ref_ != 0);
if (p_ref_)
- return image_(*p_ref_);
+ return this->image_(*p_ref_);
else
return **value_ref_;
}
@@ -397,7 +398,7 @@ namespace mln
if (is_valid())
{
if (p_ref_)
- this->value_ptr_ = & image_(*p_ref_) + *i_;
+ this->value_ptr_ = & this->image_(*p_ref_) + *i_;
else
this->value_ptr_ = * value_ref_ + *i_;
}
diff --git a/milena/mln/core/faces_psite.hh b/milena/mln/core/faces_psite.hh
index d8d7573..9f72533 100644
--- a/milena/mln/core/faces_psite.hh
+++ b/milena/mln/core/faces_psite.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@
namespace mln
{
// Forward declaration.
- template <unsigned N, unsigned D, typename P> class p_faces;
+ template <unsigned N, unsigned D, typename P> struct p_faces;
/// \brief Point site associated to a mln::p_faces.
diff --git a/milena/mln/core/image/ch_piter.hh b/milena/mln/core/image/ch_piter.hh
index cacb5c7..b7c53f8 100644
--- a/milena/mln/core/image/ch_piter.hh
+++ b/milena/mln/core/image/ch_piter.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +41,7 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename Fwd> struct ch_piter_image;
+ template <typename I, typename Fwd> class ch_piter_image;
namespace internal
diff --git a/milena/mln/core/image/complex_window_piter.hh b/milena/mln/core/image/complex_window_piter.hh
index 5f1daa5..ab6326c 100644
--- a/milena/mln/core/image/complex_window_piter.hh
+++ b/milena/mln/core/image/complex_window_piter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -364,9 +364,10 @@ namespace mln
template <typename Pref>
inline
void
- complex_window_bkd_piter<I, G, W>::center_at_(const Pref& /* c */)
+ complex_window_bkd_piter<I, G, W>::center_at_(const Pref& c)
{
// FIXME: Argument C is not used here... Is this normal?
+ (void) c;
iter_.center_at(this->center().face());
}
diff --git a/milena/mln/core/image/dmorph/extended.hh b/milena/mln/core/image/dmorph/extended.hh
index 588f95a..791ab1d 100644
--- a/milena/mln/core/image/dmorph/extended.hh
+++ b/milena/mln/core/image/dmorph/extended.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -43,7 +44,7 @@ namespace mln
// Forward declaration.
- template <typename I> class extended;
+ template <typename I> struct extended;
namespace internal
diff --git a/milena/mln/core/image/dmorph/extension_fun.hh b/milena/mln/core/image/dmorph/extension_fun.hh
index a8731c2..887fe02 100644
--- a/milena/mln/core/image/dmorph/extension_fun.hh
+++ b/milena/mln/core/image/dmorph/extension_fun.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename F> struct extension_fun;
+ template <typename I, typename F> class extension_fun;
namespace internal
diff --git a/milena/mln/core/image/dmorph/extension_ima.hh b/milena/mln/core/image/dmorph/extension_ima.hh
index a0bc9ca..63ea0ed 100644
--- a/milena/mln/core/image/dmorph/extension_ima.hh
+++ b/milena/mln/core/image/dmorph/extension_ima.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +40,7 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename J> struct extension_ima;
+ template <typename I, typename J> class extension_ima;
namespace internal
diff --git a/milena/mln/core/image/dmorph/extension_val.hh b/milena/mln/core/image/dmorph/extension_val.hh
index c104eba..c0ccbe0 100644
--- a/milena/mln/core/image/dmorph/extension_val.hh
+++ b/milena/mln/core/image/dmorph/extension_val.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> struct extension_val;
+ template <typename I> class extension_val;
namespace internal
diff --git a/milena/mln/core/image/dmorph/hexa.hh b/milena/mln/core/image/dmorph/hexa.hh
index bfa3739..314cba1 100644
--- a/milena/mln/core/image/dmorph/hexa.hh
+++ b/milena/mln/core/image/dmorph/hexa.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> class hexa;
+ template <typename I> struct hexa;
namespace internal
diff --git a/milena/mln/core/image/dmorph/sub_image.hh b/milena/mln/core/image/dmorph/sub_image.hh
index 7aef40c..088142d 100644
--- a/milena/mln/core/image/dmorph/sub_image.hh
+++ b/milena/mln/core/image/dmorph/sub_image.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +44,7 @@ namespace mln
// Forward declaration.
- template <typename I, typename S> class sub_image;
+ template <typename I, typename S> struct sub_image;
namespace internal
diff --git a/milena/mln/core/image/dmorph/sub_image_if.hh b/milena/mln/core/image/dmorph/sub_image_if.hh
index 547366a..2cc9661 100644
--- a/milena/mln/core/image/dmorph/sub_image_if.hh
+++ b/milena/mln/core/image/dmorph/sub_image_if.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -46,7 +47,7 @@ namespace mln
// Forward declaration.
- template <typename I, typename S> class sub_image_if;
+ template <typename I, typename S> struct sub_image_if;
namespace internal
@@ -168,7 +169,7 @@ namespace mln
{
typedef fun::p2b::has<I> F;
F f(ima);
- s_ = p_if<S,F>(s, f);
+ s_ = p_if<S,F>(s, f);
}
} // end of namespace mln::internal
diff --git a/milena/mln/core/image/dmorph/transformed_image.hh b/milena/mln/core/image/dmorph/transformed_image.hh
index 5feb3b8..0fb4509 100644
--- a/milena/mln/core/image/dmorph/transformed_image.hh
+++ b/milena/mln/core/image/dmorph/transformed_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
// Forward declaration.
- template <typename I, typename F> class transformed_image;
+ template <typename I, typename F> struct transformed_image;
namespace internal
@@ -221,7 +222,7 @@ namespace mln
mln_precondition(this->delegatee_()->has(this->data_->f_(p)));
return this->delegatee_()->operator()(this->data_->f_(p));
}
-
+
template <typename I, typename F>
inline
mln_morpher_lvalue(I)
diff --git a/milena/mln/core/image/flat_image.hh b/milena/mln/core/image/flat_image.hh
index 10d6211..6647766 100644
--- a/milena/mln/core/image/flat_image.hh
+++ b/milena/mln/core/image/flat_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,7 @@ namespace mln
// Forward declaration.
- template <typename T, typename S> class flat_image;
+ template <typename T, typename S> struct flat_image;
namespace internal
diff --git a/milena/mln/core/image/graph_elt_mixed_window.hh b/milena/mln/core/image/graph_elt_mixed_window.hh
index 6ece878..046843a 100644
--- a/milena/mln/core/image/graph_elt_mixed_window.hh
+++ b/milena/mln/core/image/graph_elt_mixed_window.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -42,8 +43,8 @@ namespace mln
/// Forward declaration
template <typename G, typename S, typename S2> class graph_elt_mixed_window;
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
namespace util
{
template <typename G> class edge;
diff --git a/milena/mln/core/image/graph_elt_window.hh b/milena/mln/core/image/graph_elt_window.hh
index b39c44e..86cb147 100644
--- a/milena/mln/core/image/graph_elt_window.hh
+++ b/milena/mln/core/image/graph_elt_window.hh
@@ -42,8 +42,8 @@ namespace mln
/// Forward declaration
template <typename G, typename S> class graph_elt_window;
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
namespace util
{
template <typename G> class edge;
diff --git a/milena/mln/core/image/graph_elt_window_if.hh b/milena/mln/core/image/graph_elt_window_if.hh
index 131e4d2..920e524 100644
--- a/milena/mln/core/image/graph_elt_window_if.hh
+++ b/milena/mln/core/image/graph_elt_window_if.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -44,8 +45,8 @@ namespace mln
/// Forward declaration
template <typename G, typename S, typename I> class graph_elt_window_if;
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
namespace internal
diff --git a/milena/mln/core/image/graph_window_if_piter.hh b/milena/mln/core/image/graph_window_if_piter.hh
index d872853..068fbdb 100644
--- a/milena/mln/core/image/graph_window_if_piter.hh
+++ b/milena/mln/core/image/graph_window_if_piter.hh
@@ -167,7 +167,7 @@ namespace mln
graph_window_if_piter<S,W,I>::do_start_()
{
iter_.start();
- while (iter_.is_valid() && is_masked(this->c_->element(), iter_))
+ while (iter_.is_valid() && this->is_masked(this->c_->element(), iter_))
iter_.next();
}
@@ -177,7 +177,7 @@ namespace mln
graph_window_if_piter<S,W,I>::do_next_()
{
iter_.next();
- while (iter_.is_valid() && is_masked(this->c_->element(), iter_))
+ while (iter_.is_valid() && this->is_masked(this->c_->element(), iter_))
iter_.next();
}
diff --git a/milena/mln/core/image/graph_window_piter.hh b/milena/mln/core/image/graph_window_piter.hh
index 1891925..f6e8d08 100644
--- a/milena/mln/core/image/graph_window_piter.hh
+++ b/milena/mln/core/image/graph_window_piter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -209,8 +209,8 @@ namespace mln
using super_impl_::do_start_;
- friend class internal::impl_selector<typename W::center_t, mln_psite(W),
- graph_window_piter<S,W,I> > ;
+ friend struct internal::impl_selector<typename W::center_t, mln_psite(W),
+ graph_window_piter<S,W,I> > ;
private:
I iter_;
diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh
index cdb460a..bc49561 100644
--- a/milena/mln/core/image/image2d.hh
+++ b/milena/mln/core/image/image2d.hh
@@ -59,7 +59,7 @@ namespace mln
{
// Forward declaration.
- template <typename T> struct image2d;
+ template <typename T> class image2d;
namespace internal
diff --git a/milena/mln/core/image/imorph/labeled_image.hh b/milena/mln/core/image/imorph/labeled_image.hh
index c0fcde2..c99f386 100644
--- a/milena/mln/core/image/imorph/labeled_image.hh
+++ b/milena/mln/core/image/imorph/labeled_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -50,7 +51,7 @@ namespace mln
{
// Forward declarations.
- template <typename I> struct labeled_image;
+ template <typename I> class labeled_image;
namespace accu
{
template <typename T> struct nil;
diff --git a/milena/mln/core/image/imorph/plain.hh b/milena/mln/core/image/imorph/plain.hh
index e09bfa5..66c9ebd 100644
--- a/milena/mln/core/image/imorph/plain.hh
+++ b/milena/mln/core/image/imorph/plain.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +41,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> struct plain;
+ template <typename I> class plain;
namespace internal
diff --git a/milena/mln/core/image/imorph/safe.hh b/milena/mln/core/image/imorph/safe.hh
index c053645..c516ef4 100644
--- a/milena/mln/core/image/imorph/safe.hh
+++ b/milena/mln/core/image/imorph/safe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> struct safe_image;
+ template <typename I> class safe_image;
namespace internal
diff --git a/milena/mln/core/image/vmorph/cast_image.hh b/milena/mln/core/image/vmorph/cast_image.hh
index bed4fbf..0226ad0 100644
--- a/milena/mln/core/image/vmorph/cast_image.hh
+++ b/milena/mln/core/image/vmorph/cast_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
{
// Fwd decl.
- template <typename T, typename I> class cast_image_;
+ template <typename T, typename I> struct cast_image_;
namespace internal
diff --git a/milena/mln/core/image/vmorph/fun_image.hh b/milena/mln/core/image/vmorph/fun_image.hh
index 30ac44e..24d7e37 100644
--- a/milena/mln/core/image/vmorph/fun_image.hh
+++ b/milena/mln/core/image/vmorph/fun_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -46,7 +46,7 @@ namespace mln
{
// Forward declaration.
- template <typename F, typename I> class fun_image;
+ template <typename F, typename I> struct fun_image;
namespace internal
{
diff --git a/milena/mln/core/image/vmorph/thru_image.hh b/milena/mln/core/image/vmorph/thru_image.hh
index 2691d38..e829b27 100644
--- a/milena/mln/core/image/vmorph/thru_image.hh
+++ b/milena/mln/core/image/vmorph/thru_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -43,12 +43,12 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename F> struct thru_image;
+ template <typename I, typename F> class thru_image;
namespace internal
{
- template <typename I, typename F> struct thru_image_write;
- template <typename I, typename F> struct thru_image_read;
+ template <typename I, typename F> class thru_image_write;
+ template <typename I, typename F> class thru_image_read;
/// Find correct implementation
template <typename I, typename F>
diff --git a/milena/mln/core/image/vmorph/thrubin_image.hh b/milena/mln/core/image/vmorph/thrubin_image.hh
index 9d5a2f3..0195d1a 100644
--- a/milena/mln/core/image/vmorph/thrubin_image.hh
+++ b/milena/mln/core/image/vmorph/thrubin_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -42,7 +42,7 @@ namespace mln
{
// Forward declaration.
- template <typename I1, typename I2, typename F> struct thrubin_image;
+ template <typename I1, typename I2, typename F> class thrubin_image;
namespace internal
{
diff --git a/milena/mln/core/image/vmorph/violent_cast_image.hh b/milena/mln/core/image/vmorph/violent_cast_image.hh
index 8ff9a1e..0ce4669 100644
--- a/milena/mln/core/image/vmorph/violent_cast_image.hh
+++ b/milena/mln/core/image/vmorph/violent_cast_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +41,7 @@ namespace mln
{
// Fwd decl.
- template <typename T, typename I> class violent_cast_image;
+ template <typename T, typename I> struct violent_cast_image;
namespace internal
{
diff --git a/milena/mln/core/internal/is_masked_impl_selector.hh b/milena/mln/core/internal/is_masked_impl_selector.hh
index 56e4ed3..41d941b 100644
--- a/milena/mln/core/internal/is_masked_impl_selector.hh
+++ b/milena/mln/core/internal/is_masked_impl_selector.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -37,8 +38,8 @@ namespace mln
{
// Forward declarations.
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
diff --git a/milena/mln/core/internal/pixel_impl.hh b/milena/mln/core/internal/pixel_impl.hh
index 4e30f4c..d0549b1 100644
--- a/milena/mln/core/internal/pixel_impl.hh
+++ b/milena/mln/core/internal/pixel_impl.hh
@@ -47,7 +47,7 @@ namespace mln
{
// We indeed have to handle the couple of cases when I is fastest
- // or is not. Justification: mln::pixel derives from pixel_impl_
+ // or is not. Justification: mln::pixel derives from pixel_impl_
// and is a general purpose pixel class; it can be used on any
// image whatever it is a fastest one or not.
diff --git a/milena/mln/core/internal/site_set_iterator_base.hh b/milena/mln/core/internal/site_set_iterator_base.hh
index 66c94d5..71c3fe3 100644
--- a/milena/mln/core/internal/site_set_iterator_base.hh
+++ b/milena/mln/core/internal/site_set_iterator_base.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -114,8 +115,9 @@ namespace mln
template <typename S, typename E>
inline
void
- site_set_iterator_base<S, E>::change_target_(const S& /* s */)
+ site_set_iterator_base<S, E>::change_target_(const S& s)
{
+ (void) s;
// Empty by default.
}
diff --git a/milena/mln/core/point.hh b/milena/mln/core/point.hh
index a912fac..d415cf8 100644
--- a/milena/mln/core/point.hh
+++ b/milena/mln/core/point.hh
@@ -677,8 +677,9 @@ namespace mln
template <typename C>
inline
const util::yes&
- cut_(const point<grid::tick,C>& /* p */)
+ cut_(const point<grid::tick,C>& p)
{
+ (void) p;
util::yes* the_;
return *the_;
}
diff --git a/milena/mln/core/routine/init.hxx b/milena/mln/core/routine/init.hxx
index 3a47684..5cc6d12 100644
--- a/milena/mln/core/routine/init.hxx
+++ b/milena/mln/core/routine/init.hxx
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -36,9 +37,9 @@ namespace mln
// Forward declarations.
namespace fun { namespace i2v { template <typename T> class array; } }
- namespace pw { namespace internal { template <typename F, typename S, typename E> class image_base; } }
+ namespace pw { namespace internal { template <typename F, typename S, typename E> struct image_base; } }
namespace pw { template <typename F, typename S> class image; }
- template <typename I, typename F> class image_if;
+ template <typename I, typename F> struct image_if;
diff --git a/milena/mln/core/site_set/attic/p_faces_piter.hh b/milena/mln/core/site_set/attic/p_faces_piter.hh
index da4b24a..148872c 100644
--- a/milena/mln/core/site_set/attic/p_faces_piter.hh
+++ b/milena/mln/core/site_set/attic/p_faces_piter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +41,7 @@ namespace mln
{
// Forward declarations.
- template <unsigned N, unsigned D, typename P> class p_faces;
+ template <unsigned N, unsigned D, typename P> struct p_faces;
template <unsigned N, unsigned D> class faces_fwd_iter_;
template <unsigned N, unsigned D> class faces_bkd_iter_;
diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh
index 6a7a236..0ca810e 100644
--- a/milena/mln/core/site_set/p_array.hh
+++ b/milena/mln/core/site_set/p_array.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh
index 4c58696..b4f1d27 100644
--- a/milena/mln/core/site_set/p_edges.hh
+++ b/milena/mln/core/site_set/p_edges.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -45,7 +46,7 @@ namespace mln
{
// Forward declaration.
- template <typename G, typename F> struct p_edges;
+ template <typename G, typename F> class p_edges;
namespace trait
diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh
index a308a61..09fa2fc 100644
--- a/milena/mln/core/site_set/p_faces.hh
+++ b/milena/mln/core/site_set/p_faces.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -49,7 +50,7 @@ namespace mln
{
// Forward declarations.
- template <unsigned N, unsigned D, typename P> class p_faces;
+ template <unsigned N, unsigned D, typename P> struct p_faces;
template <unsigned N, unsigned D, typename P> class p_faces_fwd_piter_;
template <unsigned N, unsigned D, typename P> class p_faces_bkd_piter_;
diff --git a/milena/mln/core/site_set/p_if.hh b/milena/mln/core/site_set/p_if.hh
index 4381e86..06ae5c6 100644
--- a/milena/mln/core/site_set/p_if.hh
+++ b/milena/mln/core/site_set/p_if.hh
@@ -41,7 +41,7 @@ namespace mln
{
// Forward declarations.
- template <typename S, typename F> struct p_if;
+ template <typename S, typename F> class p_if;
template <typename Pi, typename S, typename F> struct p_if_piter_;
@@ -114,7 +114,7 @@ namespace mln
bool is_valid() const;
- /// Test if \p p belongs to the subset.
+ /// Test if \p p belongs to the subset.
bool has(const psite& p) const;
/// Give the primary overset.
@@ -184,7 +184,7 @@ namespace mln
{
return f_(p);
}
-
+
template <typename S, typename F>
inline
p_if<S,F>::p_if(const S& s, const F& f)
diff --git a/milena/mln/core/site_set/p_transformed.hh b/milena/mln/core/site_set/p_transformed.hh
index ff0638d..2b597a5 100644
--- a/milena/mln/core/site_set/p_transformed.hh
+++ b/milena/mln/core/site_set/p_transformed.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -39,7 +40,7 @@ namespace mln
{
// Forward declarations.
- template <typename S, typename F> struct p_transformed;
+ template <typename S, typename F> class p_transformed;
template <typename Pi, typename S, typename F> struct p_transformed_piter;
diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh
index c8497c0..6efa1a9 100644
--- a/milena/mln/core/site_set/p_vertices.hh
+++ b/milena/mln/core/site_set/p_vertices.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
@@ -44,7 +44,7 @@ namespace mln
{
// Forward declaration.
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_vertices;
namespace trait
diff --git a/milena/mln/data/fill.hh b/milena/mln/data/fill.hh
index 61e7055..b223a36 100644
--- a/milena/mln/data/fill.hh
+++ b/milena/mln/data/fill.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/debug/println.spe.hh b/milena/mln/debug/println.spe.hh
index 257ddf4..856c635 100644
--- a/milena/mln/debug/println.spe.hh
+++ b/milena/mln/debug/println.spe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -53,7 +54,7 @@
namespace mln
{
// Forward declaration.
- template <typename I> class hexa;
+ template <typename I> struct hexa;
namespace debug
{
diff --git a/milena/mln/extension/fill.hh b/milena/mln/extension/fill.hh
index caed937..4375a24 100644
--- a/milena/mln/extension/fill.hh
+++ b/milena/mln/extension/fill.hh
@@ -104,6 +104,8 @@ namespace mln
mln::trait::image::ext_domain::any,
I& ima, const mln_value(I)& val)
{
+ (void) ima;
+ (void) val;
// Oops...
}
diff --git a/milena/mln/fun/spe/binary.hh b/milena/mln/fun/spe/binary.hh
index eaeaa73..cde465d 100644
--- a/milena/mln/fun/spe/binary.hh
+++ b/milena/mln/fun/spe/binary.hh
@@ -71,6 +71,7 @@ namespace mln
template <typename U>
void init(const U& value)
{
+ (void) value;
}
};
diff --git a/milena/mln/fun/spe/unary.hh b/milena/mln/fun/spe/unary.hh
index 0c5a949..47d7f41 100644
--- a/milena/mln/fun/spe/unary.hh
+++ b/milena/mln/fun/spe/unary.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -175,6 +176,7 @@ namespace mln
template <typename U>
void init(const U& value)
{
+ (void) value;
};
};
diff --git a/milena/mln/fun/x2x/rotation.hh b/milena/mln/fun/x2x/rotation.hh
index 3cd54f1..ed48ebf 100644
--- a/milena/mln/fun/x2x/rotation.hh
+++ b/milena/mln/fun/x2x/rotation.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -66,6 +66,9 @@ namespace mln
algebra::h_mat<n, C>
get_rot_h_mat(const C alpha_, const algebra::vec<n,C>& axis_)
{
+ (void) alpha_;
+ (void) axis_;
+
std::cerr
<< __FILE__ << ":" << __LINE__ << ": error:"
<< " generic mln::fun::x2x::internal::get_rot_h_mat<n, C>"
diff --git a/milena/mln/geom/chamfer.hh b/milena/mln/geom/chamfer.hh
index 9603605..8fb6cc8 100644
--- a/milena/mln/geom/chamfer.hh
+++ b/milena/mln/geom/chamfer.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -111,7 +112,7 @@ namespace mln
template <typename I, typename W>
mln_ch_value(I, unsigned)
chamfer(const Image<I>& input_, const W& w_win_,
- unsigned max = mln_max(unsigned))
+ unsigned max)
{
trace::entering("mln::geom::chamfer");
// FIXME: check that input_ is binary.
diff --git a/milena/mln/io/fld/max_components.hh b/milena/mln/io/fld/max_components.hh
index d57310a..ceb4d27 100644
--- a/milena/mln/io/fld/max_components.hh
+++ b/milena/mln/io/fld/max_components.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -74,6 +74,7 @@ namespace mln
inline
unsigned max_component(const algebra::vec<n, V>& v)
{
+ (void) v;
return unsigned(mln_max(V));
}
diff --git a/milena/mln/io/pbm/save.hh b/milena/mln/io/pbm/save.hh
index 689b492..a9b7604 100644
--- a/milena/mln/io/pbm/save.hh
+++ b/milena/mln/io/pbm/save.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -46,8 +47,8 @@ namespace mln
// Fwd decl.
namespace value {
- template <unsigned> class int_u;
- template <unsigned> class int_u_sat;
+ template <unsigned> struct int_u;
+ template <unsigned> struct int_u_sat;
}
diff --git a/milena/mln/io/pgm/save.hh b/milena/mln/io/pgm/save.hh
index 6438b30..c5ba0af 100644
--- a/milena/mln/io/pgm/save.hh
+++ b/milena/mln/io/pgm/save.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -50,8 +51,8 @@ namespace mln
// Fwd decl.
namespace value {
- template <unsigned> class int_u;
- template <unsigned> class int_u_sat;
+ template <unsigned> struct int_u;
+ template <unsigned> struct int_u_sat;
}
diff --git a/milena/mln/labeling/flat_zones.hh b/milena/mln/labeling/flat_zones.hh
index 431bd86..6c406d5 100644
--- a/milena/mln/labeling/flat_zones.hh
+++ b/milena/mln/labeling/flat_zones.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -82,9 +82,9 @@ namespace mln
void do_no_union(const P&, const P&) {}
void init_attr(const P&) {}
void merge_attr(const P&, const P&) {}
- void set_new_label(const P& p, const L& l){}
- void set_label(const P& p, const L& l) {}
- void finalize() {}
+ void set_new_label(const P&, const L&){}
+ void set_label(const P&, const L&) {}
+ void finalize() {}
// Fastest implementation.
diff --git a/milena/mln/labeling/value.hh b/milena/mln/labeling/value.hh
index 7e1608c..fdd47ef 100644
--- a/milena/mln/labeling/value.hh
+++ b/milena/mln/labeling/value.hh
@@ -111,8 +111,8 @@ namespace mln
void do_no_union(const P&, const P&) {}
void init_attr(const P&) {}
void merge_attr(const P&, const P&) {}
- void set_new_label(const P& p, const L& l){}
- void set_label(const P& p, const L& l) {}
+ void set_new_label(const P&, const L&) {}
+ void set_label(const P&, const L&) {}
void finalize() {}
// Fastest implementation
diff --git a/milena/mln/morpho/attribute/height.hh b/milena/mln/morpho/attribute/height.hh
index 4e8f234..3d47ac0 100644
--- a/milena/mln/morpho/attribute/height.hh
+++ b/milena/mln/morpho/attribute/height.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@ namespace mln
// Forward declaration.
namespace morpho {
namespace attribute {
- template <typename I> class height;
+ template <typename I> struct height;
}
}
diff --git a/milena/mln/morpho/attribute/sharpness.hh b/milena/mln/morpho/attribute/sharpness.hh
index 9548b4d..866b1ab 100644
--- a/milena/mln/morpho/attribute/sharpness.hh
+++ b/milena/mln/morpho/attribute/sharpness.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@ namespace mln
namespace morpho {
namespace attribute {
template <typename I>
- class sharpness;
+ struct sharpness;
}
}
diff --git a/milena/mln/morpho/attribute/volume.hh b/milena/mln/morpho/attribute/volume.hh
index 94dc977..2ac66c6 100644
--- a/milena/mln/morpho/attribute/volume.hh
+++ b/milena/mln/morpho/attribute/volume.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
// Forward declaration.
namespace morpho {
namespace attribute {
- template <typename I> class volume;
+ template <typename I> struct volume;
}
}
diff --git a/milena/mln/morpho/reconstruction/by_dilation/union_find.hh b/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
index 59f15e4..35ec2ae 100644
--- a/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
+++ b/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
@@ -92,7 +92,7 @@ namespace mln
}
-
+
template <typename Par>
inline
mln_site(Par) find_root(Par& parent, mln_site(Par) x)
@@ -111,10 +111,10 @@ namespace mln
namespace impl
{
-
+
namespace generic
{
-
+
template <typename I, typename J, typename N>
inline
mln_concrete(I)
@@ -128,8 +128,8 @@ namespace mln
const N& nbh = exact(nbh_);
internal::union_find_tests(f, g, nbh);
-
-
+
+
typedef mln_site(I) P;
typedef mln_value(I) V;
@@ -184,7 +184,7 @@ namespace mln
deja_vu(p) = true;
}
}
-
+
// Second pass.
{
for (int i = s.nsites() - 1; i >= 0; --i)
@@ -207,7 +207,7 @@ namespace mln
return output;
}
-
+
} // end of namespace mln::morpho::reconstruction::by_dilation::impl::generic
} // end of namespace mln::morpho::reconstruction::by_dilation::impl
@@ -225,6 +225,10 @@ namespace mln
const Image<I>& f, const Image<J>& g,
const Neighborhood<N>& nbh)
{
+ (void) f;
+ (void) g;
+ (void) nbh;
+
// FIXME: Not yet implemented.
std::cerr
<< __FILE__ << ":" << __LINE__ << ": error:\n"
diff --git a/milena/mln/morpho/tree/compute_attribute_image.hh b/milena/mln/morpho/tree/compute_attribute_image.hh
index 9126bf1..e028084 100644
--- a/milena/mln/morpho/tree/compute_attribute_image.hh
+++ b/milena/mln/morpho/tree/compute_attribute_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -92,7 +93,7 @@ namespace mln
** \param[in] values Value image.
** \param[out] accu_image Optional argument used to store image.
**
- ** \return
+ ** \return
*/
template <typename A, typename T, typename V>
mln_ch_value(typename T::function, mln_result(A))
@@ -215,7 +216,7 @@ namespace mln
mln_ch_value(typename T::function, mln_result(A))
compute_attribute_image(const Accumulator<A>& a_,
const T& t,
- mln_ch_value(typename T::function, A)* accu_image = 0)
+ mln_ch_value(typename T::function, A)* accu_image)
{
trace::entering("morpho::tree::compute_attribute_image");
@@ -233,7 +234,7 @@ namespace mln
compute_attribute_image_from(const Accumulator<A>& a_,
const T& t,
const Image<V>& values,
- mln_ch_value(typename T::function, A)* accu_image = 0)
+ mln_ch_value(typename T::function, A)* accu_image)
{
trace::entering("morpho::tree::compute_attribute_image_from");
diff --git a/milena/mln/morpho/tree/data.hh b/milena/mln/morpho/tree/data.hh
index 1a0c404..3083759 100644
--- a/milena/mln/morpho/tree/data.hh
+++ b/milena/mln/morpho/tree/data.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -93,7 +93,7 @@ namespace mln
template <typename T> struct dn_leaf_piter;
/// Depth1st tree traversal iterator.
- template <typename T> struct depth1st_piter;
+ template <typename T> class depth1st_piter;
template <typename I, typename S>
diff --git a/milena/mln/opt/element.hh b/milena/mln/opt/element.hh
index 0aabf6b..dc1a415 100644
--- a/milena/mln/opt/element.hh
+++ b/milena/mln/opt/element.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -60,8 +61,9 @@ namespace mln
template <typename I>
inline
mln_rvalue(I) element_impl(trait::image::category::domain_morpher,
- const Image<I>& ima, unsigned /* index */)
+ const Image<I>& ima, unsigned index)
{
+ (void) index;
return element(*exact(ima).delegatee_());
}
@@ -82,8 +84,9 @@ namespace mln
template <typename I>
inline
mln_lvalue(I) element_impl(trait::image::category::domain_morpher,
- Image<I>& ima, unsigned /* index */)
+ Image<I>& ima, unsigned index)
{
+ (void) index;
return element(*exact(ima).delegatee_());
}
diff --git a/milena/mln/registration/get_rot.hh b/milena/mln/registration/get_rot.hh
index e1babf1..28667cb 100644
--- a/milena/mln/registration/get_rot.hh
+++ b/milena/mln/registration/get_rot.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -61,6 +62,12 @@ namespace mln
{
assert(0 && "TODO");
+ (void) c;
+ (void) mu_c;
+ (void) ck;
+ (void) map;
+ (void) mu_xk;
+
//////SLOW VERSION
//// V1
diff --git a/milena/mln/subsampling/antialiased.hh b/milena/mln/subsampling/antialiased.hh
index cb6bbca..66bdd33 100644
--- a/milena/mln/subsampling/antialiased.hh
+++ b/milena/mln/subsampling/antialiased.hh
@@ -118,6 +118,11 @@ namespace mln
const mln_domain(I)& output_domain,
unsigned border_thickness)
{
+ (void) input_;
+ (void) factor;
+ (void) output_domain;
+ (void) border_thickness;
+
// To be written...
mlc_abort(I)::check();
@@ -314,6 +319,11 @@ namespace mln
const mln_domain(I)& output_domain,
unsigned border_thickness)
{
+ (void) input;
+ (void) factor;
+ (void) output_domain;
+ (void) border_thickness;
+
// Not implemented yet.
mlc_abort(I)::check();
}
diff --git a/milena/mln/subsampling/gaussian_subsampling.hh b/milena/mln/subsampling/gaussian_subsampling.hh
index 4e8f24e..8855b9c 100644
--- a/milena/mln/subsampling/gaussian_subsampling.hh
+++ b/milena/mln/subsampling/gaussian_subsampling.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -66,6 +67,8 @@ namespace mln
trace::entering("subsampling::gaussian_subsampling");
mln_precondition(exact(input).is_valid());
+ (void) sigma;
+
mln_concrete(I) temp(exact(input).domain());
mln_concrete(I) output(geom::nrows(input) / gap,
geom::ncols(input) / gap); //FIXME : image2d only
diff --git a/milena/mln/topo/center_only_iter.hh b/milena/mln/topo/center_only_iter.hh
index ff072aa..9d52099 100644
--- a/milena/mln/topo/center_only_iter.hh
+++ b/milena/mln/topo/center_only_iter.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@ namespace mln
{
// Forward declaration.
- template <unsigned D> class face;
+ template <unsigned D> struct face;
/*----------------------------.
@@ -63,7 +64,7 @@ namespace mln
as well, since it always contains a single element, the
center/reference face (and the traversal order is
meaningless).
-
+
This iterator is essentially used to implement other iterators.
\see mln::topo::centered_iter_adapter
\see mln::complex_lower_window
diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh
index da95019..c9b58b0 100644
--- a/milena/mln/topo/face.hh
+++ b/milena/mln/topo/face.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -49,7 +49,7 @@ namespace mln
template <unsigned D> class complex;
template <unsigned N, unsigned D> class n_face;
template <unsigned N, unsigned D> class face_data;
- template <unsigned N> class algebraic_face;
+ template <unsigned N> struct algebraic_face;
/*-------.
diff --git a/milena/mln/topo/face_data.hh b/milena/mln/topo/face_data.hh
index de8028b..1622e51 100644
--- a/milena/mln/topo/face_data.hh
+++ b/milena/mln/topo/face_data.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -51,7 +51,7 @@ namespace mln
{
template <unsigned N, unsigned D> struct lower_dim_faces_set_mixin;
template <unsigned N, unsigned D> struct higher_dim_faces_set_mixin;
-
+
template <unsigned N, unsigned D>
struct lower_dim_adj_faces_if_dim_matches_;
template <unsigned N, unsigned D>
diff --git a/milena/mln/topo/skeleton/is_simple_point.hh b/milena/mln/topo/skeleton/is_simple_point.hh
index 9fa665c..d852c35 100644
--- a/milena/mln/topo/skeleton/is_simple_point.hh
+++ b/milena/mln/topo/skeleton/is_simple_point.hh
@@ -209,7 +209,6 @@ namespace mln
return internal::nb_connexity_c8[res];
default:
mln_assertion(0);
-
}
return 0;
}
diff --git a/milena/mln/trait/image_from_grid.hh b/milena/mln/trait/image_from_grid.hh
index eae5e4e..38fc538 100644
--- a/milena/mln/trait/image_from_grid.hh
+++ b/milena/mln/trait/image_from_grid.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -47,7 +48,7 @@ namespace mln
// Fwd decls.
template <typename T> struct image1d;
- template <typename T> struct image2d;
+ template <typename T> class image2d;
template <typename T> struct image3d;
diff --git a/milena/mln/trait/images.hh b/milena/mln/trait/images.hh
index 409d773..d8e80b0 100644
--- a/milena/mln/trait/images.hh
+++ b/milena/mln/trait/images.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -110,16 +111,16 @@ namespace mln
// Primitive types.
template <typename T> struct image1d;
- template <typename T> struct image2d;
+ template <typename T> class image2d;
template <typename T> struct image3d;
namespace pw { template <typename F, typename S> class image; }
// Morphers.
template <typename I, typename F> struct image_if_base;
- template <typename I, typename D> class decorated_image;
- template <typename I, typename S> class sub_image;
+ template <typename I, typename D> struct decorated_image;
+ template <typename I, typename S> struct sub_image;
template <typename I> class safe_image;
- template <typename T, typename I> class cast_image_;
+ template <typename T, typename I> struct cast_image_;
namespace value { template <unsigned n, typename I> struct stack_image; }
diff --git a/milena/mln/transform/influence_zone_geodesic.hh b/milena/mln/transform/influence_zone_geodesic.hh
index b9a763f..64d7702 100644
--- a/milena/mln/transform/influence_zone_geodesic.hh
+++ b/milena/mln/transform/influence_zone_geodesic.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -87,6 +87,9 @@ namespace mln
influence_zone_geodesic(const Image<I>& input,
const Neighborhood<N>& nbh)
{
+ (void) input;
+ (void) nbh;
+
// FIXME: To be written...
mlc_abort(I)::check();
}
diff --git a/milena/mln/util/object_id.hh b/milena/mln/util/object_id.hh
index 794abc4..525ff15 100644
--- a/milena/mln/util/object_id.hh
+++ b/milena/mln/util/object_id.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -136,6 +137,7 @@ namespace mln
inline
object_id<Tag,V>::object_id(const object_id<Tag2,V2>& id)
{
+ (void) id;
typedef object_id<Tag2,V2> id_t;
mlc_abort(id_t)::check();
}
diff --git a/milena/mln/value/float01.hh b/milena/mln/value/float01.hh
index 23f83df..898853f 100644
--- a/milena/mln/value/float01.hh
+++ b/milena/mln/value/float01.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -47,7 +48,7 @@ namespace mln
{
// Fwd decl.
- template <unsigned n> class float01_;
+ template <unsigned n> struct float01_;
class float01;
diff --git a/milena/mln/value/float01_f.hh b/milena/mln/value/float01_f.hh
index 2769200..3edb4ae 100644
--- a/milena/mln/value/float01_f.hh
+++ b/milena/mln/value/float01_f.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -43,7 +44,7 @@ namespace mln
// Fwd decls.
namespace value {
- struct float01;
+ class float01;
struct float01_f;
}
diff --git a/milena/mln/value/graylevel.hh b/milena/mln/value/graylevel.hh
index cca7e08..fc68391 100644
--- a/milena/mln/value/graylevel.hh
+++ b/milena/mln/value/graylevel.hh
@@ -63,7 +63,7 @@ namespace mln
namespace internal
{
template <unsigned n> class gray_;
- class gray_f;
+ struct gray_f;
template <unsigned n_src, unsigned n_dest>
long convert(int val);
}
diff --git a/milena/mln/value/graylevel_f.hh b/milena/mln/value/graylevel_f.hh
index e70927a..4194b25 100644
--- a/milena/mln/value/graylevel_f.hh
+++ b/milena/mln/value/graylevel_f.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -57,7 +58,7 @@ namespace mln
namespace value
{
/// \{ Forward declarations.
- namespace internal {class gray_f; }
+ namespace internal { struct gray_f; }
struct graylevel_f;
template <unsigned n> struct graylevel;
struct float01_f;
diff --git a/milena/mln/value/internal/gray_.hh b/milena/mln/value/internal/gray_.hh
index e672c37..c845c21 100644
--- a/milena/mln/value/internal/gray_.hh
+++ b/milena/mln/value/internal/gray_.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -57,8 +58,8 @@ namespace mln
/// \{ Forward declarations.
template <unsigned n>
struct graylevel;
- template <unsigned N> class graylevel;
- class graylevel_f;
+ template <unsigned N> struct graylevel;
+ struct graylevel_f;
namespace internal
{
template <unsigned n> class gray_;
@@ -488,6 +489,8 @@ namespace mln
void
operator+(const graylevel<n>& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -498,6 +501,8 @@ namespace mln
void
operator+(const I& i, const graylevel<n>& rhs)
{
+ (void) i;
+ (void) rhs;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -516,6 +521,8 @@ namespace mln
void
operator-(const graylevel<n>& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -526,6 +533,8 @@ namespace mln
void
operator-(const I& i, const graylevel<n>& rhs)
{
+ (void) i;
+ (void) rhs;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -592,7 +601,7 @@ namespace mln
/// \{ Forward declarations.
namespace internal
{
- class gray_f;
+ struct gray_f;
}
/// \}
diff --git a/milena/mln/value/internal/gray_f.hh b/milena/mln/value/internal/gray_f.hh
index 0408ae4..79a443c 100644
--- a/milena/mln/value/internal/gray_f.hh
+++ b/milena/mln/value/internal/gray_f.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -63,7 +63,7 @@ namespace mln
namespace internal
{
template <unsigned n> class gray_;
- class gray_f;
+ struct gray_f;
}
struct float01_f;
@@ -378,6 +378,8 @@ namespace mln
void
operator+(const graylevel_f& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
@@ -388,6 +390,8 @@ namespace mln
void
operator+(const I& i, const graylevel_f& rhs)
{
+ (void) i;
+ (void) rhs;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
@@ -398,6 +402,8 @@ namespace mln
void
operator-(const graylevel_f& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
@@ -408,6 +414,8 @@ namespace mln
void
operator-(const I& i, const graylevel_f& rhs)
{
+ (void) i;
+ (void) rhs;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh
index b86e541..a3eda5b 100644
--- a/milena/mln/value/lut_vec.hh
+++ b/milena/mln/value/lut_vec.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2007, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -136,8 +136,9 @@ namespace mln
template <typename S, typename T>
inline
unsigned
- lut_vec<S,T>::index_of(const T& /* v */) const
+ lut_vec<S,T>::index_of(const T& v) const
{
+ (void) v;
mln_invariant(0); // FIXME
return 0;
}
diff --git a/milena/mln/world/binary_2d/enlarge.hh b/milena/mln/world/binary_2d/enlarge.hh
index 1ffd512..da546e1 100644
--- a/milena/mln/world/binary_2d/enlarge.hh
+++ b/milena/mln/world/binary_2d/enlarge.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -328,6 +329,9 @@ namespace mln
mln_concrete(I)
enlarge_dispatch(const I& input, const mln_value(I)&, unsigned n)
{
+ (void) input;
+ (void) n;
+
mlc_abort(I)::check();
return mln_concrete(I)();
}
--
1.7.2.5
1
0
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch unstable/scribo has been updated
via 48ccb0ee1492695efa215095edfe715af8ab5d78 (commit)
via 83eb6772d566edfd0825912255955dfabbba50e0 (commit)
via db8e0805c02f6fa0a06df902501fad5298a9d3ea (commit)
via 027bd1b24532d2f6bba717dafdc201a6834ef376 (commit)
via b14a6dbe8c39dc12ef0aa238111f7fa19d91cbb0 (commit)
via b77d84adbfa931b4b6685b5069ad15b8cd447056 (commit)
via ec7416a0b0021f1b53482c04a5854cdb8c182832 (commit)
from b340c526ae583ce7be9ea28b63bf98f25aae1add (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
48ccb0e Fix test of Niblack's algorithm.
83eb677 Update use of the threshold function.
db8e080 Add two variants of the threshold function.
027bd1b Fix compilation issues with g++ 4.6.1 and clang++.
b14a6db Fix warnings with Clang/g++ 4.6.x
b77d84a mln/geom/crop_without_localization.hh: Fix preconditions.
ec7416a README: update requirements information.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 170 ++++++++++++++++++++
milena/apps/papers/levillain.09.ismm/graph.cc | 7 +-
.../examples/tuto4_genericity_and_algorithms.cc | 5 +-
milena/mln/accu/internal/couple.hh | 7 +-
milena/mln/accu/line.hh | 17 +-
milena/mln/algebra/vec.hh | 3 +-
milena/mln/binarization/threshold.hh | 7 +-
milena/mln/border/duplicate.hh | 4 +-
milena/mln/border/mirror.hh | 3 +-
milena/mln/canvas/browsing/backdiagonal2d.hh | 12 +-
milena/mln/canvas/browsing/breadth_first_search.hh | 13 ++-
milena/mln/canvas/browsing/depth_first_search.hh | 12 ++-
milena/mln/canvas/browsing/diagonal2d.hh | 8 +
.../canvas/browsing/dir_struct_elt_incr_update.hh | 11 ++-
milena/mln/canvas/browsing/directional.hh | 12 ++-
milena/mln/canvas/browsing/fwd.hh | 11 ++-
milena/mln/canvas/browsing/hyper_directional.hh | 11 ++-
.../canvas/browsing/internal/graph_first_search.hh | 1 +
milena/mln/canvas/browsing/snake_fwd.hh | 11 +-
milena/mln/canvas/browsing/snake_generic.hh | 11 +-
milena/mln/canvas/browsing/snake_vert.hh | 5 +-
milena/mln/convert/from_to.hxx | 2 +-
milena/mln/convert/impl/from_double_to_value.hh | 9 +-
milena/mln/convert/impl/from_float_to_value.hh | 8 +-
milena/mln/convert/impl/from_image_to_site_set.hh | 4 +-
milena/mln/convert/impl/from_int_to_value.hh | 6 +-
milena/mln/convert/to_qimage.hh | 2 +
milena/mln/core/concept/box.hh | 3 +-
milena/mln/core/dpoints_pixter.hh | 25 ++--
milena/mln/core/faces_psite.hh | 5 +-
milena/mln/core/image/ch_piter.hh | 5 +-
milena/mln/core/image/complex_window_piter.hh | 5 +-
milena/mln/core/image/dmorph/extended.hh | 5 +-
milena/mln/core/image/dmorph/extension_fun.hh | 5 +-
milena/mln/core/image/dmorph/extension_ima.hh | 6 +-
milena/mln/core/image/dmorph/extension_val.hh | 5 +-
milena/mln/core/image/dmorph/hexa.hh | 5 +-
milena/mln/core/image/dmorph/sub_image.hh | 4 +-
milena/mln/core/image/dmorph/sub_image_if.hh | 7 +-
milena/mln/core/image/dmorph/transformed_image.hh | 7 +-
milena/mln/core/image/flat_image.hh | 5 +-
milena/mln/core/image/graph_elt_mixed_window.hh | 7 +-
milena/mln/core/image/graph_elt_window.hh | 4 +-
milena/mln/core/image/graph_elt_window_if.hh | 7 +-
milena/mln/core/image/graph_window_if_piter.hh | 4 +-
milena/mln/core/image/graph_window_piter.hh | 6 +-
milena/mln/core/image/image2d.hh | 2 +-
milena/mln/core/image/imorph/labeled_image.hh | 5 +-
milena/mln/core/image/imorph/plain.hh | 5 +-
milena/mln/core/image/imorph/safe.hh | 5 +-
milena/mln/core/image/vmorph/cast_image.hh | 5 +-
milena/mln/core/image/vmorph/fun_image.hh | 4 +-
milena/mln/core/image/vmorph/thru_image.hh | 8 +-
milena/mln/core/image/vmorph/thrubin_image.hh | 4 +-
milena/mln/core/image/vmorph/violent_cast_image.hh | 5 +-
.../mln/core/internal/is_masked_impl_selector.hh | 7 +-
milena/mln/core/internal/pixel_impl.hh | 2 +-
milena/mln/core/internal/site_set_iterator_base.hh | 6 +-
milena/mln/core/point.hh | 3 +-
milena/mln/core/routine/init.hxx | 5 +-
milena/mln/core/site_set/attic/p_faces_piter.hh | 4 +-
milena/mln/core/site_set/p_array.hh | 4 +-
milena/mln/core/site_set/p_edges.hh | 5 +-
milena/mln/core/site_set/p_faces.hh | 5 +-
milena/mln/core/site_set/p_if.hh | 6 +-
milena/mln/core/site_set/p_transformed.hh | 5 +-
milena/mln/core/site_set/p_vertices.hh | 4 +-
milena/mln/data/fill.hh | 4 +-
milena/mln/data/was.median.hh | 8 +-
milena/mln/debug/println.spe.hh | 5 +-
milena/mln/extension/fill.hh | 2 +
milena/mln/fun/spe/binary.hh | 1 +
milena/mln/fun/spe/unary.hh | 4 +-
milena/mln/fun/v2b/all.hh | 6 +-
milena/mln/fun/v2b/essential.hh | 6 +-
.../mln/fun/v2b/{threshold.hh => threshold_ge.hh} | 16 +-
.../mln/fun/v2b/{threshold.hh => threshold_le.hh} | 16 +-
milena/mln/fun/v2v/hsl_to_rgb.hh | 11 +-
milena/mln/fun/x2x/rotation.hh | 7 +-
milena/mln/geom/chamfer.hh | 5 +-
milena/mln/geom/crop_without_localization.hh | 3 +-
milena/mln/io/fld/max_components.hh | 3 +-
milena/mln/io/pbm/save.hh | 7 +-
milena/mln/io/pgm/save.hh | 7 +-
milena/mln/labeling/flat_zones.hh | 10 +-
milena/mln/labeling/value.hh | 4 +-
milena/mln/literal/black.hh | 14 ++-
milena/mln/literal/colors.hh | 156 +++++++++++++++----
milena/mln/literal/white.hh | 12 ++-
milena/mln/morpho/attribute/height.hh | 5 +-
milena/mln/morpho/attribute/sharpness.hh | 5 +-
milena/mln/morpho/attribute/volume.hh | 5 +-
.../reconstruction/by_dilation/union_find.hh | 18 ++-
milena/mln/morpho/tree/compute_attribute_image.hh | 9 +-
milena/mln/morpho/tree/data.hh | 4 +-
milena/mln/opt/element.hh | 9 +-
milena/mln/registration/get_rot.hh | 9 +-
milena/mln/subsampling/antialiased.hh | 10 ++
milena/mln/subsampling/gaussian_subsampling.hh | 5 +-
milena/mln/topo/center_only_iter.hh | 5 +-
milena/mln/topo/face.hh | 2 +-
milena/mln/topo/face_data.hh | 4 +-
milena/mln/topo/skeleton/is_simple_point.hh | 1 -
milena/mln/trait/image_from_grid.hh | 5 +-
milena/mln/trait/images.hh | 9 +-
milena/mln/transform/influence_zone_geodesic.hh | 7 +-
milena/mln/util/object_id.hh | 4 +-
milena/mln/value/float01.hh | 5 +-
milena/mln/value/float01_f.hh | 5 +-
milena/mln/value/graylevel.hh | 2 +-
milena/mln/value/graylevel_f.hh | 5 +-
milena/mln/value/internal/gray_.hh | 17 ++-
milena/mln/value/internal/gray_f.hh | 14 ++-
milena/mln/value/lut_vec.hh | 5 +-
milena/mln/world/binary_2d/enlarge.hh | 12 +-
milena/tests/labeling/n_max.cc | 4 +-
milena/tests/unit_test/unit-tests.mk | 10 +-
scribo/ChangeLog | 20 +++
scribo/README | 6 +-
scribo/scribo/binarization/global_threshold.hh | 4 +-
scribo/scribo/binarization/sauvola_ms_split.hh | 5 +-
scribo/scribo/text/clean.hh | 7 +-
scribo/scribo/text/clean_inplace.hh | 6 +-
scribo/tests/binarization/niblack.ref.pbm | Bin 16498 -> 32884 bytes
124 files changed, 832 insertions(+), 309 deletions(-)
copy milena/mln/fun/v2b/{threshold.hh => threshold_ge.hh} (86%)
rename milena/mln/fun/v2b/{threshold.hh => threshold_le.hh} (85%)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0

22 Nov '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch llvm-support has been deleted
was 887dfe212525fea8f438c84b490ebd7ae1287119
-----------------------------------------------------------------------
887dfe212525fea8f438c84b490ebd7ae1287119 Fix more warnings with Clang 3.0
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0