Commit 97cc9f5a authored by Nicolas Ballas's avatar Nicolas Ballas
Browse files

Add the values_space method to image base.

	* tests/core/image/flat_image.cc: update test
	* mln/core/image/cast_image.hh,
	* mln/core/image/decorated_image.hh,
	* mln/core/image/obased_rle_image.hh,
	* mln/core/image/value_enc_image.hh,
	* mln/core/image/graph_image.hh,
	* mln/core/image/line_graph_image.hh,
	* mln/core/image/rle_image.hh,
	* mln/core/image/tr_image.hh,
	* mln/core/image/flat_image.hh,
	* mln/core/image/mono_obased_rle_image.hh,
	* mln/core/image/interpolated.hh,
	* mln/core/image/sparse_image.hh,
	* mln/core/image/bgraph_image.hh,
	* mln/core/image/t_image.hh,
	* mln/core/image/image1d.hh,
	* mln/core/image/image2d.hh,
	* mln/core/image/fi_adaptor.hh,
	* mln/core/image/image3d.hh,
	* mln/core/image/complex_image.hh,
	* mln/core/image/mono_rle_image.hh: delete the values method.
	* mln/core/macros.hh: update (mln_vset returns now t_eligible_values).
	* mln/core/internal/image_base.hh: add the values_space method.
	* mln/core/internal/image_identity.hh,
	* mln/core/internal/image_domain_morpher.hh: update.
	* mln/core/internal/image_value_morpher.hh: fix compile bug.
	* mln/core/concept/image.hh: add interface check.
	* mln/value/super_value.hh: New trait that return the super value type.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008@2196 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent b9cd9fc0
2008-09-08 Nicolas Ballas <ballas@lrde.epita.fr>
Add the values_space method to image base.
* tests/core/image/flat_image.cc: update test
* mln/core/image/cast_image.hh,
* mln/core/image/decorated_image.hh,
* mln/core/image/obased_rle_image.hh,
* mln/core/image/value_enc_image.hh,
* mln/core/image/graph_image.hh,
* mln/core/image/line_graph_image.hh,
* mln/core/image/rle_image.hh,
* mln/core/image/tr_image.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/mono_obased_rle_image.hh,
* mln/core/image/interpolated.hh,
* mln/core/image/sparse_image.hh,
* mln/core/image/bgraph_image.hh,
* mln/core/image/t_image.hh,
* mln/core/image/image1d.hh,
* mln/core/image/image2d.hh,
* mln/core/image/fi_adaptor.hh,
* mln/core/image/image3d.hh,
* mln/core/image/complex_image.hh,
* mln/core/image/mono_rle_image.hh: delete the values method.
* mln/core/macros.hh: update (mln_vset returns now t_eligible_values).
* mln/core/internal/image_base.hh: add the values_space method.
* mln/core/internal/image_identity.hh,
* mln/core/internal/image_domain_morpher.hh: update.
* mln/core/internal/image_value_morpher.hh: fix compile bug.
* mln/core/concept/image.hh: add interface check.
* mln/value/super_value.hh: New trait that return the super value type.
2008-09-08 Thierry Geraud <thierry.geraud@lrde.epita.fr>
 
