11 A color space captures the set and interpretation of channels comprising a
12 pixel. In Boost.GIL, color space is defined as an MPL random access sequence
13 containing the types of all elements in the color space.
15 Two color spaces are considered *compatible* if they are equal (i.e. have the
16 same set of colors in the same order).
20 - `ColorSpaceConcept<ColorSpace> <reference/structboost_1_1gil_1_1_color_space_concept.html>`_
21 - `ColorSpacesCompatibleConcept<ColorSpace1,ColorSpace2> <reference/structboost_1_1gil_1_1_color_spaces_compatible_concept.html>`_
22 - `ChannelMappingConcept<Mapping> <reference/structboost_1_1gil_1_1_channel_mapping_concept.html>`_
27 GIL currently provides the following color spaces:
34 It also provides unnamed N-channel color spaces of two to five channels:
41 Besides the standard layouts, it also provides:
48 As an example, here is how GIL defines the RGBA color space::
56 rgba_t = using mpl::vector4<red_t, green_t, blue_t, alpha_t>;
58 The ordering of the channels in the color space definition specifies their
59 semantic order. For example, ``red_t`` is the first semantic channel of
60 ``rgba_t``. While there is a unique semantic ordering of the channels in a
61 color space, channels may vary in their physical ordering in memory
63 The mapping of channels is specified by ``ChannelMappingConcept``, which is
64 an MPL random access sequence of integral types.
65 A color space and its associated mapping are often used together.
67 Thus they are grouped in GIL's layout:
74 typename ChannelMapping = mpl::range_c<int, 0, mpl::size<ColorSpace>::value>
78 using color_space_t = ColorSpace;
79 using channel_mapping_t = ChannelMapping;
82 Here is how to create layouts for the RGBA color space:
86 using rgba_layout_t = layout<rgba_t>; // default ordering is 0,1,2,3...
87 using bgra_layout_t = layout<rgba_t, mpl::vector4_c<int,2,1,0,3>>;
88 using argb_layout_t = layout<rgba_t, mpl::vector4_c<int,1,2,3,0>>;
89 using abgr_layout_t = layout<rgba_t, mpl::vector4_c<int,3,2,1,0>>;