Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/gil/rgb.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // Copyright 2005-2007 Adobe Systems Incorporated
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 #ifndef BOOST_GIL_RGB_HPP
0009 #define BOOST_GIL_RGB_HPP
0010 
0011 #include <boost/gil/metafunctions.hpp>
0012 #include <boost/gil/planar_pixel_iterator.hpp>
0013 #include <boost/gil/detail/mp11.hpp>
0014 
0015 #include <cstddef>
0016 #include <type_traits>
0017 
0018 namespace boost { namespace gil {
0019 
0020 /// \addtogroup ColorNameModel
0021 /// \{
0022 
0023 /// \brief Red
0024 struct red_t {};
0025 
0026 /// \brief Green
0027 struct green_t {};
0028 
0029 /// \brief Blue
0030 struct blue_t {};
0031 /// \}
0032 
0033 /// \ingroup ColorSpaceModel
0034 using rgb_t = mp11::mp_list<red_t, green_t, blue_t>;
0035 
0036 /// \ingroup LayoutModel
0037 using rgb_layout_t = layout<rgb_t>;
0038 
0039 /// \ingroup LayoutModel
0040 using bgr_layout_t = layout<rgb_t, mp11::mp_list_c<int, 2, 1, 0>>;
0041 
0042 /// \ingroup ImageViewConstructors
0043 /// \brief from raw RGB planar data
0044 template <typename IC>
0045 inline auto planar_rgb_view(
0046     std::size_t width, std::size_t height,
0047     IC r, IC g, IC b,
0048     std::ptrdiff_t rowsize_in_bytes)
0049     -> typename type_from_x_iterator<planar_pixel_iterator<IC, rgb_t> >::view_t
0050 {
0051     using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC, rgb_t>>::view_t;
0052 
0053     return view_t(
0054         width, height,
0055         typename view_t::locator(
0056             planar_pixel_iterator<IC, rgb_t>(r, g, b),
0057             rowsize_in_bytes));
0058 }
0059 
0060 }}  // namespace boost::gil
0061 
0062 #endif