Commit a2bb25e2 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Get rid of owns_.

	* tests/border/resize_sub_image.cc,
	* tests/border/get.cc,
	* tests/border/resize_image_if.cc,
	* tests/fun/x2x/rotation.cc,
	* mln/core/translate_image.hh,
	* mln/core/internal/image_if_base.hh,
	* mln/core/internal/image_identity.hh,
	* mln/core/internal/image_value_morpher.hh,
	* mln/core/internal/check/image_fastest.hh,
	* mln/core/interpolated.hh,
	* mln/core/cast_image.hh,
	* mln/core/pixel.hh,
	* mln/core/t_image.hh,
	* mln/core/image1d.hh,
	* mln/core/fi_adaptor.hh,
	* mln/core/image3d.hh,
	* mln/core/hexa.hh,
	* mln/core/tr_image.hh,
	* mln/core/safe.hh,
	* mln/core/concept/doc/image.hh,
	* mln/level/memset_.hh,
	* mln/value/stack.hh,
	* mln/pw/image.hh,
	* mln/pw/value.hh,
	* sandbox/duhamel/translate_image.hh,
	* sandbox/nivault/rotation.cc,
	* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
	* sandbox/jardonnet/subsampling/sub_sampled_image.hh,
	* sandbox/geraud/cs2d/cs2d_morpho.hh,
	* sandbox/garrigues/level_set.hh,
	* sandbox/garrigues/fllt/compute_level_set_fast2.hh,
	* sandbox/garrigues/fllt/compute_level_set_fast.hh,
	* sandbox/garrigues/fllt/compute_level_set.hh,
	* sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
	* sandbox/garrigues/image_identity/image_value_morpher.hh,
	* sandbox/garrigues/image_identity/interpolated.hh,
	* sandbox/ballas/refactorization/p_run.hh,
	* sandbox/ballas/refactorization/rle_image.hh,
	* sandbox/ballas/refactorization/image2d.hh,
	* sandbox/ballas/refactorization/concept.hh,
	* sandbox/ballas/refactorization/rle_pset.hh,
	* sandbox/ballas/refactorization/internal/pset_base.hh,
	* sandbox/ballas/refactorization/internal/image_base.hh,
	* sandbox/ballas/refactorization/box2d.hh (owns_): Rename as...
	(has): ...this.
	* mln/trait/image/status.txt (image2d): Set OK.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008@2012 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent f05d32b8
