2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 #include <boost/gil.hpp>
9 #include <boost/gil/extension/dynamic_image/any_image.hpp>
10 #include <boost/mp11.hpp>
14 namespace boost { namespace gil {
16 namespace test { namespace fixture {
18 using dynamic_image = gil::any_image
37 template <typename Image>
40 using result_type = void;
41 using pixel_t = typename Image::value_type;
43 fill_any_view(std::initializer_list<int> dst_view_indices, pixel_t pixel_value)
44 : dst_view_indices_(dst_view_indices), pixel_value_(pixel_value)
47 template <typename View>
48 void operator()(View& /*dst_view*/) { /* sink any other views here */ }
50 void operator()(typename Image::view_t& dst_view)
52 // sink view of interest here
53 for (auto const& i : dst_view_indices_)
54 dst_view[i] = pixel_value_;
57 std::initializer_list<int> dst_view_indices_;
61 }}}} // namespace boost::gil::test::fixture