Modules | Alphabetical List | Class List | Directories | File List | File Members | GIL Home Page # rgba.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 #ifndef GIL_RGBA_H
    00013 #define GIL_RGBA_H
    00014
    00022
    00023 #include "gil_config.hpp"
    00024 #include <boost/mpl/contains.hpp>
    00025 #include "rgb.hpp"
    00026 #include "planar_pixel_iterator.hpp"
    00027
    00028 namespace boost { namespace gil {
    00029
    00032 struct alpha_t {};
    00033
    00035 typedef mpl::vector4<red_t,green_t,blue_t,alpha_t> rgba_t;
    00036
    00038 typedef layout<rgba_t> rgba_layout_t;
    00040 typedef layout<rgba_t, mpl::vector4_c<int,2,1,0,3> > bgra_layout_t;
    00042 typedef layout<rgba_t, mpl::vector4_c<int,1,2,3,0> > argb_layout_t;
    00044 typedef layout<rgba_t, mpl::vector4_c<int,3,2,1,0> > abgr_layout_t;
    00045
    00048 template <typename IC>
    00049 inline
    00050 typename type_from_x_iterator<planar_pixel_iterator<IC,rgba_t> >::view_t
    00051 planar_rgba_view(int width, int height,
    00052                  IC r, IC g, IC b, IC a,
    00053                  std::ptrdiff_t rowsize_in_bytes) {
    00054     typedef typename type_from_x_iterator<planar_pixel_iterator<IC,rgba_t> >::view_t RView;
    00055     return RView(width, height,
    00056                  typename RView::locator(planar_pixel_iterator<IC,rgba_t>(r,g,b,a),
    00057                                          rowsize_in_bytes));
    00058 }
    00059
    00060 } }  // namespace boost::gil
    00061
    00062 #endif