TuttleOFX
1
|
00001 // Copyright Tom Brinkman 2008. Distributed under the Boost 00002 // Software License, Version 1.0. (See accompanying 00003 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00004 00005 #ifndef _layers_hpp_ 00006 #define _layers_hpp_ 00007 00008 #include <boost/gil/gil_all.hpp> 00009 #include <boost/function.hpp> 00010 00011 namespace layer 00012 { 00013 00014 template <typename view_t> 00015 struct layers 00016 { 00017 typedef boost::function<void (view_t&)> layer_t; 00018 std::vector<layer_t> lst; 00019 00020 layers(layer_t* p, int n) 00021 { 00022 for (int m = 0; m < n; ++m) 00023 lst.push_back(p[m]); 00024 } 00025 00026 void operator()(view_t& view) 00027 { 00028 for (std::size_t n = 0; n < lst.size(); ++n) 00029 lst[n](view); 00030 } 00031 }; 00032 00033 } 00034 00035 #endif