Generic Image Library: rgb.hpp Source File

###  | #  |

rgb.hpp
1//
2// Copyright 2005-2007 Adobe Systems Incorporated
3//
4// Distributed under the Boost Software License, Version 1.0
5// See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt
7//
8#ifndef BOOST_GIL_RGB_HPP
9#define BOOST_GIL_RGB_HPP
10
11#include <boost/gil/metafunctions.hpp>
12#include <boost/gil/planar_pixel_iterator.hpp>
13#include <boost/gil/detail/mp11.hpp>
14
15#include <cstddef>
16#include <type_traits>
17
18namespace boost { namespace gil {
19
22
24 struct red_t {};
25
27 struct green_t {};
28
30 struct blue_t {};
32
34using rgb_t = mp11::mp_list<red_t, green_t, blue_t>;
35
37using rgb_layout_t = layout<rgb_t>;
38
40using bgr_layout_t = layout<rgb_t, mp11::mp_list_c<int, 2, 1, 0>>;
41
44template <typename IC>
45 inline auto planar_rgb_view(
46 std::size_t width, std::size_t height,
47 IC r, IC g, IC b,
48 std::ptrdiff_t rowsize_in_bytes)
49 -> typename type_from_x_iterator<planar_pixel_iterator<IC, rgb_t> >::view_t
50{
51 using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC, rgb_t>>::view_t;
52
53 return view_t(
54 width, height,
55 typename view_t::locator(
56 planar_pixel_iterator<IC, rgb_t>(r, g, b),
57 rowsize_in_bytes));
58}
59
60}} // namespace boost::gil
61
62#endif
boost::gil::planar_rgb_view
auto planar_rgb_view(std::size_t width, std::size_t height, IC r, IC g, IC b, std::ptrdiff_t rowsize_in_bytes) -> typename type_from_x_iterator< planar_pixel_iterator< IC, rgb_t > >::view_t
from raw RGB planar data
Definition rgb.hpp:45
boost
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition algorithm.hpp:36
boost::gil::blue_t
Blue.
Definition rgb.hpp:30
boost::gil::green_t
Green.
Definition rgb.hpp:27
boost::gil::layout
Represents a color space and ordering of channels in memory.
Definition utilities.hpp:268
boost::gil::planar_pixel_iterator
An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept,...
Definition planar_pixel_iterator.hpp:58
boost::gil::red_t
Red.
Definition rgb.hpp:24
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:303