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, 59 Temple Place - Suite 330, Boston,
00016 // MA 02111-1307, 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 
00166       xxx_closing_decl(card);
00167 
00193       xxx_opening_decl(card);
00194 
00220       xxx_closing_decl(integral);
00221 
00247       xxx_opening_decl(integral);
00248 
00274       xxx_opening_decl(height);
00275 
00302       xxx_closing_decl(height);
00303 
00304 
00331       xxx_closing_decl(maxvalue);
00332 
00359       xxx_opening_decl(maxvalue);
00360 
00387       xxx_opening_decl(minvalue);
00388 
00415       xxx_closing_decl(minvalue);
00416 
00443       xxx_opening_im_decl(ball);
00444 
00471       xxx_closing_im_decl(ball);
00472 
00499       xxx_opening_im_decl(dist);
00500 
00527       xxx_closing_im_decl(dist);
00528 
00555       xxx_closing_im_decl(cube);
00556 
00583       xxx_opening_im_decl(cube);
00584 
00612       xxx_closing_im_decl(box);
00613 
00641       xxx_opening_im_decl(box);
00642 
00643     } // !fast
00644   } // !morpho
00645 } // !oln
00646 
00647 #endif

Generated on Thu Apr 15 20:13:05 2004 for Olena by doxygen 1.3.6-20040222