8 #ifndef BOOST_GIL_DEVICE_N_HPP
9 #define BOOST_GIL_DEVICE_N_HPP
11 #include <boost/gil/metafunctions.hpp>
12 #include <boost/gil/utilities.hpp>
14 #include <boost/config.hpp>
15 #include <boost/mpl/range_c.hpp>
16 #include <boost/mpl/vector_c.hpp>
17 #include <boost/type_traits.hpp>
21 namespace boost {
namespace gil {
27 template <
int N>
struct devicen_t;
31 template <>
struct devicen_t<1> :
public mpl::vector1<devicen_color_t<0> > {};
35 template <>
struct devicen_t<2> :
public mpl::vector2<devicen_color_t<0>, devicen_color_t<1> > {};
39 template <>
struct devicen_t<3> :
public mpl::vector3<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2> > {};
43 template <>
struct devicen_t<4> :
public mpl::vector4<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2>, devicen_color_t<3> > {};
47 template <>
struct devicen_t<5> :
public mpl::vector5<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2>, devicen_color_t<3>, devicen_color_t<4> > {};
55 template <
typename IC>
57 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes) {
59 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1), rowsize_in_bytes));
64 template <
typename IC>
65 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3> > >::view_t
66 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes) {
68 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1,c2), rowsize_in_bytes));
73 template <
typename IC>
74 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4> > >::view_t
75 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, std::ptrdiff_t rowsize_in_bytes) {
77 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1,c2,c3), rowsize_in_bytes));
82 template <
typename IC>
83 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5> > >::view_t
84 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes) {
86 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1,c2,c3,c4), rowsize_in_bytes));
type_from_x_iterator< planar_pixel_iterator< IC, devicen_t< 5 > > >::view_t planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes)
from 5-channel planar data
Definition: device_n.hpp:84
Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
Definition: metafunctions.hpp:238
unnamed color
Definition: device_n.hpp:25
Represents a color space and ordering of channels in memory.
Definition: utilities.hpp:246
unnamed color layout of up to five channels
Definition: device_n.hpp:51