12 #ifndef GIL_DEVICE_N_H
13 #define GIL_DEVICE_N_H
26 #include <boost/type_traits.hpp>
27 #include <boost/config.hpp>
28 #include <boost/mpl/range_c.hpp>
29 #include <boost/mpl/vector_c.hpp>
35 namespace boost {
namespace gil {
41 template <
int N>
struct devicen_t;
45 template <>
struct devicen_t<1> :
public mpl::vector1<devicen_color_t<0> > {};
49 template <>
struct devicen_t<2> :
public mpl::vector2<devicen_color_t<0>, devicen_color_t<1> > {};
53 template <>
struct devicen_t<3> :
public mpl::vector3<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2> > {};
57 template <>
struct devicen_t<4> :
public mpl::vector4<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2>, devicen_color_t<3> > {};
61 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> > {};
69 template <
typename IC>
71 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes) {
73 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1), rowsize_in_bytes));
78 template <
typename IC>
79 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3> > >::view_t
80 planar_devicen_view(std::size_t width, std::size_t height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes) {
82 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1,c2), rowsize_in_bytes));
87 template <
typename IC>
88 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4> > >::view_t
89 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) {
91 return view_t(width, height,
typename view_t::locator(
typename view_t::x_iterator(c0,c1,c2,c3), rowsize_in_bytes));
96 template <
typename IC>
97 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5> > >::view_t
98 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) {
100 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:98
Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
Definition: metafunctions.hpp:252
unnamed color
Definition: device_n.hpp:39
Represents a color space and ordering of channels in memory.
Definition: utilities.hpp:317
unnamed color layout of up to five channels
Definition: device_n.hpp:65
Various utilities not specific to the image library. Some are non-standard STL extensions or generic ...