2008-06-11 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Get rid of owns_.
* tests/border/resize_sub_image.cc,
* tests/border/get.cc,
* tests/border/resize_image_if.cc,
* tests/fun/x2x/rotation.cc,
* mln/core/translate_image.hh,
* mln/core/internal/image_if_base.hh,
* mln/core/internal/image_identity.hh,
* mln/core/internal/image_value_morpher.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/interpolated.hh,
* mln/core/cast_image.hh,
* mln/core/pixel.hh,
* mln/core/t_image.hh,
* mln/core/image1d.hh,
* mln/core/fi_adaptor.hh,
* mln/core/image3d.hh,
* mln/core/hexa.hh,
* mln/core/tr_image.hh,
* mln/core/safe.hh,
* mln/core/concept/doc/image.hh,
* mln/level/memset_.hh,
* mln/value/stack.hh,
* mln/pw/image.hh,
* mln/pw/value.hh,
* sandbox/duhamel/translate_image.hh,
* sandbox/nivault/rotation.cc,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/jardonnet/subsampling/sub_sampled_image.hh,
* sandbox/geraud/cs2d/cs2d_morpho.hh,
* sandbox/garrigues/level_set.hh,
* sandbox/garrigues/fllt/compute_level_set_fast2.hh,
* sandbox/garrigues/fllt/compute_level_set_fast.hh,
* sandbox/garrigues/fllt/compute_level_set.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
* sandbox/garrigues/image_identity/image_value_morpher.hh,
* sandbox/garrigues/image_identity/interpolated.hh,
* sandbox/ballas/refactorization/p_run.hh,
* sandbox/ballas/refactorization/rle_image.hh,
* sandbox/ballas/refactorization/image2d.hh,
* sandbox/ballas/refactorization/concept.hh,
* sandbox/ballas/refactorization/rle_pset.hh,
* sandbox/ballas/refactorization/internal/pset_base.hh,
* sandbox/ballas/refactorization/internal/image_base.hh,
* sandbox/ballas/refactorization/box2d.hh (owns_): Rename as...
(has): ...this.
* mln/trait/image/status.txt (image2d): Set OK.
2008-06-11 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Update image2d with new image properties.
......
......@@ -159,7 +159,7 @@ namespace mln
T
cast_image_<T,I>::operator()(const mln_psite(I)& p) const
{
mln_precondition(this->data_->ima_.owns_(p));
mln_precondition(this->data_->ima_.has(p));
return mln::value::cast<T>( this->data_->ima_(p) );
}
......
......@@ -80,7 +80,7 @@ namespace mln
* \return True if accessing the image value at \p p is
* possible, that is, does not abort the execution.
*/
bool owns_(const psite& p) const;
bool has(const psite& p) const;
/*! \brief Give the definition domain of the image.
*
......@@ -159,7 +159,7 @@ namespace mln
*
* \return True if \p p belongs to the image domain.
*
* \invariant has(p) is true => owns_(p) is also true.
* \invariant has(p) is true => has(p) is also true.
*/
bool has(const psite& p) const;
......
......@@ -326,7 +326,7 @@ namespace mln
const mln_value(I)&
fi_adaptor<I>::operator()(const point2d& p) const
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
// Because Freeimage stores lena upside down.
return this->data_->array_[this->domain().len(0) - 1 - p.row()][p.col()];
......@@ -336,7 +336,7 @@ namespace mln
mln_value(I)&
fi_adaptor<I>::operator()(const point2d& p)
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
// Because Freeimage stores lena upside down.
return this->data_->array_[this->domain().len(0) - 1 - p.row()][p.col()];
......@@ -362,7 +362,7 @@ namespace mln
const mln_value(I)&
fi_adaptor<I>::at(int row, int col) const
{
mln_precondition(this->owns_(make::point2d(row, col)));
mln_precondition(this->has(make::point2d(row, col)));
// Because Freeimage stores lena upside down.
return this->data_->array_[this->domain().len(0) - 1 - row][col];
......@@ -372,7 +372,7 @@ namespace mln
mln_value(I)&
fi_adaptor<I>::at(int row, int col)
{
mln_precondition(this->owns_(make::point2d(row, col)));
mln_precondition(this->has(make::point2d(row, col)));
// Because Freeimage stores lena upside down.
return this->data_->array_[this->domain().len(0) - 1 - row][col];
......
......@@ -156,7 +156,7 @@ namespace mln
/// Test if \p p belongs to the image domain.
bool has(const psite& p) const;
bool owns_(const psite& p) const;
bool has(const psite& p) const;
/// Read-only access of pixel value at hexa point site \p p.
rvalue operator()(const point2d_h& p) const;
......@@ -269,7 +269,7 @@ namespace mln
template <typename I>
inline
bool
hexa<I>::owns_(const psite& p) const
hexa<I>::has(const psite& p) const
{
return this->has(p);
}
......
......@@ -159,7 +159,7 @@ namespace mln
/// Test if \p p is valid.
bool owns_(const point1d& p) const;
bool has(const point1d& p) const;
/// Give the set of values of the image.
const vset& values() const;
......@@ -389,7 +389,7 @@ namespace mln
template <typename T>
inline
bool
image1d<T>::owns_(const point1d& p) const
image1d<T>::has(const point1d& p) const
{
mln_precondition(this->has_data());
return this->data_->vb_.has(p);
......@@ -400,7 +400,7 @@ namespace mln
const T&
image1d<T>::operator()(const point1d& p) const
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
return this->data_->array_[p.ind()];
}
......@@ -409,7 +409,7 @@ namespace mln
T&
image1d<T>::operator()(const point1d& p)
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
return this->data_->array_[p.ind()];
}
......@@ -436,7 +436,7 @@ namespace mln
const T&
image1d<T>::at(int ind) const
{
mln_precondition(this->owns_(make::point1d(ind)));
mln_precondition(this->has(make::point1d(ind)));
return this->data_->array_[ind];
}
......@@ -445,7 +445,7 @@ namespace mln
T&
image1d<T>::at(int ind)
{
mln_precondition(this->owns_(make::point1d(ind)));
mln_precondition(this->has(make::point1d(ind)));
return this->data_->array_[ind];
}
......
......@@ -164,7 +164,7 @@ namespace mln
/// Test if \p p is valid.
bool owns_(const point3d& p) const;
bool has(const point3d& p) const;
/// Give the set of values of the image.
const vset& values() const;
......@@ -427,7 +427,7 @@ namespace mln
template <typename T>
inline
bool
image3d<T>::owns_(const point3d& p) const
image3d<T>::has(const point3d& p) const
{
mln_precondition(this->has_data());
return data_->vb_.has(p);
......@@ -438,7 +438,7 @@ namespace mln
const T&
image3d<T>::operator()(const point3d& p) const
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
return data_->array_[p.sli()][p.row()][p.col()];
}
......@@ -447,7 +447,7 @@ namespace mln
T&
image3d<T>::operator()(const point3d& p)
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
return data_->array_[p.sli()][p.row()][p.col()];
}
......@@ -474,7 +474,7 @@ namespace mln
const T&
image3d<T>::at(int sli, int row, int col) const
{
mln_precondition(this->owns_(make::point3d(sli, row, col)));
mln_precondition(this->has(make::point3d(sli, row, col)));
return data_->array_[sli][row][col];
}
......@@ -483,7 +483,7 @@ namespace mln
T&
image3d<T>::at(int sli, int row, int col)
{
mln_precondition(this->owns_(make::point3d(sli, row, col)));
mln_precondition(this->has(make::point3d(sli, row, col)));
return data_->array_[sli][row][col];
}
......
......@@ -128,7 +128,7 @@ namespace mln
{
const E* this_ = & internal::force_exact<E>(*this);
mln_precondition(this_->has_data());
mln_precondition(this_->owns_(p));
mln_precondition(this_->has(p));
unsigned o = & this_->operator()(p) - this_->buffer();
mln_postcondition(p == this_->point_at_offset(o));
......
......@@ -76,7 +76,7 @@ namespace mln
// FIXME Matthieu: Doc! Cf. core/concept/doc/image
const mln_pset(I)& domain() const;
bool owns_(const mln_psite(I)& p) const;
bool has(const mln_psite(I)& p) const;
protected:
......@@ -132,10 +132,10 @@ namespace mln
template <typename I, typename S, typename E>
inline
bool
image_identity_<I,S,E>::owns_(const mln_psite(I)& p) const
image_identity_<I,S,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->owns_(p);
return this->delegatee_()->has(p);
}
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -109,7 +109,7 @@ namespace mln
/// Test if the image owns the point site \p p.
/// The result is the same than over the underlying image.
bool owns_(const mln_psite(I)& p) const; // Overload the def "owns_ -> has".
bool has(const mln_psite(I)& p) const;
protected:
......@@ -169,10 +169,10 @@ namespace mln
template <typename I, typename F, typename E>
inline
bool
image_if_base_<I,F,E>::owns_(const mln_psite(I)& p) const
image_if_base_<I,F,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->has_data());
return this->data_->ima_.owns_(p);
return this->data_->ima_.has(p);
}
template <typename I, typename F, typename E>
......
......@@ -56,7 +56,7 @@ namespace mln
public:
const mln_pset(I)& domain() const;
bool owns_(const mln_psite(I)& p) const;
bool has(const mln_psite(I)& p) const;
protected:
image_value_morpher_();
......@@ -83,10 +83,10 @@ namespace mln
template <typename I, typename E>
inline
bool
image_value_morpher_<I,E>::owns_(const mln_psite(I)& p) const
image_value_morpher_<I,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->owns_(p);
return this->delegatee_()->has(p);
}
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -98,10 +98,10 @@ namespace mln
bool has_data() const;
/// Test if a pixel value is accessible at \p p.
using super_::owns_;
using super_::has;
/// Test if a pixel value is accessible at \p v.
bool owns_(const mln::algebra::vec<I::point::dim, float>& v) const;
bool has(const mln::algebra::vec<I::point::dim, float>& v) const;
/// Read-only access of pixel value at point site \p p.
/// Mutable access is only OK for reading (not writing).
......@@ -156,12 +156,12 @@ namespace mln
template <typename I>
inline
bool interpolated<I>::owns_(const mln::algebra::vec<I::point::dim, float>& v) const
bool interpolated<I>::has(const mln::algebra::vec<I::point::dim, float>& v) const
{
mln_point(I) p;
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v[i]));
return this->data_->ima_.owns_(p);
return this->data_->ima_.has(p);
}
template <typename I>
......@@ -172,7 +172,7 @@ namespace mln
mln_point(I) p;
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v[i]));
mln_assertion(this->data_->ima_.owns_(p));
mln_assertion(this->data_->ima_.has(p));
return this->data_->ima_(p);
}
......
......@@ -81,7 +81,7 @@ namespace mln
pixel<I>::pixel(I& image, const mln_point(I)& p)
: super(image)
{
mln_precondition(this->image_.owns_(p));
mln_precondition(this->image_.has(p));
change_to(p);
}
......@@ -90,7 +90,7 @@ namespace mln
void
pixel<I>::change_to(const mln_point(I)& p)
{
mln_precondition(this->image_.owns_(p));
mln_precondition(this->image_.has(p));
this->value_ptr_ = & this->image_(p);
}
......@@ -103,7 +103,7 @@ namespace mln
return false;
int o = this->value_ptr_ - this->image_.buffer();
mln_point(I) p = this->image_.point_at_offset(o);
return this->image_.owns_(p);
return this->image_.has(p);
}
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -135,7 +135,7 @@ namespace mln
mln_rvalue(I)
safe_image<I>::operator()(const mln_psite(I)& p) const
{
if (! this->owns_(p))
if (! this->has(p))
return this->data_->default_value_;
return this->data_->ima_(p);
}
......@@ -146,7 +146,7 @@ namespace mln
safe_image<I>::operator()(const mln_psite(I)& p)
{
static mln_value(I) forget_it_;
if (! this->owns_(p))
if (! this->has(p))
// so data_->default_value_ is returned but cannot be modified
return forget_it_ = this->data_->default_value_;
return this->data_->ima_(p);
......
......@@ -127,7 +127,7 @@ namespace mln
bool has_data() const;
/// Test if a pixel value is accessible at \p p.
bool owns_(const mln_point(I)& p) const;
bool has(const mln_point(I)& p) const;
/// Give the definition domain.
const box_<mln_point(I)>& domain() const;
......@@ -210,10 +210,10 @@ namespace mln
template <typename I>
inline
bool
t_image<I>::owns_(const mln_point(I)& p) const
t_image<I>::has(const mln_point(I)& p) const
{
mln_precondition(this->has_data());
return this->delegatee_()->owns_(transpose_(p));
return this->delegatee_()->has(transpose_(p));
}
template <typename I>
......@@ -251,7 +251,7 @@ namespace mln
mln_rvalue(I)
t_image<I>::operator()(const mln_point(I)& p) const
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
return (*this->delegatee_())(transpose_(p));
}
......@@ -260,7 +260,7 @@ namespace mln
typename internal::morpher_lvalue_<I>::ret
t_image<I>::operator()(const mln_point(I)& p)
{
mln_precondition(this->owns_(p));
mln_precondition(this->has(p));
return (*this->delegatee_())(transpose_(p));
}
......
......@@ -111,10 +111,10 @@ namespace mln
bool has_data() const;
/// Test if a pixel value is accessible at \p p.
using super_::owns_;
using super_::has;
/// Test if a pixel value is accessible at \p v.
bool owns_(const mln::algebra::vec<I::point::dim, float>& v) const;
bool has(const mln::algebra::vec<I::point::dim, float>& v) const;
using super_::has;
......@@ -173,13 +173,13 @@ namespace mln
template <typename T, typename I>
inline
bool tr_image<T,I>::owns_(const algebra::vec<I::point::dim, float>& v) const
bool tr_image<T,I>::has(const algebra::vec<I::point::dim, float>& v) const
{
mln_point(I) p;
algebra::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->delegatee_().owns_(p);
return this->delegatee_().has(p);
}
template <typename T, typename I>
......@@ -202,7 +202,7 @@ namespace mln
algebra::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->delegatee_()->owns_(p));
mln_assertion(this->delegatee_()->has(p));
return (*this->delegatee_())(p);
}
......
......@@ -121,7 +121,7 @@ namespace mln
const box2d& domain() const;
/// Test if a pixel value is accessible at \p p.
bool owns_(const mln_psite(I)& ) const;
bool has(const mln_psite(I)& ) const;
/// Read-only access of pixel value at point site \p p.
mln_rvalue(I) operator()(const mln_psite(I)& p) const;
......@@ -173,10 +173,10 @@ namespace mln
template <typename I>
inline
bool translate_image<I>::owns_(const mln_psite(I)& p) const
bool translate_image<I>::has(const mln_psite(I)& p) const
{
mln_point(I) np = p - this->data_->dp_;
return this->data_->ima_.owns_(np);
return this->data_->ima_.has(np);
}
template <typename I>
......@@ -184,7 +184,7 @@ namespace mln
mln_rvalue(I)
translate_image<I>::operator()(const mln_psite(I)& p) const
{
mln_assertion(this->owns_(p));
mln_assertion(this->has(p));
mln_point(I) np = p - this->data_->dp_;
return this->data_->ima_(np);
}
......@@ -195,7 +195,7 @@ namespace mln
typename translate_image<I>::lvalue
translate_image<I>::operator()(const mln_psite(I)& p)
{
mln_assertion(this->owns_(p));
mln_assertion(this->has(p));
mln_point(I) np = p - this->data_->dp_;
return this->data_->ima_(np);
}
......
......@@ -147,7 +147,7 @@ namespace mln
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
mln_precondition(input.has_data());
mln_precondition(input.owns_(p));
mln_precondition(input.has(p));
mln_precondition(input.offset_at(p) + n <= input.ncells());
pixel<I> pix(input, p);
......
......@@ -132,7 +132,7 @@ namespace mln
/// Test if a pixel value is accessible at \p p.
bool owns_(const mln_psite(S)& p) const;
bool has(const mln_psite(S)& p) const;
/// Give the definition domain.
const S& domain() const;
......@@ -199,7 +199,7 @@ namespace mln
template <typename F, typename S>
inline
bool image<F,S>::owns_(const mln_psite(S)& p) const
bool image<F,S>::has(const mln_psite(S)& p) const
{
return this->data_->pset_.has(p);
}
......
......@@ -93,7 +93,7 @@ namespace mln
value_<I>::operator()(const mln_psite(I)& p) const
{
mln_precondition(ima_ != 0);
mln_precondition(ima_->owns_(p));
mln_precondition(ima_->has(p));
return (*ima_)(p);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment