https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Use delegations explicitly in the t_image and tr_image morphers.
* mln/core/tr_image.hh (tr_image<T,I>::has_data)
(mln::tr_image<T,I>::owns_, tr_image<T,I>::has)
(mln::tr_image<T,I>::operator()): Simplify using this->delegatee_().
* mln/core/t_image.hh (mln::t_image<I>::operator()): Likewise.
* tests/tr_image.cc: Move...
* tests/core/tr_image.cc: ...here.
* tests/Makefile.am (check_PROGRAMS): Remove tr_image.
(tr_image_SOURCES): Move...
* tests/core/Makefile.am: ...here.
(check_PROGRAMS): Add tr_image.
mln/core/t_image.hh | 4 ++--
mln/core/tr_image.hh | 10 +++++-----
tests/Makefile.am | 2 --
tests/core/Makefile.am | 2 ++
4 files changed, 9 insertions(+), 9 deletions(-)
Index: mln/core/tr_image.hh
--- mln/core/tr_image.hh (revision 1688)
+++ mln/core/tr_image.hh (working copy)
@@ -167,7 +167,7 @@
inline
bool tr_image<T,I>::has_data() const
{
- mln_invariant(this->data_->ima_.has_data());
+ mln_invariant(this->delegatee_()->has_data());
return true;
}
@@ -179,7 +179,7 @@
metal::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v2[i]));
- return this->data_->ima_.owns_(p);
+ return this->delegatee_().owns_(p);
}
template <typename T, typename I>
@@ -190,7 +190,7 @@
metal::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v2[i]));
- return this->data_->ima_.domain().has(p);
+ return this->delegatee_()->domain().has(p);
}
template <typename T, typename I>
@@ -202,8 +202,8 @@
metal::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v2[i]));
- mln_assertion(this->data_->ima_.owns_(p));
- return this->data_->ima_(p);
+ mln_assertion(this->delegatee_()->owns_(p));
+ return (*this->delegatee_())(p);
}
template <typename T, typename I>
Index: mln/core/t_image.hh
--- mln/core/t_image.hh (revision 1688)
+++ mln/core/t_image.hh (working copy)
@@ -252,7 +252,7 @@
t_image<I>::operator()(const mln_point(I)& p) const
{
mln_precondition(this->owns_(p));
- return this->data_->ima_(transpose_(p));
+ return (*this->delegatee_())(transpose_(p));
}
template <typename I>
@@ -261,7 +261,7 @@
t_image<I>::operator()(const mln_point(I)& p)
{
mln_precondition(this->owns_(p));
- return this->data_->ima_(transpose_(p));
+ return (*this->delegatee_())(transpose_(p));
}
template <typename I>
Index: tests/Makefile.am
--- tests/Makefile.am (revision 1688)
+++ tests/Makefile.am (working copy)
@@ -101,7 +101,6 @@
sub_image \
\
test_positive \
- tr_image \
trait_ch_value \
trait_images \
trait_op_plus \
@@ -194,7 +193,6 @@
sub_image_SOURCES = sub_image.cc
test_positive_SOURCES = test_positive.cc
-tr_image_SOURCES = tr_image.cc
trait_ch_value_SOURCES = trait_ch_value.cc
trait_images_SOURCES = trait_images.cc
trait_op_plus_SOURCES = trait_op_plus.cc
Index: tests/core/Makefile.am
--- tests/core/Makefile.am (revision 1688)
+++ tests/core/Makefile.am (working copy)
@@ -17,6 +17,7 @@
rle_image \
sparse_image \
t_image \
+ tr_image \
p_priority_queue \
p_priority_queue_fast \
p_priority_queue_fast_with_array \
@@ -37,6 +38,7 @@
rle_image_SOURCES = rle_image.cc
sparse_image_SOURCES = sparse_image.cc
t_image_SOURCES = t_image.cc
+tr_image_SOURCES = tr_image.cc
p_priority_queue_SOURCES = p_priority_queue.cc
p_priority_queue_fast_SOURCES = p_priority_queue_fast.cc
p_priority_queue_fast_with_array_SOURCES = p_priority_queue_fast.cc