Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- 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
- 9625 discussions
cleanup-2008 2232: Propagate the update of fastest image interface namings.
by Thierry Geraud 12 Sep '08
by Thierry Geraud 12 Sep '08
12 Sep '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Propagate the update of fastest image interface namings.
* tests/level/paste.cc: Re-activate 3D tests.
* mln/debug/println_with_border.spe.hh,
* mln/debug/println_with_border.hh,
* mln/core/image/fi_adaptor.hh,
* mln/core/image/image3d.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/internal/image_base.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/pixel.hh,
* mln/core/concept/doc/image_fastest.hh,
* mln/level/memset_.hh,
* mln/level/memcpy_.hh,
* mln/border/fill.hh,
* mln/border/duplicate.hh,
* mln/canvas/labeling.hh,
* sandbox/duhamel/paste.hh,
* sandbox/duhamel/fill.hh,
* sandbox/duhamel/border_duplicate.hh,
* sandbox/duhamel/border_fill.hh,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh:
Update fastest interface naming.
mln/border/duplicate.hh | 6 +--
mln/border/fill.hh | 8 ++--
mln/canvas/labeling.hh | 2 -
mln/core/concept/doc/image_fastest.hh | 12 +++---
mln/core/dpoints_pixter.hh | 4 +-
mln/core/image/fi_adaptor.hh | 18 ++++-----
mln/core/image/image3d.hh | 43 ++++++++++++++---------
mln/core/internal/check/image_fastest.hh | 4 +-
mln/core/internal/image_base.hh | 5 ++
mln/core/pixel.hh | 2 -
mln/debug/println_with_border.hh | 2 -
mln/debug/println_with_border.spe.hh | 2 -
mln/level/memcpy_.hh | 8 ++--
mln/level/memset_.hh | 6 +--
sandbox/duhamel/border_duplicate.hh | 6 +--
sandbox/duhamel/border_fill.hh | 8 ++--
sandbox/duhamel/fill.hh | 2 -
sandbox/duhamel/paste.hh | 2 -
sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 4 +-
sandbox/nivault/plugin-gimp/src/gimp-image.hh | 18 ++++-----
tests/level/paste.cc | 34 +++++++++---------
21 files changed, 107 insertions(+), 89 deletions(-)
Index: tests/level/paste.cc
--- tests/level/paste.cc (revision 2231)
+++ tests/level/paste.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image/image2d.hh>
-// #include <mln/core/image/image3d.hh>
+#include <mln/core/image/image3d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/level/fill.hh>
@@ -63,20 +63,20 @@
assert(ima == (ima2 | b));
}
-// // tests in three dimension
-// {
-// box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
-// image3d<int> ima(b, 2);
-// debug::iota(ima);
-
-// box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
-// image3d<int> ima2(b2, 2);
-// debug::iota(ima2);
-
-// level::paste(ima, ima2); // Fast version.
-// assert(ima == (ima2 | b));
-
-// level::impl::generic::paste(ima, ima2); // Not so fast version...
-// assert(ima == (ima2 | b));
-// }
+ // tests in three dimension
+ {
+ box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
+ image3d<int> ima(b, 2);
+ debug::iota(ima);
+
+ box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
+ image3d<int> ima2(b2, 2);
+ debug::iota(ima2);
+
+ level::paste(ima, ima2); // Fast version.
+ assert(ima == (ima2 | b));
+
+ level::impl::generic::paste(ima, ima2); // Not so fast version...
+ assert(ima == (ima2 | b));
+ }
}
Index: mln/debug/println_with_border.spe.hh
--- mln/debug/println_with_border.spe.hh (revision 2231)
+++ mln/debug/println_with_border.spe.hh (working copy)
@@ -61,7 +61,7 @@
println_with_border(const box2d& b, const I& input)
{
const std::size_t ncols = b.ncols() + 2 * input.border();
- for (size_t i = 0; i < input.ncells(); i++)
+ for (size_t i = 0; i < input.nelements(); i++)
{
std::cout << format(input.buffer()[i]) << ' ';
if (((i + 1) % ncols) == 0)
Index: mln/debug/println_with_border.hh
--- mln/debug/println_with_border.hh (revision 2231)
+++ mln/debug/println_with_border.hh (working copy)
@@ -65,7 +65,7 @@
void
println_with_border(const S&, const I& input)
{
- for (size_t i = 0; i < input.ncells(); i++)
+ for (size_t i = 0; i < input.nelements(); i++)
std::cout << format(input.buffer()[i]) << ' ';
std::cout << std::endl;
}
Index: mln/core/image/fi_adaptor.hh
--- mln/core/image/fi_adaptor.hh (revision 2231)
+++ mln/core/image/fi_adaptor.hh (working copy)
@@ -170,7 +170,7 @@
const box2d& domain() const;
/// Give the number of cells.
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point2d& p) const;
@@ -194,10 +194,10 @@
/// Fast Image method
/// Give the offset corresponding to the delta-point \p dp.
- int offset(const dpoint2d& dp) const;
+ int delta_index(const dpoint2d& dp) const;
/// Give the point corresponding to the offset \p o.
- point2d point_at_offset(unsigned o) const;
+ point2d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -307,7 +307,7 @@
template <typename I>
std::size_t
- fi_adaptor<I>::ncells() const
+ fi_adaptor<I>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
@@ -337,7 +337,7 @@
const mln_value(I)&
fi_adaptor<I>::operator[](unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(this->data_->buffer_ + o);
}
@@ -345,7 +345,7 @@
mln_value(I)&
fi_adaptor<I>::operator[](unsigned o)
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(this->data_->buffer_ + o);
}
@@ -387,7 +387,7 @@
template <typename I>
int
- fi_adaptor<I>::offset(const dpoint2d& dp) const
+ fi_adaptor<I>::delta_index(const dpoint2d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0] * this->data_->b_.len(1) + dp[1];
@@ -396,9 +396,9 @@
template <typename I>
point2d
- fi_adaptor<I>::point_at_offset(unsigned o) const
+ fi_adaptor<I>::point_at_index(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
point2d p = make::point2d(this->data_->b_.max_row() - o / this->data_->b_.len(1) - this->data_->b_.min_row(),
o % this->data_->b_.len(1) + this->data_->b_.min_col());
mln_postcondition(& this->operator()(p) == this->data_->buffer_ + o);
Index: mln/core/image/image3d.hh
--- mln/core/image/image3d.hh (revision 2231)
+++ mln/core/image/image3d.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 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
@@ -172,11 +173,14 @@
/// Give the definition domain.
const box3d& domain() const;
+ /// Give the bounding box domain.
+ const box3d& bbox() const;
+
/// Give the border thickness.
unsigned border() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point3d& p) const;
@@ -185,10 +189,10 @@
T& operator()(const point3d& p);
/// Read-only access to the image value located at offset \p o.
- const T& operator[](unsigned o) const;
+ const T& element(unsigned o) const;
/// Read-write access to the image value located at offset \p o.
- T& operator[](unsigned o);
+ T& element(unsigned o);
/// Read-only access to the image value located at (\p ind).
const T& at(int sli, int row, int col) const;
@@ -200,10 +204,10 @@
/// Fast Image method
/// Give the offset corresponding to the delta-point \p dp.
- int offset(const dpoint3d& dp) const;
+ int delta_index(const dpoint3d& dp) const;
/// Give the point corresponding to the offset \p o.
- point3d point_at_offset(unsigned o) const;
+ point3d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -400,6 +404,15 @@
template <typename T>
inline
+ const box3d&
+ image3d<T>::bbox() const
+ {
+ mln_precondition(this->has_data());
+ return data_->b_;
+ }
+
+ template <typename T>
+ inline
unsigned
image3d<T>::border() const
{
@@ -410,10 +423,10 @@
template <typename T>
inline
std::size_t
- image3d<T>::ncells() const
+ image3d<T>::nelements() const
{
mln_precondition(this->has_data());
- return data_->vb_.npoints();
+ return data_->vb_.nsites();
}
template <typename T>
@@ -446,18 +459,18 @@
template <typename T>
inline
const T&
- image3d<T>::operator[](unsigned o) const
+ image3d<T>::element(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(data_->buffer_ + o);
}
template <typename T>
inline
T&
- image3d<T>::operator[](unsigned o)
+ image3d<T>::element(unsigned o)
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
return *(data_->buffer_ + o);
}
@@ -500,7 +513,7 @@
template <typename T>
inline
int
- image3d<T>::offset(const dpoint3d& dp) const
+ image3d<T>::delta_index(const dpoint3d& dp) const
{
mln_precondition(this->has_data());
int o = dp[0];
@@ -510,9 +523,9 @@
template <typename T>
inline
point3d
- image3d<T>::point_at_offset(unsigned o) const
+ image3d<T>::point_at_index(unsigned o) const
{
- mln_precondition(o < ncells());
+ mln_precondition(o < nelements());
point3d p = make::point3d(o / (data_->vb_.len(1) * data_->vb_.len(2)) + data_->vb_.min_sli(),
(o % (data_->vb_.len(1) * data_->vb_.len(2))) / data_->vb_.len(2) + data_->vb_.min_row(),
o % data_->vb_.len(2) + data_->vb_.min_col());
Index: mln/core/dpoints_pixter.hh
--- mln/core/dpoints_pixter.hh (revision 2231)
+++ mln/core/dpoints_pixter.hh (working copy)
@@ -264,7 +264,7 @@
dpoints_fwd_pixter<I>::init_(const Dps& dps)
{
for (unsigned i = 0; i < dps.ndpoints(); ++i)
- offset_.push_back(this->image_.offset(dps.dp(i)));
+ offset_.push_back(this->image_.delta_index(dps.dp(i)));
// offset_[0] is absolute
// other offsets are relative:
if (dps.ndpoints() > 1)
@@ -375,7 +375,7 @@
dpoints_bkd_pixter<I>::init_(const Dps& dps)
{
for (unsigned i = 0; i < dps.ndpoints(); ++i)
- offset_.push_back(this->image_.offset(dps.dp(i)));
+ offset_.push_back(this->image_.delta_index(dps.dp(i)));
// offset_[ndpoints() - 1] is absolute
// other offsets are relative:
if (dps.ndpoints() > 1)
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2231)
+++ mln/core/internal/image_base.hh (working copy)
@@ -31,6 +31,8 @@
/*! \file mln/core/internal/image_base.hh
*
* \brief Definition of the common base class for all images.
+ *
+ * \todo Provide coord iff the site is a grid point.
*/
# include <mln/core/concept/image.hh>
@@ -82,6 +84,9 @@
public image_checked_<E>
{
+ /// Coordinate associated type.
+ typedef mln_deduce(S, site, coord) coord;
+
/// Value associated type.
typedef T value;
Index: mln/core/internal/check/image_fastest.hh
--- mln/core/internal/check/image_fastest.hh (revision 2231)
+++ mln/core/internal/check/image_fastest.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Class that statically checks the interface of fastest
* images.
*
- * \todo Check and convert p in offset_at towards E::psite.
+ * \todo Check and convert p in index_of_point towards E::psite.
*/
# include <mln/core/internal/force_exact.hh>
@@ -60,7 +60,7 @@
* \warning This method is final.
*
* \pre The image has to be initialized and to own the point \p p.
- * \post p == point_at_offset(result)
+ * \post p == point_at_index(result)
*/
template <typename P>
unsigned
Index: mln/core/pixel.hh
--- mln/core/pixel.hh (revision 2231)
+++ mln/core/pixel.hh (working copy)
@@ -102,7 +102,7 @@
if (this->value_ptr_ == 0 || ! this->image_.has_data())
return false;
int o = this->value_ptr_ - this->image_.buffer();
- mln_psite(I) p = this->image_.point_at_offset(o);
+ mln_psite(I) p = this->image_.point_at_index(o);
return this->image_.has(p);
}
Index: mln/core/concept/doc/image_fastest.hh
--- mln/core/concept/doc/image_fastest.hh (revision 2231)
+++ mln/core/concept/doc/image_fastest.hh (working copy)
@@ -58,7 +58,7 @@
*
* \pre The image has to be initialized.
*/
- int offset(const dpoint& dp);
+ int delta_index(const dpoint& dp);
/*! \brief Give the point at offset \p o.
@@ -66,9 +66,9 @@
* \param[in] o An offset.
*
* \pre The image has to be initialized.
- * \pre o < ncells()
+ * \pre o < nelements()
*/
- point point_at_offset(unsigned o) const;
+ point point_at_index(unsigned o) const;
/*! \brief Give a hook to the value buffer.
@@ -83,7 +83,7 @@
*
* \param[in] o An offset.
*
- * \pre o < ncells()
+ * \pre o < nelements()
*
* \return The value at \p o (not assignable).
*/
@@ -94,7 +94,7 @@
*
* \param[in] o An offset.
*
- * \pre o < ncells()
+ * \pre o < nelements()
*
* \return The value at \p o (assignable).
*/
@@ -106,7 +106,7 @@
*
* \pre The image has to be initialized.
*/
- std::size_t ncells() const;
+ std::size_t nelements() const;
};
} // end of namespace mln::doc
Index: mln/level/memset_.hh
--- mln/level/memset_.hh (revision 2231)
+++ mln/level/memset_.hh (working copy)
@@ -131,8 +131,8 @@
P& pix = internal::force_exact<P>(pix_);
mln_precondition(pix.ima().has_data());
mln_precondition(& pix.val() >= & pix.ima()[0]);
- mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().ncells());
- mln_precondition(& pix.val() + n <= & pix.ima()[0] + pix.ima().ncells());
+ mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().nelements());
+ mln_precondition(& pix.val() + n <= & pix.ima()[0] + pix.ima().nelements());
impl::memset__(pix, v, n);
@@ -150,7 +150,7 @@
mln_precondition(input.has_data());
mln_precondition(input.has(p));
- mln_precondition(input.offset_at(p) + n <= input.ncells());
+ mln_precondition(input.index_of_point(p) + n <= input.nelements());
pixel<I> pix(input, p);
impl::memset__(pix, v, n);
Index: mln/level/memcpy_.hh
--- mln/level/memcpy_.hh (revision 2231)
+++ mln/level/memcpy_.hh (working copy)
@@ -126,12 +126,12 @@
mln_precondition(src.ima().has_data());
mln_precondition(&dest.val() >= &dest.ima()[0]);
- mln_precondition(&dest.val() < &dest.ima()[0] + dest.ima().ncells());
- mln_precondition(&dest.val() + n <= &dest.ima()[0] + dest.ima().ncells());
+ mln_precondition(&dest.val() < &dest.ima()[0] + dest.ima().nelements());
+ mln_precondition(&dest.val() + n <= &dest.ima()[0] + dest.ima().nelements());
mln_precondition(&src.val() >= &src.ima()[0]);
- mln_precondition(&src.val() < &src.ima()[0] + src.ima().ncells());
- mln_precondition(&src.val() + n <= &src.ima()[0] + src.ima().ncells());
+ mln_precondition(&src.val() < &src.ima()[0] + src.ima().nelements());
+ mln_precondition(&src.val() + n <= &src.ima()[0] + src.ima().nelements());
impl::memcpy__(dest, src, n);
Index: mln/border/fill.hh
--- mln/border/fill.hh (revision 2231)
+++ mln/border/fill.hh (working copy)
@@ -76,7 +76,7 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
std::memset((void*)&ima[st],
*(const int*)(&v),
end - st);
@@ -84,7 +84,7 @@
}
std::memset((void*)&ima[st],
*(const int*)(&v),
- ima.ncells () - st);
+ ima.nelements () - st);
trace::exiting("border::impl::fill_size_1_");
}
@@ -102,12 +102,12 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
for (std::size_t i = st; i < end; ++i)
const_cast<I&>(ima)[i] = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.ncells (); ++i)
+ for (std::size_t i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = v;
trace::exiting("border::impl::fill_size_n_");
Index: mln/border/duplicate.hh
--- mln/border/duplicate.hh (revision 2231)
+++ mln/border/duplicate.hh (working copy)
@@ -78,7 +78,7 @@
const_cast<I&>(ima)[i] = ima[border];
std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.ncells (); ++i)
+ for (std::size_t i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
trace::exiting("border::impl::duplicate_1d_");
@@ -102,7 +102,7 @@
// Duplicate
for_all (pl)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
@@ -154,7 +154,7 @@
// Duplicate
for (std::size_t j = 0; j < len_r; ++j)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
Index: mln/canvas/labeling.hh
--- mln/canvas/labeling.hh (revision 2231)
+++ mln/canvas/labeling.hh (working copy)
@@ -270,7 +270,7 @@
labeling_fastest<F>::init()
{
initialize(parent, f.input);
- for (unsigned p = 0; p < parent.ncells(); ++p)
+ for (unsigned p = 0; p < parent.nelements(); ++p)
parent[p] = p; // make_set
initialize(output, f.input);
mln::level::fill(output, 0); // FIXME: Use literal::zero.
Index: sandbox/duhamel/paste.hh
--- sandbox/duhamel/paste.hh (revision 2231)
+++ sandbox/duhamel/paste.hh (working copy)
@@ -15,7 +15,7 @@
template <typename I>
void paste(const I& data_, I& destination_)
{
- imacpy_ (destination_, data_, destination_.ncells());
+ imacpy_ (destination_, data_, destination_.nelements());
}
template <typename I, typename J>
Index: sandbox/duhamel/fill.hh
--- sandbox/duhamel/fill.hh (revision 2231)
+++ sandbox/duhamel/fill.hh (working copy)
@@ -91,7 +91,7 @@
point2d u = min;
point2d v = min + down;
std::size_t k = ima.offset (down);
- std::size_t max = ima.ncells() / k;
+ std::size_t max = ima.nelements() / k;
for (std::size_t i = 0; i < k; ++i)
*ptr++ = value;
Index: sandbox/duhamel/border_duplicate.hh
--- sandbox/duhamel/border_duplicate.hh (revision 2231)
+++ sandbox/duhamel/border_duplicate.hh (working copy)
@@ -82,7 +82,7 @@
const_cast<I&>(ima)[i] = ima[border];
std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.ncells (); ++i)
+ for (std::size_t i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
}
@@ -104,7 +104,7 @@
// Duplicate
for_all (pl)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
@@ -151,7 +151,7 @@
// Duplicate
for (std::size_t j = 0; j < len_r; ++j)
{
- st = ima.offset_at (pl);
+ st = ima.index_of_point (pl);
for (std::size_t i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
Index: sandbox/duhamel/border_fill.hh
--- sandbox/duhamel/border_fill.hh (revision 2231)
+++ sandbox/duhamel/border_fill.hh (working copy)
@@ -231,7 +231,7 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
std::memset((void*)&ima[st],
*(const int*)(&v),
end - st);
@@ -239,7 +239,7 @@
}
std::memset((void*)&ima[st],
*(const int*)(&v),
- ima.ncells () - st);
+ ima.nelements () - st);
}
template <typename I>
@@ -254,12 +254,12 @@
for_all (pl)
{
- std::size_t end = ima.offset_at (pl);
+ std::size_t end = ima.index_of_point (pl);
for (std::size_t i = st; i < end; ++i)
const_cast<I&>(ima)[i] = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.ncells (); ++i)
+ for (std::size_t i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = v;
}
} // end of namespace mln::border::impl
Index: sandbox/nivault/plugin-gimp/src/gimp-image.hh
--- sandbox/nivault/plugin-gimp/src/gimp-image.hh (revision 2231)
+++ sandbox/nivault/plugin-gimp/src/gimp-image.hh (working copy)
@@ -194,7 +194,7 @@
unsigned border() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// const-only access to the image value located at point \p p.
const T& operator()(const point& p) const;
@@ -218,10 +218,10 @@
/// Fast Image method
// /// Give the offset corresponding to the delta-point \p dp.
-// int offset(const dpoint2d& dp) const;
+// int delta_index(const dpoint2d& dp) const;
// /// Give the point corresponding to the offset \p o.
-// point2d point_at_offset(unsigned o) const;
+// point2d point_at_index(unsigned o) const;
/// Give a hook to the value buffer.
const T* buffer() const;
@@ -390,7 +390,7 @@
template <GimpImageType t>
std::size_t
- gimp_image<t>::ncells() const
+ gimp_image<t>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
@@ -438,7 +438,7 @@
// const mln_value(gimp_image<t>)&
// gimp_image<t>::operator[](unsigned o) const
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// return *(this->data_->buffer_ + o);
// }
@@ -447,7 +447,7 @@
// mln_value(gimp_image<t>)&
// gimp_image<t>::operator[](unsigned o)
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// return *(this->data_->buffer_ + o);
// }
@@ -490,7 +490,7 @@
// template <GimpImageType t>
// int
-// gimp_image<t>::offset(const dpoint2d& dp) const
+// gimp_image<t>::delta_index(const dpoint2d& dp) const
// {
// mln_precondition(this->has_data());
// int o = dp[0] * this->data_->b_.len(1) + dp[1];
@@ -500,9 +500,9 @@
// template <GimpImageType t>
// point2d
-// gimp_image<t>::point_at_offset(unsigned o) const
+// gimp_image<t>::point_at_index(unsigned o) const
// {
-// mln_precondition(o < ncells());
+// mln_precondition(o < nelements());
// point2d p = make::point2d(o / this->data_->b_.len(1) + this->data_->b_.min_row(),
// o % this->data_->b_.len(1) + this->data_->b_.min_col());
// mln_postcondition(& this->operator()(p) == this->data_->buffer_ + o);
Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh
--- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2231)
+++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy)
@@ -187,7 +187,7 @@
const box2d& domain() const;
/// Give the number of cells (points including border ones).
- std::size_t ncells() const;
+ std::size_t nelements() const;
/// Read-only access to the image value located at point \p p.
const T& operator()(const point2d& p) const;
@@ -320,7 +320,7 @@
template <typename T>
inline
std::size_t
- tiled_image2d<T>::ncells() const
+ tiled_image2d<T>::nelements() const
{
mln_precondition(this->has_data());
return this->data_->b_.npoints();
1
0
cleanup-2008 2231: Clean level::paste; yet de-activate specializations.
by Thierry Geraud 12 Sep '08
by Thierry Geraud 12 Sep '08
12 Sep '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Clean level::paste; yet de-activate specializations.
* tests/level/paste.cc: Deactivate 3D tests.
* mln/core/image/instant.hh (init_): New method; fix missing.
* mln/level/paste.spe.hh (paste_dispatch): New.
De-activate specializations; it calls the generic version.
* mln/level/paste.hh (paste_tests): New in internal.
(paste): Call tests then dispatch.
mln/core/image/instant.hh | 13 ++++++
mln/level/paste.hh | 40 +++++++++++++--------
mln/level/paste.spe.hh | 86 ++++++++++++++++++++++++++--------------------
tests/level/paste.cc | 36 +++++++++----------
4 files changed, 107 insertions(+), 68 deletions(-)
Index: tests/level/paste.cc
--- tests/level/paste.cc (revision 2230)
+++ tests/level/paste.cc (working copy)
@@ -31,7 +31,7 @@
*/
#include <mln/core/image/image2d.hh>
-#include <mln/core/image/image3d.hh>
+// #include <mln/core/image/image3d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/level/fill.hh>
@@ -59,24 +59,24 @@
level::paste(ima, ima2); // Fast version.
assert(ima == (ima2 | b));
- level::impl::generic::paste_(ima, ima2); // Not so fast version...
+ level::impl::generic::paste(ima, ima2); // Not so fast version...
assert(ima == (ima2 | b));
}
- // tests in three dimension
- {
- box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
- image3d<int> ima(b, 2);
- debug::iota(ima);
-
- box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
- image3d<int> ima2(b2, 2);
- debug::iota(ima2);
-
- level::paste(ima, ima2); // Fast version.
- assert(ima == (ima2 | b));
-
- level::impl::generic::paste_(ima, ima2); // Not so fast version...
- assert(ima == (ima2 | b));
- }
+// // tests in three dimension
+// {
+// box3d b(make::point3d(1,2, 1), make::point3d(2,4, 3));
+// image3d<int> ima(b, 2);
+// debug::iota(ima);
+
+// box3d b2(make::point3d(-1,-2, -1), make::point3d(3,6, 3));
+// image3d<int> ima2(b2, 2);
+// debug::iota(ima2);
+
+// level::paste(ima, ima2); // Fast version.
+// assert(ima == (ima2 | b));
+
+// level::impl::generic::paste(ima, ima2); // Not so fast version...
+// assert(ima == (ima2 | b));
+// }
}
Index: mln/core/image/instant.hh
--- mln/core/image/instant.hh (revision 2230)
+++ mln/core/image/instant.hh (working copy)
@@ -95,6 +95,9 @@
/// Constructor.
instant_(I& ima);
+ /// Deferred initialization.
+ void init_(I& ima);
+
/// Remove the "instant" envelope.
I& un_instant_();
I& un_instant_() const;
@@ -126,6 +129,16 @@
instant_<I>::instant_(I& ima)
{
mln_precondition(ima.has_data());
+ this->init_(ima);
+ this->data_ = new internal::data< instant_<I> >(ima);
+ }
+
+ template <typename I>
+ inline
+ void
+ instant_<I>::init_(I& ima)
+ {
+ mln_precondition(ima.has_data());
this->data_ = new internal::data< instant_<I> >(ima);
}
Index: mln/level/paste.spe.hh
--- mln/level/paste.spe.hh (revision 2230)
+++ mln/level/paste.spe.hh (working copy)
@@ -57,54 +57,68 @@
namespace generic
{
template <typename I, typename J>
- void paste_(const I& data, J& destination);
- }
-
- template <typename I, typename J>
- inline
- void paste_lines_(const I& data, J& destination)
- {
- trace::entering("level::impl::paste_lines_");
- typedef mln_psite(I) P;
- std::size_t n = data.bbox().len(P::dim - 1);
- // FIXME: Works only for raw data images
- // FIXME: For linear data images, we should get the len for each line...
-
- typename I::line_piter p(data.domain()); // FIXME: Alias mln_line_piter!
- // mln_line_piter(I) p(data.domain());
- for_all(p)
- memcpy_(inplace(make::pixel(destination, p)),
- make::pixel(data, p),
- n);
- trace::exiting("level::impl::paste_lines_");
+ void paste(const Image<I>& data, Image<J>& destination);
}
+// template <typename I, typename J>
+// inline
+// void paste_lines_(const I& data, J& destination)
+// {
+// trace::entering("level::impl::paste_lines_");
+// typedef mln_psite(I) P;
+// std::size_t n = data.bbox().len(P::dim - 1);
+// // FIXME: Works only for raw data images
+// // FIXME: For linear data images, we should get the len for each line...
+
+// typename I::line_piter p(data.domain()); // FIXME: Alias mln_line_piter!
+// // mln_line_piter(I) p(data.domain());
+// for_all(p)
+// memcpy_(inplace(make::pixel(destination, p)),
+// make::pixel(data, p),
+// n);
+// trace::exiting("level::impl::paste_lines_");
+// }
+
+
+// // Disjunction.
+
+// // Remember: raw < linear < stored, computed.
+
+// template <typename I, typename J>
+// inline
+// void paste_(trait::image::value_storage::any, const I& data,
+// trait::image::value_storage::any, J& destination)
+// {
+// generic::paste_(data, destination);
+// }
+
+// template <typename I, typename J>
+// inline
+// void paste_(trait::image::value_storage::one_block, const I& data,
+// trait::image::value_storage::one_block, J& destination)
+// {
+// if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
+// paste_lines_(data, destination);
+// else
+// generic::paste_(data, destination);
+// }
- // Disjunction.
- // Remember: raw < linear < stored, computed.
+ } // end of namespace mln::level::impl
- template <typename I, typename J>
- inline
- void paste_(trait::image::value_storage::any, const I& data,
- trait::image::value_storage::any, J& destination)
+ namespace internal
{
- generic::paste_(data, destination);
- }
template <typename I, typename J>
inline
- void paste_(trait::image::value_storage::one_block, const I& data,
- trait::image::value_storage::one_block, J& destination)
+ void paste_dispatch(const Image<I>& data, Image<J>& destination)
{
- if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
- paste_lines_(data, destination);
- else
- generic::paste_(data, destination);
+ impl::generic::paste(data, destination);
+// impl::paste_(mln_trait_image_value_storage(I)(), data,
+// mln_trait_image_value_storage(J)(), destination);
}
-
- } // end of namespace mln::level::impl
+ } // end of namespace mln::level::internal
} // end of namespace mln::level
Index: mln/level/paste.hh
--- mln/level/paste.hh (revision 2230)
+++ mln/level/paste.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -73,6 +73,21 @@
# ifndef MLN_INCLUDE_ONLY
+ namespace internal
+ {
+
+ template <typename I, typename J>
+ inline
+ void paste_tests(const Image<I>& data, Image<J>& destination)
+ {
+ mlc_is(mln_trait_image_value_io(J), trait::image::value_io::read_write)::check();
+ mlc_converts_to(mln_value(I), mln_value(J))::check();
+ mln_precondition(exact(data).has_data());
+ mln_precondition(exact(data).domain() <= exact(destination).domain());
+ }
+
+ } // end of namespace mln::level::internal
+
namespace impl
{
@@ -81,15 +96,19 @@
template <typename I, typename J>
inline
- void paste_(const I& data, J& destination)
+ void paste(const Image<I>& data_, Image<J>& destination_)
{
- trace::entering("level::impl::generic::paste_");
+ trace::entering("level::impl::generic::paste");
+
+ internal::paste_tests(data_, destination_);
+ const I& data = exact(data_);
+ J& destination = exact(destination_);
mln_piter(I) p(data.domain());
for_all(p)
destination(p) = data(p);
- trace::exiting("level::impl::generic::paste_");
+ trace::exiting("level::impl::generic::paste");
}
} // end of namespace mln::level::impl::generic
@@ -101,19 +120,12 @@
template <typename I, typename J>
inline
- void paste(const Image<I>& data_, Image<J>& destination_)
+ void paste(const Image<I>& data, Image<J>& destination)
{
trace::entering("level::paste");
- const I& data = exact(data_);
- J& destination = exact(destination_);
-
- mlc_is(mln_trait_image_value_io(J), trait::image::value_io::read_write)::check();
- mlc_converts_to(mln_value(I), mln_value(J))::check();
- mln_precondition(data.domain() <= destination.domain());
-
- impl::paste_(mln_trait_image_value_storage(I)(), data,
- mln_trait_image_value_storage(J)(), destination);
+ internal::paste_tests(data, destination);
+ internal::paste_dispatch(data, destination);
trace::exiting("level::paste");
}
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Make the tests in tests/accu work.
* tests/accu/Makefile.am,
* tests/accu/all_accus.cc,
* tests/accu/histo.cc,
* tests/accu/rank.cc: Update.
* tests/accu/median.cc,
* tests/accu/median_h.cc: Move, rename median to median_h and update.
* mln/accu/min_h.hh,
* mln/accu/max_h.hh: Update licenses.
* mln/accu/rank.hh: Update.
* mln/accu/median.hh,
* mln/accu/median_h.hh: Move, rename to median_h and update.
* mln/accu/all.hh: Rename median to median_h.
mln/accu/all.hh | 2 -
mln/accu/max_h.hh | 2 -
mln/accu/median_h.hh | 89 +++++++++++++++++++++---------------------------
mln/accu/min_h.hh | 2 -
mln/accu/rank.hh | 16 +-------
tests/accu/Makefile.am | 6 ++-
tests/accu/all_accus.cc | 2 -
tests/accu/histo.cc | 2 -
tests/accu/median_h.cc | 10 ++---
tests/accu/rank.cc | 16 ++++----
10 files changed, 64 insertions(+), 83 deletions(-)
Index: tests/accu/rank.cc
--- tests/accu/rank.cc (revision 2229)
+++ tests/accu/rank.cc (working copy)
@@ -54,42 +54,42 @@
{
accu::rank_<value::int_u8> accu(0, 8);
fill(accu);
- mln_assertion(accu.to_result() == 1);
+ mln_assertion(accu.to_result() == 1u);
}
{
accu::rank_<value::int_u8> accu(1, 8);
fill(accu);
- mln_assertion(accu.to_result() == 2);
+ mln_assertion(accu.to_result() == 2u);
}
{
accu::rank_<value::int_u8> accu(2, 8);
fill(accu);
- mln_assertion(accu.to_result() == 2);
+ mln_assertion(accu.to_result() == 2u);
}
{
accu::rank_<value::int_u8> accu(3, 8);
fill(accu);
- mln_assertion(accu.to_result() == 3);
+ mln_assertion(accu.to_result() == 3u);
}
{
accu::rank_<value::int_u8> accu(4, 8);
fill(accu);
- mln_assertion(accu.to_result() == 4);
+ mln_assertion(accu.to_result() == 4u);
}
{
accu::rank_<value::int_u8> accu(5, 8);
fill(accu);
- mln_assertion(accu.to_result() == 5);
+ mln_assertion(accu.to_result() == 5u);
}
{
accu::rank_<value::int_u8> accu(6, 8);
fill(accu);
- mln_assertion(accu.to_result() == 5);
+ mln_assertion(accu.to_result() == 5u);
}
{
accu::rank_<value::int_u8> accu(7, 8);
fill(accu);
- mln_assertion(accu.to_result() == 5);
+ mln_assertion(accu.to_result() == 5u);
}
{
accu::rank_<bool> accu_bool(1, 5);
Index: tests/accu/median_h.cc
--- tests/accu/median_h.cc (revision 2228)
+++ tests/accu/median_h.cc (working copy)
@@ -25,22 +25,22 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/accu/median.cc
+/*! \file tests/accu/median_h.cc
*
- * \brief Tests on mln::accu::median.
+ * \brief Tests on mln::accu::median_h.
*/
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/accu/median.hh>
+#include <mln/accu/median_h.hh>
int main()
{
using namespace mln;
{
- accu::median< value::set<value::int_u8> > med;
+ accu::median_h<value::int_u8> med;
med.take(10);
med.take(9);
@@ -58,7 +58,7 @@
}
{
- accu::median< value::set<value::int_u8> > med;
+ accu::median_h<value::int_u8> med;
med.take(10);
med.take(7);
Property changes on: tests/accu/median_h.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: tests/accu/Makefile.am
--- tests/accu/Makefile.am (revision 2229)
+++ tests/accu/Makefile.am (working copy)
@@ -11,12 +11,13 @@
max \
max_h \
mean \
- median \
+ median_h \
min \
min_h \
min_max \
nil \
pair \
+ rank \
tuple
all_accus_SOURCES = all_accus.cc
@@ -27,12 +28,13 @@
max_SOURCES = max.cc
max_h_SOURCES = max_h.cc
mean_SOURCES = mean.cc
-median_SOURCES = median.cc
+median_h_SOURCES = median_h.cc
min_SOURCES = min.cc
min_h_SOURCES = min_h.cc
min_max_SOURCES = min_max.cc
nil_SOURCES = nil.cc
pair_SOURCES = pair.cc
+rank_SOURCES = rank.cc
tuple_SOURCES = tuple.cc
TESTS = $(check_PROGRAMS)
Index: tests/accu/all_accus.cc
--- tests/accu/all_accus.cc (revision 2229)
+++ tests/accu/all_accus.cc (working copy)
@@ -40,7 +40,7 @@
bbox<point2d> b;
count_<int> c;
- histo< value::set<bool> > h;
+ mln::accu::histo<bool> h;
max_<int> ma;
mean_<int> me;
// median< value::set<bool> > med; // FIXME: bool has no min so workaround!
Index: tests/accu/histo.cc
--- tests/accu/histo.cc (revision 2229)
+++ tests/accu/histo.cc (working copy)
@@ -40,7 +40,7 @@
using namespace mln;
using namespace mln::value;
- accu::histo< set<int_u8> > a;
+ accu::histo<int_u8> a;
a.take(1);
a.take(1);
Index: mln/accu/min_h.hh
--- mln/accu/min_h.hh (revision 2229)
+++ mln/accu/min_h.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
Index: mln/accu/rank.hh
--- mln/accu/rank.hh (revision 2229)
+++ mln/accu/rank.hh (working copy)
@@ -53,13 +53,12 @@
* The parameter \c T is the type of values.
*/
template <typename T>
- struct rank_ : public mln::accu::internal::base_< T, rank_<T> >
+ struct rank_ : public mln::accu::internal::base< T, rank_<T> >
{
typedef T argument;
typedef T result;
typedef mln::value::set<T> S;
- rank_(unsigned k, unsigned n, const Value_Set<S>& s);
rank_(unsigned k, unsigned n);
void init();
@@ -76,7 +75,7 @@
unsigned k_; // 0 <= k_ < n
unsigned n_;
- mutable accu::histo<S> h_;
+ mutable accu::histo<T> h_;
const S& s_; // derived from h_
mutable std::size_t sum_minus_, sum_plus_;
@@ -127,17 +126,6 @@
}
- template <typename T>
- inline
- rank_<T>::rank_(unsigned k, unsigned n, const Value_Set<mln::value::set<T> >& s)
- : k_(k),
- n_(n),
- h_(s),
- s_(h_.vset())
- {
- mln_assertion(k_ < n_);
- init();
- }
template <typename T>
inline
Index: mln/accu/max_h.hh
--- mln/accu/max_h.hh (revision 2229)
+++ mln/accu/max_h.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
Index: mln/accu/median_h.hh
--- mln/accu/median_h.hh (revision 2228)
+++ mln/accu/median_h.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,16 +25,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ACCU_MEDIAN_HH
-# define MLN_ACCU_MEDIAN_HH
+#ifndef MLN_ACCU_MEDIAN_H_HH
+# define MLN_ACCU_MEDIAN_H_HH
-/*! \file mln/accu/median.hh
+/*! \file mln/accu/median_h.hh
*
* \brief Define a generic median accumulator class.
*/
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
+# include <mln/value/set.hh>
namespace mln
@@ -45,38 +46,37 @@
/*! \brief Generic median function based on histogram over a value
- * set with type \c S.
+ * set with type \c V.
*/
- template <typename S>
- struct median : public mln::accu::internal::base< mln_value(S), median<S> >
- { // FIXME: Should median be named 'median_' like other accumulators ?
- typedef mln_value(S) argument;
+ template <typename V>
+ struct median_h : public mln::accu::internal::base< V, median_h<V> >
+ {
+ typedef V argument;
typedef argument result;
- median(const Value_Set<S>& s);
- median();
+ median_h();
void init();
void take(const argument& t);
- void take(const median<S>& other);
+ void take(const median_h<V>& other);
void untake(const argument& t);
unsigned card() const { return h_.sum(); }
argument to_result() const;
- const accu::histo<S>& histo() const;
+ const accu::histo<V>& histo() const;
protected:
- mutable accu::histo<S> h_;
- const S& s_; // derived from h_
+ mutable accu::histo<V> h_;
+ const value::set<V>& s_; // derived from h_
mutable std::size_t sum_minus_, sum_plus_;
mutable bool valid_;
- mutable std::size_t i_; // the median index
- mutable argument t_; // the median value
+ mutable std::size_t i_; // the median_h index
+ mutable argument t_; // the median_h value
// Auxiliary methods
void update_() const;
@@ -87,28 +87,19 @@
# ifndef MLN_INCLUDE_ONLY
- template <typename S>
- inline
- median<S>::median(const Value_Set<S>& s)
- : h_(s),
- s_(h_.vset())
- {
- init();
- }
-
- template <typename S>
+ template <typename V>
inline
- median<S>::median()
+ median_h<V>::median_h()
: h_(),
s_(h_.vset())
{
init();
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::take(const argument& t)
+ median_h<V>::take(const argument& t)
{
h_.take(t);
@@ -121,10 +112,10 @@
valid_ = false;
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::take(const median<S>& other)
+ median_h<V>::take(const median_h<V>& other)
{
// h_
h_.take(other.h_);
@@ -141,10 +132,10 @@
valid_ = false;
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::untake(const argument& t)
+ median_h<V>::untake(const argument& t)
{
mln_precondition(h_(t) != 0);
h_.untake(t);
@@ -158,10 +149,10 @@
valid_ = false;
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::update_() const
+ median_h<V>::update_() const
{
valid_ = true;
@@ -184,10 +175,10 @@
}
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::go_minus_() const
+ median_h<V>::go_minus_() const
{
do
{
@@ -201,10 +192,10 @@
t_ = s_[i_];
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::go_plus_() const
+ median_h<V>::go_plus_() const
{
do
{
@@ -218,10 +209,10 @@
t_ = s_[i_];
}
- template <typename S>
+ template <typename V>
inline
void
- median<S>::init()
+ median_h<V>::init()
{
h_.init();
sum_minus_ = 0;
@@ -232,20 +223,20 @@
valid_ = true;
}
- template <typename S>
+ template <typename V>
inline
- typename median<S>::argument
- median<S>::to_result() const
+ typename median_h<V>::argument
+ median_h<V>::to_result() const
{
if (! valid_)
update_();
return t_;
}
- template <typename S>
+ template <typename V>
inline
- const accu::histo<S>&
- median<S>::histo() const
+ const accu::histo<V>&
+ median_h<V>::histo() const
{
return h_;
}
@@ -257,4 +248,4 @@
} // end of namespace mln
-#endif // ! MLN_ACCU_MEDIAN_HH
+#endif // ! MLN_ACCU_MEDIAN_H_HH
Property changes on: mln/accu/median_h.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/accu/all.hh
--- mln/accu/all.hh (revision 2229)
+++ mln/accu/all.hh (working copy)
@@ -58,7 +58,7 @@
# include <mln/accu/histo.hh>
# include <mln/accu/max.hh>
# include <mln/accu/mean.hh>
-# include <mln/accu/median.hh>
+# include <mln/accu/median_h.hh>
# include <mln/accu/min.hh>
# include <mln/accu/min_h.hh>
# include <mln/accu/min_max.hh>
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update the design of windows.
Propagate box renaming.
* mln/core/site_set/p_bgraph.hh,
* mln/core/site_set/p_complex.hh,
* mln/core/site_set/p_line_graph.hh,
* mln/core/site_set/p_faces.hh,
* mln/core/site_set/p_graph.hh,
* mln/core/image/obased_rle_image.hh,
* mln/core/image/t_image.hh,
* mln/core/concept/doc/image.hh,
* mln/core/line_piter.hh,
* mln/core/alias/box2d_h.hh
(box_): Update to...
(box): ...its new name.
Use site-related names instead of point-related names.
* mln/core/w_window.hh,
* mln/core/clock_neighb.hh,
* mln/core/internal/image_base.hh,
* mln/core/concept/doc/weighted_window.hh,
* mln/core/concept/doc/dpoint.hh,
* mln/core/concept/doc/neighborhood.hh,
* mln/core/concept/doc/point_site.hh: Fix doc.
* mln/make/w_window.hh,
* mln/convert/to_upper_window.hh,
* mln/convert/to_image.hh,
* mln/convert/to_std_set.hh,
* mln/convert/to_p_set.hh,
* mln/geom/shift.hh: Fix code.
Update the design of windows.
* mln/core/point.hh (site, psite): New; this is a temp hack.
* mln/core/internal/dpoints_base.hh: Revamp.
(set_of): Remove; use instead...
(util::set): ...this and prefer delegation to...
(win_): ...this new attribute.
(insert): New protected method; no more inherited.
* mln/win/vline2d.hh,
* mln/win/hline2d.hh,
* mln/win/cube3d.hh,
* mln/win/segment1d.hh,
* mln/win/line.hh,
* mln/win/rectangle2d.hh,
* mln/win/diag2d.hh,
* mln/win/backdiag2d.hh,
* mln/win/cuboid3d.hh,
* mln/win/octagon2d.hh,
* mln/win/disk2d.hh: Update.
Misc.
* mln/core/site_set/p_array.hh: Fix missing include.
* mln/core/concept/window.hh (operator==): New.
* mln/core/grids.hh (coord): New include.
* mln/geom/bbox.hh: New overload for windows.
* mln/geom/sym.hh: Fix; the 'sym' method returns void.
convert/to_image.hh | 10 ++--
convert/to_p_set.hh | 8 +--
convert/to_std_set.hh | 12 ++---
convert/to_upper_window.hh | 6 +-
core/alias/box2d_h.hh | 2
core/clock_neighb.hh | 4 -
core/concept/doc/dpoint.hh | 4 -
core/concept/doc/image.hh | 6 +-
core/concept/doc/neighborhood.hh | 4 -
core/concept/doc/point_site.hh | 4 -
core/concept/doc/weighted_window.hh | 4 -
core/concept/window.hh | 8 +++
core/grids.hh | 3 -
core/image/obased_rle_image.hh | 6 +-
core/image/t_image.hh | 12 ++---
core/internal/dpoints_base.hh | 83 ++++++++++++++++++++++++------------
core/internal/image_base.hh | 2
core/line_piter.hh | 6 +-
core/point.hh | 5 ++
core/site_set/p_array.hh | 1
core/site_set/p_bgraph.hh | 6 +-
core/site_set/p_complex.hh | 6 +-
core/site_set/p_faces.hh | 6 +-
core/site_set/p_graph.hh | 6 +-
core/site_set/p_line_graph.hh | 6 +-
core/w_window.hh | 4 -
core/window.hh | 2
geom/bbox.hh | 23 +++++++++
geom/shift.hh | 12 ++---
geom/sym.hh | 8 ++-
make/w_window.hh | 6 +-
win/backdiag2d.hh | 27 +----------
win/cube3d.hh | 27 +----------
win/cuboid3d.hh | 25 ----------
win/diag2d.hh | 27 +----------
win/disk2d.hh | 27 +----------
win/hline2d.hh | 4 -
win/line.hh | 29 ++----------
win/octagon2d.hh | 27 +----------
win/rectangle2d.hh | 28 +++---------
win/segment1d.hh | 4 -
win/vline2d.hh | 4 -
42 files changed, 211 insertions(+), 293 deletions(-)
Index: mln/core/site_set/p_bgraph.hh
--- mln/core/site_set/p_bgraph.hh (revision 2228)
+++ mln/core/site_set/p_bgraph.hh (working copy)
@@ -84,7 +84,7 @@
std::size_t nlines() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -106,7 +106,7 @@
private:
graph* gr_;
- box_<P> bb_;
+ box<P> bb_;
};
# ifndef MLN_INCLUDE_ONLY
@@ -146,7 +146,7 @@
template<typename P>
inline
- const box_<P>&
+ const box<P>&
p_bgraph<P>::bbox() const
{
return bb_;
Index: mln/core/site_set/p_complex.hh
--- mln/core/site_set/p_complex.hh (revision 2228)
+++ mln/core/site_set/p_complex.hh (working copy)
@@ -103,7 +103,7 @@
complex<D>& cplx();
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
/// \}
private:
@@ -125,7 +125,7 @@
are not tied to a specific graph. */
mutable util::tracked_ptr< complex<D> > cplx_;
// FIXME: Remove as soon as bbox become optional.
- box_<P> bb_;
+ box<P> bb_;
};
@@ -212,7 +212,7 @@
template <unsigned D, typename P>
inline
- const box_<P>&
+ const box<P>&
p_complex<D, P>::bbox() const
{
// FIXME: Dummy value.
Index: mln/core/site_set/p_line_graph.hh
--- mln/core/site_set/p_line_graph.hh (revision 2228)
+++ mln/core/site_set/p_line_graph.hh (working copy)
@@ -87,7 +87,7 @@
std::size_t nedges() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -113,7 +113,7 @@
/* 2007-12-19: It seems so, since graph_image must implement a
method named bbox(). Now the question is: should each image
type have a bounding box? */
- box_<P> bb_;
+ box<P> bb_;
};
@@ -178,7 +178,7 @@
template <typename P>
inline
- const box_<P>&
+ const box<P>&
p_line_graph<P>::bbox() const
{
return bb_;
Index: mln/core/site_set/p_array.hh
--- mln/core/site_set/p_array.hh (revision 2228)
+++ mln/core/site_set/p_array.hh (working copy)
@@ -41,6 +41,7 @@
# include <vector>
# include <mln/core/internal/site_set_base.hh>
+# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/internal/pseudo_site_base.hh>
# include <mln/util/index.hh>
Index: mln/core/site_set/p_faces.hh
--- mln/core/site_set/p_faces.hh (revision 2228)
+++ mln/core/site_set/p_faces.hh (working copy)
@@ -85,7 +85,7 @@
std::size_t nfaces() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -96,7 +96,7 @@
/// The complex on which this pset is built.
util::tracked_ptr< complex<D> > cplx_;
// FIXME: Remove as soon as bbox become optional.
- box_<P> bb_;
+ box<P> bb_;
};
@@ -158,7 +158,7 @@
template <unsigned N, unsigned D, typename P>
inline
- const box_<P>&
+ const box<P>&
p_faces<N, D, P>::bbox() const
{
// FIXME: Dummy value.
Index: mln/core/site_set/p_graph.hh
--- mln/core/site_set/p_graph.hh (revision 2228)
+++ mln/core/site_set/p_graph.hh (working copy)
@@ -79,7 +79,7 @@
std::size_t nedges() const;
/// Give the exact bounding box.
- const box_<P>& bbox() const;
+ const box<P>& bbox() const;
bool has(const psite& p) const;
@@ -125,7 +125,7 @@
named bbox(). Now the question is: should each image type have a
bounding box? */
private:
- box_<P> bb_;
+ box<P> bb_;
};
@@ -191,7 +191,7 @@
template <typename P>
inline
- const box_<P>&
+ const box<P>&
p_graph<P>::bbox() const
{
return bb_;
Index: mln/core/image/obased_rle_image.hh
--- mln/core/image/obased_rle_image.hh (revision 2228)
+++ mln/core/image/obased_rle_image.hh (working copy)
@@ -147,7 +147,7 @@
const std::vector<unsigned>& object(unsigned i) const;
/// Give the bounding box of the i-th object.
- const box_<P>& bbox_of_run(unsigned i) const;
+ const box<P>& bbox_of_run(unsigned i) const;
};
@@ -175,7 +175,7 @@
data_< obased_rle_image<P,T> >::size_mem() const
{
return domain_.size_mem() + bbox_.size()
- * (sizeof(T) + sizeof(box_<P>) + sizeof(std::vector<unsigned>))
+ * (sizeof(T) + sizeof(box<P>) + sizeof(std::vector<unsigned>))
+ (sizeof(unsigned) + sizeof(T)) * domain_.nruns();
}
@@ -261,7 +261,7 @@
template <typename P, typename T>
inline
- const box_<P>&
+ const box<P>&
obased_rle_image<P, T>::bbox_of_run(unsigned i) const
{
mln_assertion(i < this->data_->bbox_.size());
Index: mln/core/image/t_image.hh
--- mln/core/image/t_image.hh (revision 2228)
+++ mln/core/image/t_image.hh (working copy)
@@ -57,7 +57,7 @@
/// \param dim2 The second dimension to be swapped.
/// \param box The bounding box (domain) of the morphed image.
data(I& ima, unsigned dim1, unsigned dim2,
- mln::box_<mln_psite(I)>& box);
+ mln::box<mln_psite(I)>& box);
/// Underlying image.
I ima_;
@@ -67,7 +67,7 @@
unsigned dim2_;
/// \}
/// The bounding box of the morphed image.
- mln::box_<mln_psite(I)> box_;
+ mln::box<mln_psite(I)> box_;
};
} // end of namespace mln::internal
@@ -126,7 +126,7 @@
bool has(const mln_psite(I)& p) const;
/// Give the definition domain.
- const box_<mln_psite(I)>& domain() const;
+ const box<mln_psite(I)>& domain() const;
/// Read-only access of pixel value at point site \p p.
mln_rvalue(I) operator()(const mln_psite(I)& p) const;
@@ -168,7 +168,7 @@
inline
data< t_image<I> >::data(I& ima,
unsigned dim1, unsigned dim2,
- mln::box_<mln_psite(I)>& box)
+ mln::box<mln_psite(I)>& box)
: ima_(ima),
dim1_(dim1), dim2_(dim2),
box_(box)
@@ -188,7 +188,7 @@
// We don't use mln::t_image::transpose here, since one its
// prerequisite is that data_ is initialized, which is not done
// yet at this point.
- box_<mln_psite(I)> box(exchange_coords_(ima.bbox().pmin(), dim1, dim2),
+ box<mln_psite(I)> box(exchange_coords_(ima.bbox().pmin(), dim1, dim2),
exchange_coords_(ima.bbox().pmax(), dim1, dim2));
this->data_ = new internal::data< t_image<I> >(ima, dim1, dim2, box);
}
@@ -233,7 +233,7 @@
template <typename I>
inline
- const box_<mln_psite(I)>&
+ const box<mln_psite(I)>&
t_image<I>::domain() const
{
mln_precondition(this->has_data());
Index: mln/core/point.hh
--- mln/core/point.hh (revision 2228)
+++ mln/core/point.hh (working copy)
@@ -85,6 +85,11 @@
struct point : public Gpoint< point<G,C> >,
public internal::mutable_coord_impl_< G::dim, C, point<G,C> >
{
+ // FIXME: Temporary hack.
+ typedef point site;
+ typedef point psite;
+
+
/*! \var dim
* \brief Dimension of the space.
* \invariant dim > 0
Index: mln/core/w_window.hh
--- mln/core/w_window.hh (revision 2228)
+++ mln/core/w_window.hh (working copy)
@@ -56,10 +56,10 @@
template <typename D, typename W>
struct w_window : public Weighted_Window< w_window<D,W> >
{
- /// Point associated type.
+ /// Site associated type.
typedef mln_point(D) point;
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef D dpoint;
/// Weight associated type.
Index: mln/core/window.hh
--- mln/core/window.hh (revision 2228)
+++ mln/core/window.hh (working copy)
@@ -38,6 +38,8 @@
* \todo Code other comparisons (< and <=).
*
* \todo Add static checks in insert methods.
+ *
+ * \todo Rename dps_hook_ as util_set_.
*/
# include <mln/core/internal/window_base.hh>
Index: mln/core/clock_neighb.hh
--- mln/core/clock_neighb.hh (revision 2228)
+++ mln/core/clock_neighb.hh (working copy)
@@ -54,10 +54,10 @@
template <typename D>
struct clock_neighb_ : public Neighborhood< clock_neighb_ <D> >
{
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef D dpoint;
- /// Point associated type.
+ /// Site associated type.
typedef mln_point(D) point;
/*! \brief Site_Iterator type to browse the points of a generic
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2228)
+++ mln/core/internal/image_base.hh (working copy)
@@ -105,7 +105,7 @@
/// Point_Site associated type.
typedef mln_psite(S) psite;
- /// Point associated type.
+ /// Site associated type.
typedef mln_site(S) site;
Index: mln/core/internal/dpoints_base.hh
--- mln/core/internal/dpoints_base.hh (revision 2228)
+++ mln/core/internal/dpoints_base.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -31,11 +31,15 @@
/*! \file mln/core/internal/dpoints_base.hh
*
* \brief Definition of a base class for classes based on a set of dpoints.
+ *
+ * \todo Rename as dpsites_impl.
+ *
+ * \todo Remove the .vect() method.
*/
-# include <mln/core/internal/set_of.hh>
-# include <mln/fun/i2v/all_to.hh>
-# include <mln/norm/linfty.hh>
+# include <mln/core/window.hh>
+# include <mln/core/dpsites_piter.hh>
+
namespace mln
@@ -48,16 +52,28 @@
*
*/
template <typename D, typename E>
- class dpoints_base_ : protected internal::set_of_<D>
+ class dpoints_base_
{
- typedef internal::set_of_<D> super_;
public:
- /// Point associated type.
- typedef mln_point(D) point;
+ /// Dpsite associated type.
+ typedef D dpsite;
+
+ /// Psite associated type.
+ typedef mln_psite(D) psite;
+
+ /// Site associated type.
+ typedef mln_site(D) site;
+
+
+ /// Forward site iterator associated type.
+ typedef dpsites_fwd_piter<E> fwd_qiter;
- /// Dpoint associated type.
- typedef D dpoint;
+ /// Backward site iterator associated type.
+ typedef dpsites_fwd_piter<E> bkd_qiter;
+
+ /// Site iterator associated type.
+ typedef fwd_qiter qiter;
/*! \brief Test if the window is centered.
@@ -87,8 +103,16 @@
// Give the vector of delta-points.
const std::vector<D>& vect() const;
+ // Give the vector of delta-points.
+ const std::vector<D>& std_vector() const;
+
protected:
+
dpoints_base_();
+
+ void insert(const D& d);
+
+ mln::window<D> win_;
};
@@ -105,30 +129,21 @@
inline
bool dpoints_base_<D,E>::is_centered() const
{
- static const D origin = all_to(0);
- return this->super_::has(origin);
+ return win_.is_centered();
}
template <typename D, typename E>
inline
bool dpoints_base_<D,E>::is_empty() const
{
- return this->super_::is_empty();
+ return win_.is_empty();
}
template <typename D, typename E>
inline
unsigned dpoints_base_<D,E>::delta() const
{
- unsigned d = 0;
- const unsigned n = ndpoints();
- for (unsigned i = 0; i < n; ++i)
- {
- unsigned dd = norm::linfty(dp(i).to_vec());
- if (dd > d)
- d = dd;
- }
- return d;
+ return win_.delta();
}
template <typename D, typename E>
@@ -136,7 +151,7 @@
unsigned
dpoints_base_<D,E>::ndpoints() const
{
- return this->super_::nelements();
+ return win_.size();
}
template <typename D, typename E>
@@ -145,7 +160,15 @@
dpoints_base_<D,E>::dp(unsigned i) const
{
mln_precondition(i < ndpoints());
- return this->element(i);
+ return win_.dp(i);
+ }
+
+ template <typename D, typename E>
+ inline
+ const std::vector<D>&
+ dpoints_base_<D,E>::std_vector() const
+ {
+ return win_.std_vector();
}
template <typename D, typename E>
@@ -153,7 +176,7 @@
const std::vector<D>&
dpoints_base_<D,E>::vect() const
{
- return this->super_::vect();
+ return std_vector();
}
template <typename D, typename E>
@@ -161,7 +184,15 @@
bool
dpoints_base_<D,E>::has(const D& dp) const
{
- return this->super_::has(dp);
+ return win_.dps_hook_().has(dp);
+ }
+
+ template <typename D, typename E>
+ inline
+ void
+ dpoints_base_<D,E>::insert(const D& d)
+ {
+ win_.insert(d);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/line_piter.hh
--- mln/core/line_piter.hh (revision 2228)
+++ mln/core/line_piter.hh (working copy)
@@ -60,7 +60,7 @@
*
* \param[in] b A box.
*/
- line_piter_(const box_<P>& b);
+ line_piter_(const box<P>& b);
/// Conversion to point.
operator P() const;
@@ -84,7 +84,7 @@
void next_();
private:
- const box_<P>& b_;
+ const box<P>& b_;
P p_;
bool is_valid_;
};
@@ -97,7 +97,7 @@
template <typename P>
inline
- line_piter_<P>::line_piter_(const box_<P>& b)
+ line_piter_<P>::line_piter_(const box<P>& b)
: b_(b)
{
invalidate();
Index: mln/core/alias/box2d_h.hh
--- mln/core/alias/box2d_h.hh (revision 2228)
+++ mln/core/alias/box2d_h.hh (working copy)
@@ -46,7 +46,7 @@
*
*/
- typedef box_<point2d_h> box2d_h;
+ typedef box<point2d_h> box2d_h;
} // end of namespace mln
Index: mln/core/concept/window.hh
--- mln/core/concept/window.hh (revision 2228)
+++ mln/core/concept/window.hh (working copy)
@@ -30,6 +30,8 @@
/*! \file mln/core/concept/window.hh
* \brief Definition of the concept of mln::Window.
+ *
+ * \todo Operator== should test if the cmp is possible.
*/
# include <mln/core/concept/object.hh>
@@ -76,6 +78,12 @@
};
+ template <typename Wl, typename Wr>
+ bool operator==(const Window<Wl>& lhs, const Window<Wr>& rhs)
+ {
+ return exact(lhs).std_vector() == exact(rhs).std_vector();
+ }
+
# ifndef MLN_INCLUDE_ONLY
Index: mln/core/concept/doc/image.hh
--- mln/core/concept/doc/image.hh (revision 2228)
+++ mln/core/concept/doc/image.hh (working copy)
@@ -121,7 +121,7 @@
*/
typedef void pset;
- /*! \brief Point associated type.
+ /*! \brief Site associated type.
* \invariant This type has to derive from mln::Point.
*/
typedef void point;
@@ -136,7 +136,7 @@
*/
typedef void coord;
- /*! \brief Dpoint associated type.
+ /*! \brief Dpsite associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
@@ -172,7 +172,7 @@
*
* \return A bounding box of the image domain.
*/
- const box_<point>& bbox() const;
+ const box<point>& bbox() const;
/*! \brief Give the number of points of the image domain.
*/
Index: mln/core/concept/doc/weighted_window.hh
--- mln/core/concept/doc/weighted_window.hh (revision 2228)
+++ mln/core/concept/doc/weighted_window.hh (working copy)
@@ -56,10 +56,10 @@
*/
typedef void bkd_qiter;
- /// Point associated type.
+ /// Site associated type.
typedef void point;
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef void dpoint;
/// Weight associated type.
Index: mln/core/concept/doc/dpoint.hh
--- mln/core/concept/doc/dpoint.hh (revision 2228)
+++ mln/core/concept/doc/dpoint.hh (working copy)
@@ -47,12 +47,12 @@
*/
enum { dim };
- /*! \brief Point associated type.
+ /*! \brief Site associated type.
* \invariant This type has to derive from mln::Point.
*/
typedef void point;
- /*! \brief Dpoint associated type.
+ /*! \brief Dpsite associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
Index: mln/core/concept/doc/neighborhood.hh
--- mln/core/concept/doc/neighborhood.hh (revision 2228)
+++ mln/core/concept/doc/neighborhood.hh (working copy)
@@ -57,10 +57,10 @@
*/
typedef void bkd_niter;
- /// Dpoint associated type.
+ /// Dpsite associated type.
typedef void dpoint;
- /// Point associated type.
+ /// Site associated type.
typedef void point;
};
Index: mln/core/concept/doc/point_site.hh
--- mln/core/concept/doc/point_site.hh (revision 2228)
+++ mln/core/concept/doc/point_site.hh (working copy)
@@ -54,12 +54,12 @@
*/
typedef void mesh;
- /*! \brief Point associated type.
+ /*! \brief Site associated type.
* \invariant This type has to derive from mln::Point.
*/
typedef void point;
- /*! \brief Dpoint associated type.
+ /*! \brief Dpsite associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
Index: mln/core/grids.hh
--- mln/core/grids.hh (revision 2228)
+++ mln/core/grids.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -34,6 +34,7 @@
*/
# include <mln/core/concept/regular_grid.hh>
+# include <mln/core/def/coord.hh>
# include <mln/metal/bool.hh>
Index: mln/make/w_window.hh
--- mln/make/w_window.hh (revision 2228)
+++ mln/make/w_window.hh (working copy)
@@ -53,7 +53,7 @@
* \return A weighted window.
*/
template <typename W, typename F>
- mln::w_window<mln_dpoint(W), mln_result(F)>
+ mln::w_window<mln_dpsite(W), mln_result(F)>
w_window(const Window<W>& win, const Function_p2v<F>& wei);
@@ -61,13 +61,13 @@
template <typename W, typename F>
inline
- mln::w_window<mln_dpoint(W), mln_result(F)>
+ mln::w_window<mln_dpsite(W), mln_result(F)>
w_window(const Window<W>& win_, const Function_p2v<F>& wei_)
{
const W& win = exact(win_);
const F& wei = exact(wei_);
mln_precondition(! win.is_empty());
- typedef mln_dpoint(W) D;
+ typedef mln_dpsite(W) D;
typedef mln_point(D) P;
mln::w_window<D, mln_result(F)> w_win;
mln_qiter(W) q(win, P::origin);
Index: mln/convert/to_upper_window.hh
--- mln/convert/to_upper_window.hh (revision 2228)
+++ mln/convert/to_upper_window.hh (working copy)
@@ -46,7 +46,7 @@
/// Convert a window \p nbh into an upper window.
template <typename W>
- window<mln_dpoint(W)> to_upper_window(const Window<W>& win);
+ window<mln_dpsite(W)> to_upper_window(const Window<W>& win);
/// Convert a neighborhood \p nbh into an upper window.
template <typename N>
@@ -66,10 +66,10 @@
depth in milena/core/concepts/README. */
template <typename W>
inline
- window<mln_dpoint(W)> to_upper_window(const Window<W>& win_)
+ window<mln_dpsite(W)> to_upper_window(const Window<W>& win_)
{
const W& input_win = exact(win_);
- typedef mln_dpoint(W) D;
+ typedef mln_dpsite(W) D;
typedef mln_point(D) P;
window<D> win;
mln_qiter(W) q(input_win, P::origin);
Index: mln/convert/to_image.hh
--- mln/convert/to_image.hh (revision 2228)
+++ mln/convert/to_image.hh (working copy)
@@ -31,6 +31,8 @@
/*! \file mln/convert/to_image.hh
*
* \brief Conversions to mln::Image.
+ *
+ * \todo Remove. Use from_to instead...
*/
# include <mln/core/image/image1d.hh>
@@ -150,8 +152,8 @@
const W& win = exact(win_);
mln_precondition(! win.is_empty());
- typedef mln_point(W) P;
- box_<P> b = geom::bbox(win);
+ typedef mln_site(W) P;
+ box<P> b = geom::bbox(win);
mln_image_from(W, bool) ima(b);
level::fill(ima, false);
mln_qiter(W) q(win, P::origin);
@@ -174,8 +176,8 @@
const W& w_win = exact(w_win_);
mln_precondition(! w_win.is_empty());
- typedef mln_point(W) P;
- box_<P> b = geom::bbox(w_win);
+ typedef mln_site(W) P;
+ box<P> b = geom::bbox(w_win);
mln_image_from(W, mln_weight(W)) ima(b);
// Fill the image with zeros, as (weighted) windows are not
// necessarily box-shaped (there might be holes corresponding to
Index: mln/convert/to_std_set.hh
--- mln/convert/to_std_set.hh (revision 2228)
+++ mln/convert/to_std_set.hh (working copy)
@@ -48,19 +48,19 @@
/// Convert a window \p win into a std::set of delta-points.
template <typename W>
- std::set<mln_dpoint(W)> to_std_set(const Window<W>& win);
+ std::set<mln_dpsite(W)> to_std_set(const Window<W>& win);
/// Convert a point set \p pset into a std::set of points.
template <typename W>
- std::set<mln_point(W)> to_std_set(const Site_Set<W>& setp);
+ std::set<mln_site(W)> to_std_set(const Site_Set<W>& setp);
# ifndef MLN_INCLUDE_ONLY
template <typename W>
inline
- std::set<mln_dpoint(W)> to_std_set(const Window<W>& win)
+ std::set<mln_dpsite(W)> to_std_set(const Window<W>& win)
{
- typedef mln_dpoint(W) D;
+ typedef mln_dpsite(W) D;
typedef mln_point(D) P;
std::set<D> s;
mln_qiter(W) q(exact(win), P::origin);
@@ -71,9 +71,9 @@
template <typename W>
inline
- std::set<mln_point(W)> to_std_set(const Site_Set<W>& setp)
+ std::set<mln_site(W)> to_std_set(const Site_Set<W>& setp)
{
- typedef mln_point(W) P;
+ typedef mln_site(W) P;
std::set<P> s;
mln_piter(W) p(exact(setp));
for_all(p)
Index: mln/convert/to_p_set.hh
--- mln/convert/to_p_set.hh (revision 2228)
+++ mln/convert/to_p_set.hh (working copy)
@@ -61,7 +61,7 @@
/// Convert a Window \p win into a point set.
template <typename W>
- p_set<mln_point(W)> to_p_set(const Window<W>& win);
+ p_set<mln_site(W)> to_p_set(const Window<W>& win);
/// Convert an std::set \p s of points into a point set.
template <typename P>
@@ -110,10 +110,10 @@
template <typename W>
inline
- p_set<mln_point(W)> to_p_set(const Window<W>& win)
+ p_set<mln_site(W)> to_p_set(const Window<W>& win)
{
- typedef mln_dpoint(W) D;
- typedef mln_point(W) P;
+ typedef mln_dpsite(W) D;
+ typedef mln_site(W) P;
p_set<P> pset;
mln_qiter(W) q(exact(win), P::origin);
for_all(q)
Index: mln/geom/bbox.hh
--- mln/geom/bbox.hh (revision 2228)
+++ mln/geom/bbox.hh (working copy)
@@ -37,9 +37,15 @@
* "set::nsites(Site_Set)"...
*
* \todo Add a static check "domain is ok for bbox (like grid)".
+ *
+ * \todo Add the weighted_window case.
*/
# include <mln/core/concept/box.hh>
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/window.hh>
+# include <mln/literal/zero.hh>
+# include <mln/accu/bbox.hh>
namespace mln
@@ -58,6 +64,12 @@
box<mln_site(I)> bbox(const Image<I>& ima);
+ /// Compute the precise bounding box of a window \p win.
+ template <typename W>
+ box<mln_site(W)> bbox(const Window<W>& win);
+
+
+
# ifndef MLN_INCLUDE_ONLY
namespace impl
@@ -123,6 +135,17 @@
return geom::bbox(ima.domain());
}
+ template <typename W>
+ box<mln_site(W)> bbox(const Window<W>& win)
+ {
+ typedef mln_site(W) P;
+ accu::bbox<P> b;
+ mln_qiter(W) q(exact(win), literal::origin);
+ for_all(q)
+ b.take(q);
+ return b;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::geom
Index: mln/geom/sym.hh
--- mln/geom/sym.hh (revision 2228)
+++ mln/geom/sym.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -62,7 +62,8 @@
W sym(const Window<W>& win)
{
W tmp = exact(win);
- return tmp.sym();
+ tmp.sym();
+ return tmp;
}
template <typename W>
@@ -70,7 +71,8 @@
W sym(const Weighted_Window<W>& w_win)
{
W tmp = exact(w_win);
- return tmp.sym();
+ tmp.sym();
+ return tmp;
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/geom/shift.hh
--- mln/geom/shift.hh (revision 2228)
+++ mln/geom/shift.hh (working copy)
@@ -46,19 +46,19 @@
/// Shift a window \p win with a delta-point \p dp.
template <typename W>
- window<mln_dpoint(W)>
- shift(const Window<W>& win, const mln_dpoint(W)& dp);
+ window<mln_dpsite(W)>
+ shift(const Window<W>& win, const mln_dpsite(W)& dp);
# ifndef MLN_INCLUDE_ONLY
template <typename W>
inline
- window<mln_dpoint(W)>
- shift(const Window<W>& win, const mln_dpoint(W)& dp)
+ window<mln_dpsite(W)>
+ shift(const Window<W>& win, const mln_dpsite(W)& dp)
{
- typedef mln_point(W) P;
- window<mln_dpoint(W)> tmp;
+ typedef mln_site(W) P;
+ window<mln_dpsite(W)> tmp;
mln_qiter(W) q(win, P::origin);
for_all(q)
tmp.insert(convert::to(q) + dp);
Index: mln/win/vline2d.hh
--- mln/win/vline2d.hh (revision 2228)
+++ mln/win/vline2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -54,7 +54,7 @@
* o \n
* is defined with length = 3.
*/
- typedef line<grid::square, 0, int> vline2d;
+ typedef line<grid::square, 0, def::coord> vline2d;
} // end of namespace mln::win
Index: mln/win/hline2d.hh
--- mln/win/hline2d.hh (revision 2228)
+++ mln/win/hline2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -52,7 +52,7 @@
* o o x o o \n
* is defined with length = 5.
*/
- typedef line<grid::square, 1, int> hline2d;
+ typedef line<grid::square, 1, def::coord> hline2d;
} // end of namespace mln::win
Index: mln/win/cube3d.hh
--- mln/win/cube3d.hh (revision 2228)
+++ mln/win/cube3d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::cube3d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint3d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -64,29 +63,9 @@
* o o o \n
* is defined with length = 3.
*/
- struct cube3d : public Window< cube3d >,
+ struct cube3d : public internal::window_base< dpoint3d, cube3d >,
public internal::dpoints_base_< dpoint3d, cube3d >
{
- /// Point associated type.
- typedef point3d point;
-
- /// Dpoint associated type.
- typedef dpoint3d dpoint;
-
- /*! \brief Site_Iterator type to browse a cube such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpoints_fwd_piter<dpoint3d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a cube such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint3d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus height, of the cube3d.
Index: mln/win/segment1d.hh
--- mln/win/segment1d.hh (revision 2228)
+++ mln/win/segment1d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -52,7 +52,7 @@
* o x o \n
* is defined with length = 3.
*/
- typedef line<grid::tick, 0, int> segment1d;
+ typedef line<grid::tick, 0, def::coord> segment1d;
} // end of namespace mln::win
Index: mln/win/line.hh
--- mln/win/line.hh (revision 2228)
+++ mln/win/line.hh (working copy)
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::line window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/dpoint.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -57,27 +56,9 @@
* \see mln::win::hline2d for an exemple of his use.
*/
template <typename M, unsigned i, typename C>
- struct line : public Window< line<M,i,C> >,
- public internal::dpoints_base_<dpoint<M, C>, point<M, C> >
+ struct line : public internal::window_base< dpoint<M, C>, line<M,i,C> >,
+ public internal::dpoints_base_< dpoint<M, C>, line<M,i,C> >
{
- /// Point associated type.
- typedef point<M, int> point;
-
- /// Psite associated type.
- typedef point psite;
-
- /// Dpoint associated type.
- typedef dpoint<M, int> dpoint;
-
- /// Site_Iterator type to browse a line forward
- typedef dpoints_fwd_piter<dpoint> fwd_qiter;
-
- /// Site_Iterator type to browse a line backward
- typedef dpoints_bkd_piter<dpoint> bkd_qiter;
-
- /// Same as fwd_qiter
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length of the line.
@@ -140,11 +121,11 @@
{
metal::bool_< i < M::dim >::check();
mln_precondition(length % 2 == 1);
+ dpoint<M,C> n;
+ n.set_all(0);
const int dc = length / 2;
for (int c = - dc; c <= dc; ++c)
{
- dpoint n;
- n.set_all(0);
n[i] = c;
this->insert(n);
}
Index: mln/win/rectangle2d.hh
--- mln/win/rectangle2d.hh (revision 2228)
+++ mln/win/rectangle2d.hh (working copy)
@@ -35,7 +35,9 @@
* \todo Reactivate includes at EOF.
*/
-# include <mln/core/alias/window2d.hh>
+# include <mln/core/internal/window_base.hh>
+# include <mln/core/internal/dpoints_base.hh>
+# include <mln/core/alias/dpoint2d.hh>
namespace mln
@@ -55,22 +57,9 @@
* o o o o o \n
* is defined with height = 3 and width = 5.
*/
- struct rectangle2d : public internal::window_base< dpoint2d, rectangle2d >
+ struct rectangle2d : public internal::window_base< dpoint2d, rectangle2d >,
+ public internal::dpoints_base_< dpoint2d, rectangle2d >
{
-
- /*! \brief Site_Iterator type to browse a rectangle such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpsites_fwd_piter<rectangle2d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a rectangle such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpsites_fwd_piter<rectangle2d> bkd_qiter;
-
- typedef fwd_qiter qiter;
-
-
/*! \brief Constructor.
*
* \param[in] height Height of the rectangle2d.
@@ -117,7 +106,6 @@
protected:
unsigned height_, width_;
- window2d win_;
};
@@ -146,7 +134,7 @@
const int drow = height / 2, dcol = width / 2;
for (int row = - drow; row <= drow; ++row)
for (int col = - dcol; col <= dcol; ++col)
- win_.insert(row, col);
+ this->insert(dpoint2d(row, col));
}
inline
@@ -215,8 +203,8 @@
// When rectangle2d is involved, one surely also wants:
-// # include <mln/win/hline2d.hh>
-// # include <mln/win/vline2d.hh>
+# include <mln/win/hline2d.hh>
+# include <mln/win/vline2d.hh>
#endif // ! MLN_WIN_RECTANGLE2D_HH
Index: mln/win/diag2d.hh
--- mln/win/diag2d.hh (revision 2228)
+++ mln/win/diag2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::diag2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -58,29 +57,9 @@
* o \n
* is defined with length = 5.
*/
- struct diag2d : public Window< diag2d >,
+ struct diag2d : public internal::window_base< dpoint2d, diag2d >,
public internal::dpoints_base_< dpoint2d, diag2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus width, of the diagonal line.
Index: mln/win/backdiag2d.hh
--- mln/win/backdiag2d.hh (revision 2228)
+++ mln/win/backdiag2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::backdiag2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -58,29 +57,9 @@
* o \n
* is defined with length = 5.
*/
- struct backdiag2d : public Window< backdiag2d >,
+ struct backdiag2d : public internal::window_base< dpoint2d, backdiag2d >,
public internal::dpoints_base_< dpoint2d, backdiag2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus width, of the diagonal line.
Index: mln/win/cuboid3d.hh
--- mln/win/cuboid3d.hh (revision 2228)
+++ mln/win/cuboid3d.hh (working copy)
@@ -31,10 +31,9 @@
/// \file mln/win/cuboid3d.hh
/// \brief Definition of the mln::win::cuboid3d window.
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint3d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -74,29 +73,9 @@
Reference:
http://en.wikipedia.org/wiki/Cuboid
*/
- struct cuboid3d : public Window< cuboid3d >,
+ struct cuboid3d : public internal::window_base< dpoint3d, cuboid3d >,
public internal::dpoints_base_< dpoint3d, cuboid3d >
{
- /// Point Site associated type.
- typedef point3d psite;
-
- /// Point associated type.
- typedef point3d point;
-
- /// Dpoint associated type.
- typedef dpoint3d dpoint;
-
- /// \brief Site_Iterator type to browse a cuboid such as: "for
- /// each slice (increasing), for each row (increasing), for each
- /// column (increasing)."
- typedef dpoints_fwd_piter<dpoint3d> fwd_qiter;
-
- /// \brief Site_Iterator type to browse a cuboid such as: "for
- /// each slice (decreasing), for each row (decreasing), for each
- /// column (decreasing)."
- typedef dpoints_bkd_piter<dpoint3d> bkd_qiter;
-
-
/// \brief Constructor.
///
/// \param[in] depth The depth of the cuboid3d.
Index: mln/win/octagon2d.hh
--- mln/win/octagon2d.hh (revision 2228)
+++ mln/win/octagon2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::octagon2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -62,29 +61,9 @@
* o o o \n
* is defined with L = 7 (l = 1).
*/
- struct octagon2d : public Window< octagon2d >,
+ struct octagon2d : public internal::window_base< dpoint2d, octagon2d >,
public internal::dpoints_base_< dpoint2d, octagon2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, of the octagon.
Index: mln/win/disk2d.hh
--- mln/win/disk2d.hh (revision 2228)
+++ mln/win/disk2d.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,10 +33,9 @@
* \brief Definition of the mln::win::disk2d window.
*/
-# include <mln/core/concept/window.hh>
+# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/dpoints_base.hh>
# include <mln/core/alias/dpoint2d.hh>
-# include <mln/core/dpoints_piter.hh>
namespace mln
@@ -50,29 +49,9 @@
* An disk2d is centered and symmetric.
*
*/
- struct disk2d : public Window< disk2d >,
+ struct disk2d : public internal::window_base< dpoint2d, disk2d >,
public internal::dpoints_base_< dpoint2d, disk2d >
{
- /// Point associated type.
- typedef point2d point;
-
- /// Dpoint associated type.
- typedef dpoint2d dpoint;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (increasing), for each column (increasing)."
- */
- typedef dpoints_fwd_piter<dpoint2d> fwd_qiter;
-
- /*! \brief Site_Iterator type to browse a hline such as: "for each row
- * (decreasing), for each column (decreasing)."
- */
- typedef dpoints_bkd_piter<dpoint2d> bkd_qiter;
-
- /*! \brief Same as fwd_qiter.
- */
- typedef fwd_qiter qiter;
-
/*! \brief Constructor.
*
* \param[in] length Length, thus diameter.
1
0
12 Sep '08
#65: Review the trunk/milena/mln/win directory.
----------------------+-----------------------------------------------------
Reporter: nivault | Owner: Olena Team
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
----------------------+-----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/65#comment:3>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#55: Review the trunk/milena/mln/trait directory.
----------------------+-----------------------------------------------------
Reporter: theo | Owner: theo
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
----------------------+-----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/55#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#77: Review the trunk/milena/mln/trace directory
-----------------------+----------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
-----------------------+----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/77#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#76: Review the trunk/milena/mln/test directory
-----------------------+----------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
-----------------------+----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/76#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#54: Review the trunk/milena/mln/tag directory.
----------------------+-----------------------------------------------------
Reporter: theo | Owner: theo
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
----------------------+-----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/54#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
12 Sep '08
#66: Review the trunk/milena/mln/set directory.
----------------------+-----------------------------------------------------
Reporter: nivault | Owner: Olena Team
Type: task | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: wontfix | Keywords:
----------------------+-----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => wontfix
Comment:
Closing, as the merging from source:trunk/cleanup-2008/ into source:trunk/
will require a new reviewing effort.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/66#comment:2>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0