attribute_closing_opening.hh

00001 // Copyright (C) 2001, 2002, 2003, 2004  EPITA Research and Development Laboratory
00002 //
00003 // This file is part of the Olena Library.  This library is free
00004 // software; you can redistribute it and/or modify it under the terms
00005 // of the GNU General Public License version 2 as published by the
00006 // Free Software Foundation.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this library; see the file COPYING.  If not, write to
00015 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016 // Boston, MA 02110-1301, USA.
00017 //
00018 // As a special exception, you may use this file as part of a free
00019 // software library without restriction.  Specifically, if other files
00020 // instantiate templates or use macros or inline functions from this
00021 // file, or you compile this file and link it with other files to
00022 // produce an executable, this file does not by itself cause the
00023 // resulting executable to be covered by the GNU General Public
00024 // License.  This exception does not however invalidate any other
00025 // reasons why the executable file might be covered by the GNU General
00026 // Public License.
00027 
00028 #ifndef OLENA_ATTRIBUTE_CLOSING_OPENING_HH
00029 # define OLENA_ATTRIBUTE_CLOSING_OPENING_HH
00030 
00031 #include <oln/morpho/attribute_union_find.hh>
00032 
00033 
00034 namespace oln {
00037   namespace morpho {
00040     namespace fast {
00043       namespace tarjan {
00046         namespace internal {
00047 
00060           template<class I, class N, class A>
00061           oln_concrete_type(I)
00062             attr_closing_(const abstract::non_vectorial_image<I>& input,
00063                           const abstract::neighborhood<N>& Ng,
00064                           const attr_lambda_type(A) &lambda,
00065                           const attr_env_type(A) &env = attr_env_type(A)())
00066           {
00067             typedef tarjan::tarjan_set<oln_concrete_type(I), A > tarjan_set_type;
00068             tarjan_set_type attr_closing(input.exact(), env);
00069             return attr_closing.template get_comptute<true>(lambda, Ng);
00070           }
00071 
00084           template<class I, class N, class A>
00085           oln_concrete_type(I)
00086             attr_opening_(const abstract::non_vectorial_image<I>& input,
00087                           const abstract::neighborhood<N>& Ng,
00088                           const attr_lambda_type(A) &lambda,
00089                           const attr_env_type(A) &env = attr_env_type(A)())
00090           {
00091             typedef tarjan::tarjan_set<oln_concrete_type(I), A > tarjan_set_type;
00092             tarjan_set_type attr_opening(input.exact(), env);
00093             return attr_opening.template get_comptute<false>(lambda, Ng);
00094           }
00095 
00096         } // !internal
00097       } // !tarjan
00098       // macro for some attribute opening/closing declarations
00099 # define xxx_opening_decl(T) \
00100       template<class I, class N> \
00101       oln_concrete_type(I) \
00102         T##_opening(const abstract::non_vectorial_image<I>& input, \
00103                        const abstract::neighborhood<N>& Ng, \
00104                        const attr_lambda_type(attr::T##_type<unsigned>) &lambda) \
00105       { \
00106         return tarjan::internal::attr_opening_<I, N, attr::T##_type<unsigned> >(input, Ng, lambda); \
00107       }
00108 
00109 # define xxx_closing_decl(T) \
00110       template<class I, class N> \
00111       oln_concrete_type(I) \
00112         T##_closing(const abstract::non_vectorial_image<I>& input, \
00113                        const abstract::neighborhood<N>& Ng, \
00114                        const attr_lambda_type(attr::T##_type<unsigned>) &lambda) \
00115       { \
00116         return tarjan::internal::attr_closing_<I, N, attr::T##_type<unsigned> >(input, Ng, lambda); \
00117       }
00118 
00119 
00120       // same as previous, but for attribute based on image types
00121 # define xxx_opening_im_decl(T) \
00122       template<class I, class N> \
00123       oln_concrete_type(I) \
00124         T##_opening(const abstract::non_vectorial_image<I>& input, \
00125                        const abstract::neighborhood<N>& Ng, \
00126                        const attr_lambda_type(attr::T##_type<I>) &lambda) \
00127       { \
00128         return tarjan::internal::attr_opening_<I, N, attr::T##_type<I> >(input, Ng, lambda); \
00129       }
00130 
00131 # define xxx_closing_im_decl(T) \
00132       template<class I, class N> \
00133       oln_concrete_type(I) \
00134         T##_closing(const abstract::non_vectorial_image<I>& input, \
00135                        const abstract::neighborhood<N>& Ng, \
00136                        const attr_lambda_type(attr::T##_type<I>) &lambda) \
00137       { \
00138         return tarjan::internal::attr_closing_<I, N, attr::T##_type<I> >(input, Ng, lambda); \
00139       }
00140 
00141       // same as previous, but for attribute based on image types with environment
00142 # define xxx_opening_im_env_decl(T) \
00143       template<class I, class N> \
00144       oln_concrete_type(I) \
00145         T##_opening(const abstract::non_vectorial_image<I>& input, \
00146                        const abstract::neighborhood<N>& Ng, \
00147                        const attr_lambda_type(attr::T##_type<I>) &lambda, \
00148                     const attr_env_type(attr::T##_type<I>) &env) \
00149       { \
00150         return tarjan::internal::attr_opening_<I, N, attr::T##_type<I> >(input, Ng, lambda, env); \
00151       }
00152 
00153 # define xxx_closing_im_env_decl(T) \
00154       template<class I, class N> \
00155       oln_concrete_type(I) \
00156         T##_closing(const abstract::non_vectorial_image<I>& input, \
00157                        const abstract::neighborhood<N>& Ng, \
00158                        const attr_lambda_type(attr::T##_type<I>) &lambda, \
00159                     const attr_env_type(attr::T##_type<I>) &env) \
00160       { \
00161         return tarjan::internal::attr_closing_<I, N, attr::T##_type<I> >(input, Ng, lambda, env); \
00162       }
00163 
00189       xxx_closing_decl(card)
00190 
00191       
00216       xxx_opening_decl(card)
00217 
00243       xxx_closing_decl(integral)
00244 
00270       xxx_opening_decl(integral)
00271 
00298       xxx_closing_im_env_decl(volume)
00299 
00300 
00327       xxx_opening_im_env_decl(volume)
00328 
00354       xxx_opening_decl(height)
00355 
00382       xxx_closing_decl(height)
00383 
00384 
00411       xxx_closing_decl(maxvalue)
00412 
00439       xxx_opening_decl(maxvalue)
00440 
00467       xxx_opening_decl(minvalue)
00468 
00495       xxx_closing_decl(minvalue)
00496 
00523       xxx_opening_im_decl(ball)
00524 
00551       xxx_closing_im_decl(ball)
00552 
00579       xxx_opening_im_decl(dist)
00580 
00607       xxx_closing_im_decl(dist)
00608 
00635       xxx_closing_im_decl(cube)
00636 
00663       xxx_opening_im_decl(cube)
00664 
00692       xxx_closing_im_decl(box)
00693 
00721       xxx_opening_im_decl(box)
00722 
00723     } // !fast
00724   } // !morpho
00725 } // !oln
00726 
00727 #endif

Generated on Tue Feb 20 20:17:47 2007 for Olena by  doxygen 1.5.1