• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List

filter.hh

00001 // Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
00002 //
00003 // This file is part of Olena.
00004 //
00005 // Olena is free software: you can redistribute it and/or modify it under
00006 // the terms of the GNU General Public License as published by the Free
00007 // Software Foundation, version 2 of the License.
00008 //
00009 // Olena is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Olena.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 // As a special exception, you may use this file as part of a free
00018 // software project without restriction.  Specifically, if other files
00019 // instantiate templates or use macros or inline functions from this
00020 // file, or you compile this file and link it with other files to produce
00021 // an executable, this file does not by itself cause the resulting
00022 // executable to be covered by the GNU General Public License.  This
00023 // exception does not however invalidate any other reasons why the
00024 // executable file might be covered by the GNU General Public License.
00025 
00026 #ifndef MLN_LINEAR_GAUSSIAN_FILTER_HH
00027 # define MLN_LINEAR_GAUSSIAN_FILTER_HH
00028 
00035 
00036 # include <mln/core/concept/image.hh>
00037 # include <mln/linear/gaussian/impl.hh>
00038 # include <mln/linear/gaussian/internal/coefficients.hh>
00039 
00040 
00041 namespace mln
00042 {
00043 
00044   namespace linear
00045   {
00046 
00047     namespace gaussian
00048     {
00049 
00054       template <typename I>
00055       mln_concrete(I)
00056       filter(const Image<I>& input, double sigma);
00057 
00058 
00059       template <typename I>
00060       mln_concrete(I)
00061       filter(const Image<I>& input, double sigma, int dir);
00062 
00063 
00064 
00065 # ifndef MLN_INCLUDE_ONLY
00066 
00067 
00068       // Facades.
00069 
00079       template <typename I>
00080       inline
00081       mln_concrete(I)
00082       filter(const Image<I>& input, double sigma, int dir)
00083       {
00084         trace::entering("linear::gaussian::filter");
00085 
00086         mln_precondition(exact(input).is_valid());
00087         mln_precondition(dir < I::site::dim);
00088 
00089         mln_concrete(I) output;
00090         initialize(output, input);
00091 
00092         internal::coefficients coef = internal::coefficients_not_derivative(sigma);
00093 
00094         impl::generic_filter_common_(mln_trait_value_nature(mln_value(I))(),
00095                                      input, coef, sigma, output, dir);
00096 
00097         trace::exiting("linear::gaussian::filter");
00098         return output;
00099       }
00100 
00101 
00102 
00103 
00109       template <typename I>
00110       inline
00111       mln_concrete(I)
00112       filter(const Image<I>& input, double sigma)
00113       {
00114         trace::entering("linear::gaussian::filter");
00115 
00116         mln_precondition(exact(input).is_valid());
00117 
00118         mln_concrete(I) output;
00119         initialize(output, input);
00120 
00121         internal::coefficients coef = internal::coefficients_not_derivative(sigma);
00122 
00123         impl::generic_filter_common_(mln_trait_value_nature(mln_value(I))(),
00124                                      input, coef, sigma, output);
00125 
00126         trace::exiting("linear::gaussian::filter");
00127         return output;
00128       }
00129 
00130 
00131 # endif // ! MLN_INCLUDE_ONLY
00132 
00133     } // end of namespace mln::linear::gaussian
00134 
00135   } // end of namespace mln::linear
00136 
00137 } // end of namespace mln
00138 
00139 
00140 #endif // ! MLN_LINEAR_GAUSSIAN_FILTER_HH

Generated on Tue Oct 4 2011 15:23:46 for Milena (Olena) by  doxygen 1.7.1