
On Fri, 26 Mar 2004 20:57:26 +0100 Niels Van Vliet <niels@lrde.epita.fr> wrote:
[...] + +/*! Return the number of components of T if T is vectorial. +** +** If T is non vectorial, the value returned should not be considered. +*/ +#define ntg_if_vectorial_nb_comp(T) \ + ntg::type_traits<typename mlc::if_<ntg_is_a(T, ntg::vectorial)::ret, \ + T, \ + ntg::vec<42, bool> >::ret>::nb_comp + +/*! Same as \a ntg_if_vectorial_nb_comp but without 'typename' +** +** \see ntg_if_vectorial_nb_comp +*/ +#define ntg_if_vectorial_nb_comp_(T) \ + ntg::type_traits<mlc::if_<ntg_is_a_(T, ntg::vectorial)::ret, \ + T, \ + ntg::vec<42, bool> >::ret>::nb_comp + +/*! Compare the number of components. +** +** - If \a A and \a B are non_vectorial, then +** \a {ntg_compare_nb_comp(A, B)::ret = true} +** - If \a A and \a B are vectorial, then +** \a {ntg_compare_nb_comp(A, B)::ret = (ntg_nb_comp(A) = ntg_nb_comp(B))} +** - Otherwise, it returns false +*/ +#define ntg_compare_nb_comp(A, B) \ + mlc::if_< \ + ntg_is_a(A, ntg::non_vectorial)::ret, \ + ntg_is_a(B, ntg::non_vectorial), \ + mlc::eq<ntg_if_vectorial_nb_comp(A), \ + ntg_if_vectorial_nb_comp(B)> >::ret + +/*! Same as \a ntg_compare_nb_comp but without 'typename' +** +** \see ntg_compare_nb_comp +*/ +#define ntg_compare_nb_comp_(A, B) \ + mlc::if_< \ + ntg_is_a_(A, ntg::non_vectorial)::ret, \ + ntg_is_a_(B, ntg::non_vectorial), \ + mlc::eq<ntg_if_vectorial_nb_comp_(A), \ + ntg_if_vectorial_nb_comp_(B)> >::ret + #endif // !NTG_CORE_MACROS_HH
Les macros n'apparaissent pas dans la doc, ca n'est pas utile de les documenter.
[...] + /*! A Nagao filter generalized. + ** + ** Each point in the input correspond to the mean of the + ** window in which has the smallest variance. + ** + ** \paran in Input image. + ** \param sa array of structuring elements. + ** + ** \see oln::convol::nagao + */
Each point in the input corresponds.
[...] + /*! \brief Compute the variance and the mean within a window. + ** + ** \param Sum type used to compute the sum and the average. + ** \param Var type used to compute the variance. + ** + ** \note There is two parameters because for vectorial types the sum + ** is usually a vector, and the variance a non vectorial type. + */
There are two parameters.
[...] + template <typename Sum = ntg::float_s, typename Var = ntg::float_s> + class se_stat + { + public: + /// type of used to sum the value (usually floating point values) + typedef Sum sum_type; + /// type of used for the variance (usually floating point values) + typedef Var variance_type;
C'est ptet moi, mais je ne comprends pas les deux phrases :) Sinon, ne devrait-il pas y avoir une majuscule a Type ?
[...] + /// Computes the mean and the variance. + template <class I, class S> + se_stat & + compute(const oln::abstract::image<I> &im, + const oln_point_type(I) &p, + const oln::abstract::struct_elt<S> &s); +
Compute.
[...] + /// Computes the mean and the variance. + template <typename Sum, typename Var> + template <class I, class S> + inline se_stat<Sum, Var> & + se_stat<Sum, Var>::compute(const oln::abstract::image<I> &im, + const oln_point_type(I) &p, + const oln::abstract::struct_elt<S> &s)
Idem. -- Damien Thivolle damien.thivolle@lrde.epita.fr