
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2007-10-12 Matthieu Garrigues <garrigues@lrde.epita.fr> Improve documentation in values. * float01.hh, * float01_.hh, * float01_f.hh, * gray.hh, * graylevel.hh, * rgb.hh, * scalar.hh, * stack.hh: Add documentation. --- float01.hh | 11 +++++++++++ float01_.hh | 5 ++++- float01_f.hh | 3 ++- gray.hh | 7 +++++++ graylevel.hh | 6 +++++- rgb.hh | 15 ++++++++++----- scalar.hh | 5 +++++ stack.hh | 17 +++++++++++++---- 8 files changed, 57 insertions(+), 12 deletions(-) Index: trunk/milena/mln/value/graylevel.hh =================================================================== --- trunk/milena/mln/value/graylevel.hh (revision 1330) +++ trunk/milena/mln/value/graylevel.hh (revision 1331) @@ -28,6 +28,11 @@ #ifndef MLN_CORE_VALUE_GRAYLEVEL_HH # define MLN_CORE_VALUE_GRAYLEVEL_HH +/*! \file mln/value/graylevel.hh + * + * \brief Definition of the mln::value::graylevel class. + */ + # include <iostream> # include <mln/core/contract.hh> @@ -77,7 +82,6 @@ /// Ctor with gray. graylevel(const gray&); - /// Access to std type. mln_enc(int_u<n>) value() const; Index: trunk/milena/mln/value/gray.hh =================================================================== --- trunk/milena/mln/value/gray.hh (revision 1330) +++ trunk/milena/mln/value/gray.hh (revision 1331) @@ -85,17 +85,24 @@ /// Access to std type. unsigned long value() const; + /// Access to the encoding size. unsigned nbits() const; + /// Set the encoding size to nbits. void set_nbits(unsigned nbits); + /// Return an equivalent gray encoded on \p nbits bits. gray to_nbits(unsigned nbits) const; + /// Convertion. template <unsigned N> operator graylevel<N>() const; protected: + /// Encoding size. unsigned nbits_; + + /// Value. unsigned long val_; }; Index: trunk/milena/mln/value/float01_.hh =================================================================== --- trunk/milena/mln/value/float01_.hh (revision 1330) +++ trunk/milena/mln/value/float01_.hh (revision 1331) @@ -50,7 +50,7 @@ class float01; - /// General float01-level class on n bits. + /// General float01_ class on n bits. template <unsigned n> struct float01_ @@ -70,10 +70,13 @@ /// Access to std type. float value() const; + /// Set value to the \p val th position in the quantized interval. void set_ind(unsigned long val); + /// Float convertion. operator float() const; + /// Float assigment. float01_<n>& operator=(float val); }; Index: trunk/milena/mln/value/scalar.hh =================================================================== --- trunk/milena/mln/value/scalar.hh (revision 1330) +++ trunk/milena/mln/value/scalar.hh (revision 1331) @@ -28,6 +28,11 @@ #ifndef MLN_VALUE_SCALAR_HH # define MLN_VALUE_SCALAR_HH +/*! \file mln/value/scalar.hh + * + * \brief Definition of the basic mln::value::scalar_ class. + */ + # include <mln/value/concept/scalar.hh> # include <mln/metal/is_a.hh> # include <mln/metal/if.hh> Index: trunk/milena/mln/value/stack.hh =================================================================== --- trunk/milena/mln/value/stack.hh (revision 1330) +++ trunk/milena/mln/value/stack.hh (revision 1331) @@ -30,7 +30,7 @@ /*! \file mln/value/stack.hh * - * \brief Definition of an image class FIXME + * \brief Definition of the stack image type. */ # include <mln/core/internal/image_value_morpher.hh> @@ -50,7 +50,7 @@ { - /*! \brief data structure for stack_image + /*! \brief data structure for stack_image. * */ template <unsigned n, typename I> @@ -94,8 +94,16 @@ } // end of namespace mln::value::internal - /*! \brief FIXME + /*! \brief stack image class. stack_image stores a + * vector of n images of the same domain. * + * The parameter \c n is the number of images, \c I is the type of + * a stack element. Acces a value will compute a vector which + * contains n coordinates : + * [stack[0](p), + * stack[1](p), + * ... , + * stack[n](p)] */ template <unsigned n, typename I> struct stack_image : public mln::internal::image_value_morpher_< I, stack_image<n,I> > @@ -144,7 +152,7 @@ }; - + /// \{ Shortcut to build a stack with two images. template <typename I> stack_image<2, const I> stack(const Image<I>& ima1, const Image<I>& ima2); @@ -153,6 +161,7 @@ template <typename I> stack_image<2, I> stack(Image<I>& ima1, Image<I>& ima2); + /// \} } // end of namespace mln::value Index: trunk/milena/mln/value/float01.hh =================================================================== --- trunk/milena/mln/value/float01.hh (revision 1330) +++ trunk/milena/mln/value/float01.hh (revision 1331) @@ -72,20 +72,31 @@ /// Access to std type. float value() const; + + /// Access to the position in the quantized interval. unsigned long value_ind() const; + /// Access to the encoding size. unsigned nbits() const; + + /// Set the encoding size to nbits. float01& set_nbits(unsigned nbits); + + /// Return an equivalent gray encoded on \p nbits bits. const float01 to_nbits(unsigned nbits) const; + /// Convertion to float. operator float() const; // template <unsigned n> // operator float01_<n>() const; protected: + /// Encoding size. unsigned nbits_; + + /// Value. unsigned long val_; }; Index: trunk/milena/mln/value/rgb.hh =================================================================== --- trunk/milena/mln/value/rgb.hh (revision 1330) +++ trunk/milena/mln/value/rgb.hh (revision 1331) @@ -31,7 +31,7 @@ /*! \file mln/value/rgb8.hh * * \brief Color class for red-green-blue where every component is - * 8-bit encoded. + * n-bit encoded. */ # include <mln/value/concept/structured.hh> @@ -51,7 +51,7 @@ /*! \brief Color class for red-green-blue where every component is - * 8-bit encoded. + * n-bit encoded. */ template <unsigned n> struct rgb : public Structured< rgb<n> > @@ -64,6 +64,7 @@ /// Equivalent associated type. typedef int_u<n> equiv[3]; + /// \{ Acces to red/green/blue component. int_u<n> red() const { return c_[0]; } int_u<n>& red() { return c_[0]; } @@ -72,26 +73,30 @@ int_u<n> blue() const { return c_[2]; } int_u<n>& blue() { return c_[2]; } + /// \} - /// Ctors + /// \{ Ctors rgb<n>(); rgb<n>(equiv a); rgb<n>(enc r, enc g, enc b); rgb<n>(enc l); + /// \} - /// assignments + /// \{ Assignments. rgb<n>& operator=(const rgb<n>& v); rgb<n>& operator=(const enc& i); + /// \} /// Zero value. static const rgb<n> zero; - /// Colors. + /// \{ Colors. static const rgb<n> black; static const rgb<n> max_red; static const rgb<n> max_green; static const rgb<n> max_blue; static const rgb<n> white; + /// \} /// addition rgb<n> operator+(const rgb<n>& v) const; Index: trunk/milena/mln/value/float01_f.hh =================================================================== --- trunk/milena/mln/value/float01_f.hh (revision 1330) +++ trunk/milena/mln/value/float01_f.hh (revision 1331) @@ -43,7 +43,7 @@ struct float01; - /// General float01-level class on n bits. + /// General float01_f class on n bits. struct float01_f : public Floating< float01_f >, @@ -65,6 +65,7 @@ /// Op encoding_t. operator float() const; + /// Assigment with float. float01_f& operator=(const float val); };