Index: integre/ChangeLog from Niels Van Vliet niels@lrde.epita.fr
* integre/ntg/core/pred_succ.hh: Add file. * integre/ntg/Makefile.am: Add file references.
+2004-03-18 Niels Van Vliet niels@lrde.epita.fr + + * integre/ntg/real/behavior.hh: Change the unsafe::get<T>::check(). + * integre/ntg/utils/cast.hh: Change cast::force(). + 2004-02-09 Giovanni Palma giovanni@lrde.epita.fr
* ntg/vect/vec.hh: Add sup() function to vec traits. Index: olena/ChangeLog from Niels Van Vliet niels@lrde.epita.fr * olena/oln/utils/histogram.hh: Fix doc. * olena/oln/convert/value_to_point.hh: Likewise.
Index: olena/oln/utils/histogram.hh --- olena/oln/utils/histogram.hh Thu, 18 Mar 2004 18:24:14 +0100 van-vl_n (oln/10_histogram. 1.6.1.14.1.10 640) +++ olena/oln/utils/histogram.hh Fri, 19 Mar 2004 11:49:17 +0100 van-vl_n (oln/10_histogram. 1.6.1.14.1.10 640) @@ -178,11 +178,11 @@ ** number of occurrences an image3d (because rgb_8 has 3 components). ** ** \todo FIXME: An image is inside the histogram. This is incorrect - ** because it is not exactly an image (we do not need any border). + ** because it is not exactly an image (no border needed). ** ** \param T Type of the image. - ** \param CPT Type use to count the occurrences (unsinged). - ** \param V2P Concersion class to convert a value T to a point. + ** \param CPT Type used to count the occurrences (unsigned). + ** \param V2P Conversion class to convert a value T to a point. ** \param Exact Exact type of the histogram. ** ** \see oln::abstract::histogram @@ -227,7 +227,7 @@
/*! \brief Empty histogram. ** - ** \note The function Init(image) should be used after this + ** \note The function init(image) should be used after this ** constructor. */ histogram(const value_to_point_type & c2p = value_to_point_type()): @@ -292,10 +292,10 @@
/*! Minimum value of an histogram. ** - ** It return the smaller value within the image used to build the + ** Return the smaller value within the image used to build the ** histogram. ** - ** \note It can be slow when the histogram is sparse because it iterate + ** \note It can be slow when the histogram is sparse because it iterates ** over a large range of 0. Use \a histogram_min or \a histogram_minmax ** instead. ** \see histogram_min @@ -317,11 +317,11 @@ } /*! Maximum value of an histogram. ** - ** It return the higher value within the image used to build the + ** Return the higher value within the image used to build the ** histogram. ** ** \note It can be slow when the histogram is sparse because it - ** iterate over a large range of 0. Use histogram_max or + ** iterates over a large range of 0. Use histogram_max or ** histogram_minmax instead. ** \see histogram_max */ @@ -357,12 +357,12 @@ /*! Build the histogram and has quick min and max functions. ** ** The idea behind the min- and max-specialized histogram is to - ** maintain worst min and max bounds while updating histogram. We - ** don't maintain _exact_ min and max bounds, because this would + ** maintain worst min and max bounds while updating histogram. It + ** does not maintain _exact_ min and max bounds, because this would ** involve some costly computation when removing values from the ** histogram and maybe this time will be lost if the removed value is ** reinserted before max() or min() is called.\n - ** So we update the _worst_ min and max bounds whenever the histogram + ** So it updates the _worst_ min and max bounds whenever the histogram ** value are accessed, and delay the _real_ min and max computation ** until min() or max() is called. ** \see histogram @@ -687,10 +687,10 @@ // calculate the histogram of the image utils::histogram<val> histo(im);
- // initialize the array of pointer to the point in the result - // with the histogram we can know the number of each color and - // then calculate an array of pointer for quick access to each - // value of the image + // Initialize the array of pointer to the point in the result. + // With the histogram the number of each color can be deduced and + // then it calculates an array of pointer for quick access to each + // value of the image. const ntg_cumul_type(val) card = ntg_max_val(val) - ntg_min_val(val) + 1; std::vector<oln_point_type(I)* > ptr(card); @@ -741,7 +741,7 @@ *(ptr[unsigned(im[p] - ntg_min_val(val))]++) = p; }
- /*! Select staticly the good distrib_sort. + /*! Select statically the good distrib_sort. ** ** \param reverse If the sort should be reverted or not. */ Index: integre/ntg/Makefile.am --- integre/ntg/Makefile.am Thu, 27 Nov 2003 11:26:27 +0100 burrus_n (oln/q/36_Makefile.a 1.8.1.1 640) +++ integre/ntg/Makefile.am Fri, 19 Mar 2004 11:22:50 +0100 van-vl_n (oln/q/36_Makefile.a 1.8.1.1 640) @@ -27,6 +27,7 @@ core/internal/traits.hh \ core/interval.hh \ core/macros.hh \ + core/pred_succ.hh \ core/predecls.hh \ core/type.hh \ core/type_traits.hh \ Index: olena/oln/convert/value_to_point.hh --- olena/oln/convert/value_to_point.hh Thu, 18 Mar 2004 18:24:14 +0100 van-vl_n (oln/j/43_value_to_p 1.4 644) +++ olena/oln/convert/value_to_point.hh Fri, 19 Mar 2004 11:38:53 +0100 van-vl_n (oln/j/43_value_to_p 1.4 644) @@ -37,7 +37,8 @@ namespace convert { /*! Convert a value of pixel to a point. ** - ** For example it transforms an RGB color to a 3D point (ntg::rgb_8 => oln::point3d). + ** For example, transform an RGB color to a 3D point + ** (ntg::rgb_8 => oln::point3d). ** This function is useful to build the histogram. \n ** Example: ** \verbatim @@ -57,14 +58,15 @@ Exact>::ret> { private: - /// By default a scalar is expected. If the type is a vector, a specialization should be written. + /// By default a scalar is expected. If the type is a vector, a + /// specialization should be written. typedef typename ntg_is_a(Argument_type, ntg::non_vectorial)::ensure_type ensure_type; public: - /// By default it return a point1d. + /// By default return a point1d. typedef point1d result_type; typedef Argument_type argument_type;
- /// This class has bee made because of the lake of operator-- in ntg::bin + /// Convert a binary to a point. template <typename O, typename I> struct doit_binary { @@ -75,7 +77,7 @@ return input ? O(1) : O(0); } }; - /// This class has bee made because of the lake of operator-- in ntg::bin + /// Convert a non vectorial to a point. template <typename O, typename I> struct doit_not_binary { @@ -99,7 +101,7 @@
/*! Specialization for color of three dimension. ** - ** \todo It could be generalized to n dimensions if there were a trait that + ** \todo Could be generalized to n dimensions if there were a trait that ** give a pointkd for a given dimension k. */ template <unsigned Qbits, template <unsigned> class S, class Exact> Index: integre/ntg/core/pred_succ.hh --- integre/ntg/core/pred_succ.hh Fri, 19 Mar 2004 11:51:05 +0100 van-vl_n () +++ integre/ntg/core/pred_succ.hh Fri, 19 Mar 2004 11:15:51 +0100 van-vl_n (oln/k/8_pred_succ. 644) @@ -0,0 +1,75 @@ +// Copyright (C) 2004 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, Boston, +// MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef NTG_CORE_PRED_SUCC_HH +# define NTG_CORE_PRED_SUCC_HH + +#include <ntg/all.hh> +#include <mlc/is_a.hh> + +namespace ntg { + + namespace internal { + //! Return a type which supports inc and dec. + template <typename T> + struct with_arith + { + typedef typename ntg_is_a(T, non_vectorial)::ensure_type non_v; + + typedef int_u<1> bool_with_arith; + typedef T non_vectorial_with_arith; + + typedef typename mlc::if_<ntg_is_a(T, ntg::binary)::ret, + id_<bool_with_arith>, + id_<non_vectorial_with_arith> >::ret::ret ret; + }; + } + + /*! Return the successor of \a t. + ** + ** \note The goal is to iterate on types such as ntg::bin. + */ + template <typename T> + T + succ(const T &t) + { + return T(internal::with_arith<T>::ret(t) + 1); + } + + /*! Return the predecessor of \a t. + ** + ** \note The goal is to iterate on types such as ntg::bin. + */ + template <typename T> + T + pred(const T&t) + { + return T(internal::with_arith<T>::ret(t) - 1); + } +} + +#endif
On Fri, 19 Mar 2004 11:56:12 +0100 Niels Van Vliet niels@lrde.epita.fr wrote:
- ** So it updates the _worst_ min and max bounds whenever the histogram ** value are accessed, and delay the _real_ min and max computation
values
// Initialize the array of pointer to the point in the result.
// With the histogram the number of each color can be deduced and
// then it calculates an array of pointer for quick access to each
// value of the image.
Doxygen ?
Damien Thivolle wrote:
On Fri, 19 Mar 2004 11:56:12 +0100 Niels Van Vliet niels@lrde.epita.fr wrote:
- ** So it updates the _worst_ min and max bounds whenever the histogram ** value are accessed, and delay the _real_ min and max computation
values
// Initialize the array of pointer to the point in the result.
// With the histogram the number of each color can be deduced and
// then it calculates an array of pointer for quick access to each
// value of the image.
Doxygen ?
Ce sont des anciens commentaires à l'intérieur de l'algo => pas de doxygen.