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.
10 /*************************************************************************************************/
15 ////////////////////////////////////////////////////////////////////////////////////////
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 ////////////////////////////////////////////////////////////////////////////////////////
24 #include "gil_config.hpp"
25 #include <boost/mpl/contains.hpp>
27 #include "planar_pixel_iterator.hpp"
29 namespace boost
{ namespace gil
{
31 /// \ingroup ColorNameModel
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
>
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
),
61 } } // namespace boost::gil