https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Relax a couple of contraints related to labels and integers.
* mln/debug/colorize.hh: Relax the Symbolic constraint.
That allows for colorizing images containing integers.
* mln/value/int_u.hh (next): New.
That allows for images containing integers to be processed
as labeled images.
debug/colorize.hh | 4 ++--
value/int_u.hh | 15 +++++++++++++--
2 files changed, 15 insertions(+), 4 deletions(-)
Index: mln/debug/colorize.hh
--- mln/debug/colorize.hh (revision 3565)
+++ mln/debug/colorize.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
@@ -109,7 +109,7 @@
mln_precondition(exact(input).is_valid());
// FIXME: check that V is a color type.
// FIXME: we want to be sure that this is a label.
- mlc_is_a(mln_value(L), mln::value::Symbolic)::check();
+ // mlc_is_a(mln_value(L), mln::value::Symbolic)::check();
(void) value;
unsigned label_count = nlabels.next();
Index: mln/value/int_u.hh
--- mln/value/int_u.hh (revision 3565)
+++ mln/value/int_u.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -154,6 +154,9 @@
/// Assignment from an integer.
int_u<n>& operator=(int i);
+
+ /// Give the next value (i.e., i + 1).
+ int_u<n> next() const;
};
@@ -256,6 +259,14 @@
template <unsigned n>
inline
+ int_u<n>
+ int_u<n>::next() const
+ {
+ return this->v_ + 1;
+ }
+
+ template <unsigned n>
+ inline
std::ostream& operator<<(std::ostream& ostr, const int_u<n>&
i)
{
// FIXME: This code could be factored for almost every Value<*>...