$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
extension/adjust.hh
1 // Copyright (C) 2008, 2009, 2012 EPITA Research and Development
2 // Laboratory (LRDE)
3 //
4 // This file is part of Olena.
5 //
6 // Olena is free software: you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free
8 // Software Foundation, version 2 of the License.
9 //
10 // Olena is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free
19 // software project without restriction. Specifically, if other files
20 // instantiate templates or use macros or inline functions from this
21 // file, or you compile this file and link it with other files to produce
22 // an executable, this file does not by itself cause the resulting
23 // executable to be covered by the GNU General Public License. This
24 // exception does not however invalidate any other reasons why the
25 // executable file might be covered by the GNU General Public License.
26 
27 #ifndef MLN_EXTENSION_ADJUST_HH
28 # define MLN_EXTENSION_ADJUST_HH
29 
35 
36 # include <mln/border/adjust.hh>
37 # include <mln/core/concept/window.hh>
38 # include <mln/core/concept/weighted_window.hh>
39 # include <mln/core/concept/neighborhood.hh>
40 # include <mln/geom/delta.hh>
41 
42 
43 namespace mln
44 {
45 
46  namespace extension
47  {
48 
54  template <typename I, typename W>
55  void adjust(const Image<I>& ima, const Window<W>& win);
56 
62  template <typename I, typename W>
63  void adjust(const Image<I>& ima, const Weighted_Window<W>& wwin);
64 
70  template <typename I, typename N>
71  void adjust(const Image<I>& ima, const Neighborhood<N>& nbh);
72 
78  template <typename I>
79  void adjust(const Image<I>& ima, unsigned delta);
80 
81 
82 
83 # ifndef MLN_INCLUDE_ONLY
84 
85  namespace impl
86  {
87 
88  template <typename I>
89  void adjust(const I& ima, unsigned delta)
90  {
91  mln_precondition(exact(ima).is_valid());
92  // FIXME: Is-it right?
93  border::adjust(ima, delta);
94  }
95 
96  } // end of namespace mln::extension::impl
97 
98 
99  // Facades.
100 
101  template <typename I, typename W>
102  void adjust(const Image<I>& ima, const Window<W>& win)
103  {
104  mln_trace("extension::adjust");
105  impl::adjust(ima, geom::delta(win));
106  }
107 
108  template <typename I, typename W>
109  void adjust(const Image<I>& ima, const Weighted_Window<W>& wwin)
110  {
111  mln_trace("extension::adjust");
112  impl::adjust(ima, geom::delta(wwin));
113  }
114 
115  template <typename I, typename N>
116  void adjust(const Image<I>& ima, const Neighborhood<N>& nbh)
117  {
118  mln_trace("extension::adjust");
119  impl::adjust(ima, geom::delta(nbh));
120  }
121 
122  template <typename I>
123  void adjust(const Image<I>& ima, unsigned delta)
124  {
125  mln_trace("extension::adjust");
126  impl::adjust(ima, delta);
127  }
128 
129 # endif // ! MLN_INCLUDE_ONLY
130 
131  } // end of namespace mln::extension
132 
133 } // end of namespace mln
134 
135 
136 #endif // ! MLN_EXTENSION_ADJUST_HH