* mln/core/internal/box_impl.hh: Add width, height and depth.
---
milena/ChangeLog | 22 ++++++++-----
milena/mln/core/internal/box_impl.hh | 57 +++++++++++++++++++++++++++++++++-
2 files changed, 70 insertions(+), 9 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f2af5eb..e5c034c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2010-02-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add more implementations for box specializations.
+
+ * mln/core/internal/box_impl.hh: Add width, height and depth.
+
+2010-02-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
First draft of raw format support.
* milena/mln/io/raw/all.hh,
@@ -11,26 +17,26 @@
Add new 3D neighborhoods and windows.
- * milena/mln/core/alias/neighb3d.hh,
- * milena/mln/win/sline3d.hh: New.
+ * mln/core/alias/neighb3d.hh,
+ * mln/win/sline3d.hh: New.
2010-02-16 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a new rgb32 type for Qt compatibility.
- * milena/mln/convert/from_to.hxx: Declare conversion routines.
+ * mln/convert/from_to.hxx: Declare conversion routines.
- * milena/mln/value/qt/rgb32.hh: New.
+ * mln/value/qt/rgb32.hh: New.
2010-02-16 Guillaume Lazzara <z(a)lrde.epita.fr>
Fix invalid value type names in dump format.
- * milena/mln/value/internal/make_generic_name.hh: New.
+ * mln/value/internal/make_generic_name.hh: New.
- * milena/mln/value/int_u.hh,
- * milena/mln/value/label.hh,
- * milena/mln/value/rgb.hh: Make use of the new routine to print a
+ * mln/value/int_u.hh,
+ * mln/value/label.hh,
+ * mln/value/rgb.hh: Make use of the new routine to print a
correct type names in dump format.
2009-11-18 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/milena/mln/core/internal/box_impl.hh b/milena/mln/core/internal/box_impl.hh
index 93fffff..a17e307 100644
--- a/milena/mln/core/internal/box_impl.hh
+++ b/milena/mln/core/internal/box_impl.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -38,6 +39,8 @@
namespace mln
{
+ // Forward declaration
+
namespace internal
{
@@ -79,6 +82,15 @@ namespace mln
/// Give the minimum col.
C max_col() const;
+
+ /// Give the width.
+ unsigned width() const;
+
+ /// Give the height.
+ unsigned height() const;
+
+ /// Give the depth.
+ unsigned depth() const;
};
template <typename C, typename E> // FIXME: Add an extra param to replace
'unsigned'.
@@ -101,6 +113,13 @@ namespace mln
/// Give the minimum col.
C max_col() const;
+
+ /// Give the width.
+ unsigned width() const;
+
+ /// Give the height.
+ unsigned height() const;
+
};
template <typename C, typename E> // FIXME: Add an extra param to replace
'unsigned'.
@@ -187,6 +206,28 @@ namespace mln
}
+ template <typename C, typename E>
+ inline
+ unsigned box_impl_<3, C, E>::width() const
+ {
+ return internal::force_exact<E>(*this).bbox().len(2);
+ }
+
+ template <typename C, typename E>
+ inline
+ unsigned box_impl_<3, C, E>::height() const
+ {
+ return internal::force_exact<E>(*this).bbox().len(1);
+ }
+
+ template <typename C, typename E>
+ inline
+ unsigned box_impl_<3, C, E>::depth() const
+ {
+ return internal::force_exact<E>(*this).bbox().len(0);
+ }
+
+
// 2
template <typename C, typename E>
@@ -231,6 +272,20 @@ namespace mln
return internal::force_exact<E>(*this).bbox().pmax()[1];
}
+ template <typename C, typename E>
+ inline
+ unsigned box_impl_<2, C, E>::width() const
+ {
+ return internal::force_exact<E>(*this).bbox().len(1);
+ }
+
+ template <typename C, typename E>
+ inline
+ unsigned box_impl_<2, C, E>::height() const
+ {
+ return internal::force_exact<E>(*this).bbox().len(0);
+ }
+
// 1
template <typename C, typename E>
--
1.5.6.5