$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
graph_elt_window.hh
1 // Copyright (C) 2007, 2008, 2009 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_CORE_IMAGE_GRAPH_ELT_WINDOW_HH
28 # define MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH
29 
33 
34 # include <mln/core/concept/window.hh>
35 # include <mln/core/internal/neighborhood_base.hh>
36 # include <mln/core/internal/graph_window_base.hh>
37 # include <mln/core/image/graph_window_piter.hh>
38 
39 
40 namespace mln
41 {
42 
44  template <typename G, typename S> class graph_elt_window;
45  template <typename G, typename F> class p_edges;
46  template <typename G, typename F> class p_vertices;
47  namespace util
48  {
49  template <typename G> class edge;
50  template <typename G> class vertex;
51  };
52 
53 
54  namespace internal
55  {
56 
57  template <typename G, typename S, typename E>
59  : public neighborhood_extra_impl<graph_elt_window<G,S>,E>
60  {
61  };
62 
63 
69  //
70  template <typename G, typename S>
72 
73  template <typename G, typename F>
75  {
76  typedef mln_edge_nbh_edge_fwd_iter(G) nbh_fwd_iter_;
77  typedef mln_edge_nbh_edge_bkd_iter(G) nbh_bkd_iter_;
78  };
79 
80  template <typename G, typename F>
82  {
83  typedef mln_vertex_nbh_vertex_fwd_iter(G) nbh_fwd_iter_;
84  typedef mln_vertex_nbh_vertex_bkd_iter(G) nbh_bkd_iter_;
85  };
86 
87  } // end of namespace mln::internal
88 
89 
90  namespace trait
91  {
92 
93  template <typename G, typename S>
94  struct window_< mln::graph_elt_window<G,S> >
95  {
96  typedef trait::window::size::unknown size;
97  typedef trait::window::support::irregular support;
98  typedef trait::window::definition::varying definition;
99  };
100 
101  } // end of namespace mln::trait
102 
103 
109  //
110  template <typename G, typename S>
112  : public graph_window_base<mln_result(S::fun_t),
113  graph_elt_window<G,S> >,
114  public internal::graph_window_iter_dispatch<G,S>
115  {
117  typedef internal::graph_window_iter_dispatch<G,S> super_;
118 
119  typedef typename super_::nbh_fwd_iter_ nbh_fwd_iter_;
120  typedef typename super_::nbh_bkd_iter_ nbh_bkd_iter_;
121 
122  public:
125  typedef S target;
126 
128  typedef mln_psite(S) psite;
129 
131  typedef mln_psite(S) center_t;
132 
134  typedef mln_graph_element(S) graph_element;
135 
138  typedef graph_window_piter<S,self_,nbh_fwd_iter_> fwd_qiter;
139 
142  typedef graph_window_piter<S,self_,nbh_bkd_iter_> bkd_qiter;
143 
145  typedef fwd_qiter qiter;
147 
148  };
149 
150 } // end of namespace mln
151 
152 
153 #endif // ! MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH