
--- milena/ChangeLog | 4 ++ milena/mln/draw/{box_plain.hh => site_set.hh} | 58 +++++++++++------------- 2 files changed, 31 insertions(+), 31 deletions(-) copy milena/mln/draw/{box_plain.hh => site_set.hh} (61%) diff --git a/milena/ChangeLog b/milena/ChangeLog index e8430cd..8ea11b0 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,7 @@ +2011-05-26 Guillaume Lazzara <z@lrde.epita.fr> + + * mln/draw/site_set.hh: new. + 2011-05-17 Guillaume Lazzara <z@lrde.epita.fr> Add new sample programs. diff --git a/milena/mln/draw/box_plain.hh b/milena/mln/draw/site_set.hh similarity index 61% copy from milena/mln/draw/box_plain.hh copy to milena/mln/draw/site_set.hh index ec5b865..1738b16 100644 --- a/milena/mln/draw/box_plain.hh +++ b/milena/mln/draw/site_set.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -23,23 +23,17 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_DRAW_BOX_PLAIN_HH -# define MLN_DRAW_BOX_PLAIN_HH +#ifndef MLN_DRAW_SITE_SET_HH +# define MLN_DRAW_SITE_SET_HH /*! \file * - * \brief Draw a plain box in an image. + * \brief Draw a site set in an image. * - * \fixme Rename as box.hh */ # include <mln/core/concept/image.hh> -# include <mln/core/alias/box2d.hh> -# include <mln/data/fill.hh> -# include <mln/draw/line.hh> -# include <mln/pw/image.hh> -# include <mln/pw/cst.hh> - +# include <mln/core/concept/site_set.hh> namespace mln { @@ -47,39 +41,41 @@ namespace mln namespace draw { - /*! Draw a plain box at value \p v in image \p ima + /*! Draw a sites with value \p v in image \p ima * * \param[in,out] ima The image to be drawn. - * \param[in] b the box to draw. + * \param[in] b the site set to draw. * \param[in] v The value to assign to all drawn pixels. + * \param[in] output_ratio size ratio between output image and the + * image from which the bboxes were calculated. * - * \pre \p ima has to be initialized. - * \pre \p ima has \p beg. - * \pre \p ima has \p end. + * \pre \p s is included in \p ima domain. * */ - template <typename I, typename B> - void box_plain(Image<I>& ima, - const Box<B>& b, - const mln_value(I)& v); + template <typename I, typename S> + void site_set(Image<I>& ima, + const Site_Set<S>& s, + const mln_value(I)& v, + unsigned output_ratio = 1); # ifndef MLN_INCLUDE_ONLY - template <typename I, typename B> - inline - void box_plain(Image<I>& ima, - const Box<B>& b, - const mln_value(I)& v) + template <typename I, typename S> + void site_set(Image<I>& ima_, + const Site_Set<S>& s_, + const mln_value(I)& v, + unsigned output_ratio) { mln_precondition(exact(ima).is_valid()); + mln_precondition(exact(ima).domain() >= exact(s)); - mln_psite(I) pmin = exact(b).pmin(); - mln_psite(I) pmax = exact(b).pmax(); - - mln_precondition(exact(ima).has(pmin) && exact(ima).has(pmax)); + I& ima = exact(ima_); + const S& s = exact(s_); - data::fill((ima | b).rw(), v); + mln_piter(S) p(s); + for_all(p) + ima(p / output_ratio) = v; } # endif // ! MLN_INCLUDE_ONLY @@ -89,4 +85,4 @@ namespace mln } // end of namespace mln -#endif // ! MLN_DRAW_BOX_PLAIN_HH +#endif // ! MLN_DRAW_SITE_SET_HH -- 1.5.6.5