00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef GIL_DEVICE_N_H
00013 #define GIL_DEVICE_N_H
00014
00015
00023
00024 #include "gil_config.hpp"
00025 #include <boost/type_traits.hpp>
00026 #include <boost/mpl/range_c.hpp>
00027 #include <boost/mpl/vector_c.hpp>
00028
00029 namespace boost { namespace gil {
00030
00033 template <int N> struct devicen_color_t {};
00034
00035 template <int N> struct devicen_t;
00036
00039 template <> struct devicen_t<1> : public mpl::vector1<devicen_color_t<0> > {};
00040
00043 template <> struct devicen_t<2> : public mpl::vector2<devicen_color_t<0>, devicen_color_t<1> > {};
00044
00047 template <> struct devicen_t<3> : public mpl::vector3<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2> > {};
00048
00051 template <> struct devicen_t<4> : public mpl::vector4<devicen_color_t<0>, devicen_color_t<1>, devicen_color_t<2>, devicen_color_t<3> > {};
00052
00055 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> > {};
00056
00059 template <int N> struct devicen_layout_t : public layout<devicen_t<N> > {};
00060
00063 template <typename IC>
00064 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<2> > >::view_t planar_devicen_view(int width, int height, IC c0, IC c1, std::ptrdiff_t rowsize_in_bytes) {
00065 return typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<2> > >::view_t(width, height, planar_pixel_iterator<IC,devicen_t<2> >(c0,c1), rowsize_in_bytes);
00066 }
00067
00070 template <typename IC>
00071 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3> > >::view_t planar_devicen_view(int width, int height, IC c0, IC c1, IC c2, std::ptrdiff_t rowsize_in_bytes) {
00072 return typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<3> > >::view_t(width, height, planar_pixel_iterator<IC,devicen_t<3> >(c0,c1,c2), rowsize_in_bytes);
00073 }
00074
00077 template <typename IC>
00078 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4> > >::view_t planar_devicen_view(int width, int height, IC c0, IC c1, IC c2, IC c3, std::ptrdiff_t rowsize_in_bytes) {
00079 return typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<4> > >::view_t(width, height, planar_pixel_iterator<IC,devicen_t<4> >(c0,c1,c2,c3), rowsize_in_bytes);
00080 }
00081
00084 template <typename IC>
00085 inline typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5> > >::view_t planar_devicen_view(int width, int height, IC c0, IC c1, IC c2, IC c3, IC c4, std::ptrdiff_t rowsize_in_bytes) {
00086 return typename type_from_x_iterator<planar_pixel_iterator<IC,devicen_t<5> > >::view_t(width, height, planar_pixel_iterator<IC,devicen_t<5> >(c0,c1,c2,c3,c4), rowsize_in_bytes);
00087 }
00088
00089 } }
00090
00091 #endif