Generic Image Library: rgba.hpp Source File

###  | #  |

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

rgba.hpp
Go to the documentation of this file.
1 /*
2 Copyright 2005-2007 Adobe Systems Incorporated
3
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).
7
8 See http://opensource.adobe.com/gil for most recent version including documentation.
9 */
10 /*************************************************************************************************/
11
12 #ifndef GIL_RGBA_H
13 #define GIL_RGBA_H
14
22
23 #include <cstddef>
24 #include "gil_config.hpp"
25 #include <boost/mpl/contains.hpp>
26 #include "rgb.hpp"
27 #include "planar_pixel_iterator.hpp"
28
29 namespace boost { namespace gil {
30
33 struct alpha_t {};
34
36 typedef mpl::vector4<red_t,green_t,blue_t,alpha_t> rgba_t;
37
39 typedef layout<rgba_t> rgba_layout_t;
41 typedef layout<rgba_t, mpl::vector4_c<int,2,1,0,3> > bgra_layout_t;
43 typedef layout<rgba_t, mpl::vector4_c<int,1,2,3,0> > argb_layout_t;
45 typedef layout<rgba_t, mpl::vector4_c<int,3,2,1,0> > abgr_layout_t;
46
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));
59 }
60
61 } } // namespace boost::gil
62
63 #endif
boost::gil::planar_pixel_iterator
An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept.
Definition: algorithm.hpp:53
planar_pixel_iterator.hpp
planar pixel pointer class
boost::gil::type_from_x_iterator
Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding ...
Definition: metafunctions.hpp:252
boost::gil::alpha_t
Alpha.
Definition: rgba.hpp:33
boost::gil::layout
Represents a color space and ordering of channels in memory.
Definition: utilities.hpp:317
boost::gil::planar_rgba_view
type_from_x_iterator< planar_pixel_iterator< IC, rgba_t > >::view_t planar_rgba_view(std::size_t width, std::size_t height, IC r, IC g, IC b, IC a, std::ptrdiff_t rowsize_in_bytes)
from raw RGBA planar data
Definition: rgba.hpp:52
gil_config.hpp
GIL configuration file.
rgb.hpp
Support for RGB color space and variants.