fix doc example typo
[boost.git] / boost / gil / rgba.hpp
blob209d702e42f5172b5d8ec8b810f4a7eb3e978dd3
1 /*
2 Copyright 2005-2007 Adobe Systems Incorporated
4 Use, modification and distribution are subject to the Boost Software License,
5 Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt).
8 See http://opensource.adobe.com/gil for most recent version including documentation.
9 */
10 /*************************************************************************************************/
12 #ifndef GIL_RGBA_H
13 #define GIL_RGBA_H
15 ////////////////////////////////////////////////////////////////////////////////////////
16 /// \file
17 /// \brief Support for RGBA color space and variants
18 /// \author Lubomir Bourdev and Hailin Jin \n
19 /// Adobe Systems Incorporated
20 /// \date 2005-2007 \n Last updated on October 10, 2007
21 ////////////////////////////////////////////////////////////////////////////////////////
23 #include <cstddef>
24 #include "gil_config.hpp"
25 #include <boost/mpl/contains.hpp>
26 #include "rgb.hpp"
27 #include "planar_pixel_iterator.hpp"
29 namespace boost { namespace gil {
31 /// \ingroup ColorNameModel
32 /// \brief Alpha
33 struct alpha_t {};
35 /// \ingroup ColorSpaceModel
36 typedef mpl::vector4<red_t,green_t,blue_t,alpha_t> rgba_t;
38 /// \ingroup LayoutModel
39 typedef layout<rgba_t> rgba_layout_t;
40 /// \ingroup LayoutModel
41 typedef layout<rgba_t, mpl::vector4_c<int,2,1,0,3> > bgra_layout_t;
42 /// \ingroup LayoutModel
43 typedef layout<rgba_t, mpl::vector4_c<int,1,2,3,0> > argb_layout_t;
44 /// \ingroup LayoutModel
45 typedef layout<rgba_t, mpl::vector4_c<int,3,2,1,0> > abgr_layout_t;
47 /// \ingroup ImageViewConstructors
48 /// \brief from raw RGBA planar data
49 template <typename IC>
50 inline
51 typename type_from_x_iterator<planar_pixel_iterator<IC,rgba_t> >::view_t
52 planar_rgba_view(std::size_t width, std::size_t height,
53 IC r, IC g, IC b, IC a,
54 std::ptrdiff_t rowsize_in_bytes) {
55 typedef typename type_from_x_iterator<planar_pixel_iterator<IC,rgba_t> >::view_t RView;
56 return RView(width, height,
57 typename RView::locator(planar_pixel_iterator<IC,rgba_t>(r,g,b,a),
58 rowsize_in_bytes));
61 } } // namespace boost::gil
63 #endif