Add the sub_image_if image type.
......
......@@ -162,11 +162,14 @@ namespace mln
typedef mln_value(E) value;
typedef mln_rvalue(E) rvalue;
typedef mln_lvalue(E) lvalue;
typedef typename E::t_eligible_value_set t_eligible_value_set;
typedef typename E::t_eligible_values_set t_eligible_values_set;
typedef typename E::t_values_space t_values_space;
typedef mln_vset(E) vset;
const vset& (E::*m5)() const = & E::values;
m5 = 0;
// FIXME Doc
//typedef mln_vset(E) vset;
//const vset& (E::*m5)() const = & E::values;
//m5 = 0;
rvalue (E::*m6)(const psite& p) const = & E::operator();
m6 = 0;
......@@ -176,9 +179,12 @@ namespace mln
const pset& (E::*m8)() const = & E::domain;
m8 = 0;
const t_eligible_value_set& (E::*m9)() const = & E::values_eligible;
const t_eligible_values_set& (E::*m9)() const = & E::values_eligible;
m9 = 0;
const t_values_space& (E::*m10)() const = & E::values_space;
m10 = 0;
typedef typename E::skeleton skeleton;
/// Optional interface:
......
......@@ -114,10 +114,6 @@ namespace mln
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
/// Value set associated type.
typedef mln::value::set<value> vset;
/// Skeleton.
typedef bgraph_image< tag::psite_<P>, tag::value_<V> > skeleton;
......@@ -141,8 +137,6 @@ namespace mln
/// \{
/// Return the domain of psites od the image.
const p_bgraph<P>& domain() const;
/// Return the domain of values of the image.
const vset& values() const;
/// Return the array of values associated to the nodes.
const std::vector<V>& node_values() const;
......@@ -251,14 +245,6 @@ namespace mln
return this->data_->val_[p.id()];
}
template <typename P, typename V>
inline
const mln::value::set<V> &
bgraph_image<P, V>::values() const
{
return vset::the();
}
template <typename P, typename V>
inline
const std::vector<V>&
......
......@@ -92,10 +92,6 @@ namespace mln
/// Return type of read-write access.
typedef T lvalue;
/// Value set associated type.
typedef mln::value::set<T> vset;
/// Skeleton.
typedef cast_image_< tag::value_<T>, tag::image_<I> > skeleton;
......@@ -109,9 +105,6 @@ namespace mln
/// Mutable access is only OK for reading (not writing).
T operator()(const mln_psite(I)& p);
/// Give the set of values of the image.
const vset& values() const;
};
......@@ -172,14 +165,6 @@ namespace mln
return mln::value::cast<T>( this->data_->ima_(p) );
}
template <typename T, typename I>
inline
const mln::value::set<T>&
cast_image_<T,I>::values() const
{
return vset::the();
}
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
......
......@@ -120,9 +120,6 @@ namespace mln
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
/// Value set associated type.
typedef mln::value::set<value> vset;
/// Skeleton.
typedef complex_image< D, tag::psite_<P>, tag::value_<V> > skeleton;
......@@ -148,8 +145,6 @@ namespace mln
/// \{
/// Return the domain of psites od the image.
const p_complex<D, P>& domain() const;
/// Return the domain of values of the image.
const vset& values() const;
/// Return the array of values associated to the faces.
const metal::vec<D + 1, std::vector<V> >& face_values() const;
......@@ -268,14 +263,6 @@ namespace mln
return this->data_->values_[p.n()][p.face_id()];
}
template <unsigned D, typename P, typename V>
inline
const mln::value::set<V> &
complex_image<D, P, V>::values() const
{
return vset::the();
}
template <unsigned D, typename P, typename V>
inline
const metal::vec< D + 1, std::vector<V> >&
......
......@@ -104,10 +104,6 @@ namespace mln
/// Dtor
~decorated_image();
/// Value_Set associated type.
typedef mln_vset(I) vset;
/// Skeleton.
typedef decorated_image< tag::image_<I>, tag::data_<D> > skeleton;
......
......@@ -157,10 +157,6 @@ namespace mln
/// Skeleton.
typedef fi_adaptor< tag::value_<T> > skeleton;
/// Value_Set associated type.
typedef mln::value::set<T> vset;
/// Constructor without argument.
fi_adaptor();
......@@ -170,9 +166,6 @@ namespace mln
/// Initialize an empty image.
void init_();
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const box2d& domain() const;
......@@ -304,13 +297,6 @@ namespace mln
this->data_ = new internal::data_< fi_adaptor<I> >();
}
template <typename I>
const typename fi_adaptor<I>::vset&
fi_adaptor<I>::values() const
{
return vset::the();
}
template <typename I>
const box2d&
fi_adaptor<I>::domain() const
......
......@@ -138,17 +138,6 @@ namespace mln
const T& operator()(const mln_psite(S)& p);
// FIXME: Weird...
/// Value_Set associated type.
typedef mln::value::set<T> vset;
/// Give the set of values of the image.
const mln::value::set<T>& values() const;
// end of FIXME
/// Change the image value.
void change_value(const T& old_val, const T& new_val);
};
......@@ -249,14 +238,6 @@ namespace mln
return this->data_->val_;
}
template <typename T, typename S>
inline
const mln::value::set<T>&
flat_image<T,S>::values() const
{
return vset::the();
}
template <typename T, typename S>
inline
void
......
......@@ -111,9 +111,6 @@ namespace mln
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
/// Value set associated type.
typedef mln::value::set<value> vset;
/// Skeleton.
typedef graph_image< tag::psite_<P>, tag::value_<V> > skeleton;
......@@ -137,8 +134,6 @@ namespace mln
/// \{
/// Return the domain of psites od the image.
const p_graph<P>& domain() const;
/// Return the domain of values of the image.
const vset& values() const;
/// Return the array of values associated to the vertices.
const std::vector<V>& vertex_values() const;
......@@ -252,14 +247,6 @@ namespace mln
return this->data_->val_[p.id()];
}
template <typename P, typename V>
inline
const mln::value::set<V> &
graph_image<P, V>::values() const
{
return vset::the();
}
template <typename P, typename V>
inline
const std::vector<V>&
......
......@@ -140,10 +140,6 @@ namespace mln
typedef image1d< tag::value_<T> > skeleton;
/// Value_Set associated type.
typedef mln::value::set<T> vset;
/// Constructor without argument.
image1d();
......@@ -162,9 +158,6 @@ namespace mln
/// Test if \p p is valid.
bool has(const point1d& p) const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const box1d& domain() const;
......@@ -352,14 +345,6 @@ namespace mln
this->data_ = new internal::data_< image1d<T> >(b, bdr);
}
template <typename T>
inline
const typename image1d<T>::vset&
image1d<T>::values() const
{
return vset::the();
}
template <typename T>
inline
const box1d&
......
......@@ -146,10 +146,6 @@ namespace mln
typedef image2d< tag::value_<T> > skeleton;
/// Value_Set associated type.
typedef mln::value::set<T> vset;
/// Constructor without argument.
image2d();
......@@ -169,9 +165,6 @@ namespace mln
/// Test if \p p is valid.
bool has(const point2d& p) const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const box2d& domain() const;
......@@ -416,14 +409,6 @@ namespace mln
this->data_ = new internal::data< image2d<T> >(b, bdr);
}
template <typename T>
inline
const typename image2d<T>::vset&
image2d<T>::values() const
{
return vset::the();
}
template <typename T>
inline
const box2d&
......
......@@ -142,11 +142,6 @@ namespace mln
/// Skeleton.
typedef image3d< tag::value_<T> > skeleton;
/// Value_Set associated type.
typedef mln::value::set<T> vset;
/// Constructor without argument.
image3d();
......@@ -166,9 +161,6 @@ namespace mln
/// Test if \p p is valid.
bool has(const point3d& p) const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const box3d& domain() const;
......@@ -389,14 +381,6 @@ namespace mln
this->data_ = new internal::data_< image3d<T> >(b, bdr);
}
template <typename T>
inline
const typename image3d<T>::vset&
image3d<T>::values() const
{
return vset::the();
}
template <typename T>
inline
const box3d&
......
......@@ -83,10 +83,6 @@ namespace mln
/// Return type of read-only access.
typedef mln_rvalue(I) rvalue;
/// Value set associated type.
typedef mln::value::set<value> vset;
/// Skeleton.
typedef interpolated< tag::image_<I> > skeleton;
......@@ -112,8 +108,6 @@ namespace mln
mln_value(I) operator()(const mln::algebra::vec<I::point::dim, float>& v) const;
/// Give the set of values of the image.
const vset& values() const;
};
......@@ -178,16 +172,6 @@ namespace mln
return this->data_->ima_(p);
}
// FIXME : Should we remove this method? (and inherit it from
// identity morpher)
template <typename I>
inline
const mln::value::set<mln_value(I) >&
interpolated<I>::values() const
{
return vset::the();
}
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
......
......@@ -128,9 +128,6 @@ namespace mln
/// Return type of read-only access.
typedef typename std::vector<V>::const_reference rvalue;
/// Value set associated type.
typedef mln::value::set<value> vset;
/// Skeleton.
typedef line_graph_image< tag::psite_<P>, tag::value_<V> > skeleton;
......@@ -158,8 +155,6 @@ namespace mln
/// \{
/// Return the domain of psites od the image.
const p_line_graph<P>& domain() const;
/// Return the domain of values of the image.
const vset& values() const;
/// Return the array of values associated to the edges.
const std::vector<V>& edge_values() const;
......@@ -285,14 +280,6 @@ namespace mln
return this->data_->edge_val_[p.id()];
}
template <typename P, typename V>
inline
const mln::value::set<V> &
line_graph_image<P, V>::values() const
{
return vset::the();
}
template <typename P, typename V>
inline
const std::vector<V>&
......
......@@ -114,7 +114,6 @@ namespace mln
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
......@@ -136,9 +135,6 @@ namespace mln
/// Test if this image has been initialized.
bool has_data() const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const pset& domain() const;
......@@ -198,14 +194,6 @@ namespace mln
return this->data_->ima_.size() != 0;
}
template <typename P, typename T>
inline
const typename mono_obased_rle_image<P, T>::vset&
mono_obased_rle_image<P, T>::values() const
{
return vset::the();
}
template <typename P, typename T>
inline
void
......
......@@ -110,7 +110,6 @@ namespace mln
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
......@@ -135,9 +134,6 @@ namespace mln
/// Give the uniq value of the image.
rvalue get_value() const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const pset& domain() const;
......@@ -191,14 +187,6 @@ namespace mln
return true;
}
template <typename P, typename T>
inline
const typename mono_rle_image<P, T>::vset&
mono_rle_image<P, T>::values() const
{
return vset::the();
}
template <typename P, typename T>
inline
void
......
......@@ -119,7 +119,6 @@ namespace mln
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
......@@ -141,9 +140,6 @@ namespace mln
/// Test if this image has been initialized.
bool has_data() const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const pset& domain() const;
......@@ -208,14 +204,6 @@ namespace mln
return this->data_->values_.size() != 0;
}
template <typename P, typename T>
inline
const typename obased_rle_image<P, T>::vset&
obased_rle_image<P, T>::values() const
{
return vset::the();
}
template <typename P, typename T>
inline
void
......
......@@ -109,7 +109,6 @@ namespace mln
typedef T& lvalue;
typedef const T rvalue;
typedef runs_psite<P> psite;
typedef mln::value::set<T> vset;
typedef p_runs_<P> pset;
......@@ -131,9 +130,6 @@ namespace mln
/// Test if this image has been initialized.
bool has_data() const;
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.
const pset& domain() const;
......@@ -186,14 +182,6 @@ namespace mln
return this->data_->values_.size() != 0;
}
template <typename P, typename T>
inline
const typename rle_image<P, T>::vset&
rle_image<P, T>::values() const
{
return vset::the();
}
template <typename P, typename T>
inline
void
......
......@@ -122,11 +122,6 @@ namespace mln
/// Return type of read-write access.
typedef T& lvalue;
/// Value_Set associated type.
typedef mln::value::set<T> vset;
/// Skeleton.
typedef sparse_image< tag::psite_<P>, tag::value_<T> > skeleton;
......@@ -153,11 +148,6 @@ namespace mln
/// Read-write access to the image value located at point \p p.
lvalue operator()(const psite& p);
/// Give the set of values of the image.
const vset& values() const;
/// Give the definition domain.