snark
filters.h
1 // This file is part of snark, a generic and flexible library
2 // for robotics research.
3 //
4 // Copyright (C) 2011 The University of Sydney
5 //
6 // snark is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 3 of the License, or (at your option) any later version.
10 //
11 // snark is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 // for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with snark. If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef SNARK_IMAGING_CVMAT_FILTERS_H_
20 #define SNARK_IMAGING_CVMAT_FILTERS_H_
21 
22 #include <vector>
23 #include <boost/function.hpp>
24 #include <boost/date_time/posix_time/posix_time.hpp>
25 
26 #include <opencv2/core/core.hpp>
27 
28 namespace snark{ namespace cv_mat {
29 
30 struct filter
31 {
32  typedef std::pair< boost::posix_time::ptime, cv::Mat > value_type;
33  filter( boost::function< value_type( value_type ) > f, bool p = true ): filter_function( f ), parallel( p ) {}
34  boost::function< value_type( value_type ) > filter_function;
35  bool parallel;
36 };
37 
39 struct filters
40 {
42  typedef std::pair< boost::posix_time::ptime, cv::Mat > value_type;
43 
45  static std::vector< filter > make( const std::string& how );
46 
48  static value_type apply( std::vector< filter >& filters, value_type m );
49 
51  static const std::string& usage();
52 };
53 
54 } } // namespace snark{ namespace cv_mat {
55 
56 #endif // SNARK_IMAGING_CVMAT_FILTERS_H_