Generic Image Library: rgb.hpp Source File

Modules | Alphabetical List | Class List | Directories | File List | GIL Home Page # rgb.hpp Go to the documentation of this file.
    00001 /*
    00002     Copyright 2005-2007 Adobe Systems Incorporated
    00003
    00004     Use, modification and distribution are subject to the Boost Software License,
    00005     Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    00006     http://www.boost.org/LICENSE_1_0.txt).
    00007
    00008     See http://opensource.adobe.com/gil for most recent version including documentation.
    00009 */
    00010
    00011 /*************************************************************************************************/
    00012
    00013 #ifndef GIL_RGB_H
    00014 #define GIL_RGB_H
    00015
    00023
    00024 #include <cstddef>
    00025 #include <boost/mpl/range_c.hpp>
    00026 #include <boost/mpl/vector_c.hpp>
    00027 #include "gil_config.hpp"
    00028 #include "metafunctions.hpp"
    00029 #include "planar_pixel_iterator.hpp"
    00030
    00031 namespace boost { namespace gil {
    00032
    00035
    00037 struct red_t {};
    00038
    00040 struct green_t {};
    00041
    00043 struct blue_t {};
    00045
    00047 typedef mpl::vector3<red_t,green_t,blue_t> rgb_t;
    00048
    00050 typedef layout<rgb_t> rgb_layout_t;
    00052 typedef layout<rgb_t, mpl::vector3_c<int,2,1,0> > bgr_layout_t;
    00053
    00056 template <typename IC>
    00057 inline
    00058 typename type_from_x_iterator<planar_pixel_iterator<IC,rgb_t> >::view_t
    00059 planar_rgb_view(std::size_t width, std::size_t height,
    00060                 IC r, IC g, IC b,
    00061                 std::ptrdiff_t rowsize_in_bytes) {
    00062     typedef typename type_from_x_iterator<planar_pixel_iterator<IC,rgb_t> >::view_t RView;
    00063     return RView(width, height,
    00064                  typename RView::locator(planar_pixel_iterator<IC,rgb_t>(r,g,b),
    00065                                          rowsize_in_bytes));
    00066 }
    00067
    00068 } }  // namespace boost::gil
    00069
    00070 #endif