2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
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
8 #include <boost/gil/bit_aligned_pixel_reference.hpp>
9 #include <boost/gil/packed_pixel.hpp>
10 #include <boost/gil/rgb.hpp>
11 #include <boost/mpl/vector_c.hpp>
12 namespace gil = boost::gil;
13 namespace mpl = boost::mpl;
17 using bgr121_ref_t = gil::bit_aligned_pixel_reference
19 std::uint8_t, mpl::vector3_c<int, 1, 2, 1>, gil::bgr_layout_t, true
22 static_assert(bgr121_ref_t::bit_size == 4,
23 "bit size should be 4");
25 static_assert(std::is_same<bgr121_ref_t::bitfield_t, std::uint8_t>::value,
26 "bit field type should be std::uint8_t");
28 static_assert(std::is_same<bgr121_ref_t::layout_t, gil::bgr_layout_t>::value,
29 "layout type should be bgr");
31 static_assert(std::is_same<decltype(bgr121_ref_t::is_mutable), bool const>::value &&
32 bgr121_ref_t::is_mutable,
33 "is_mutable should be boolean");
35 using packed_pixel_t = gil::packed_pixel
38 typename gil::detail::packed_channel_references_vector_type
40 std::uint8_t, mpl::vector3_c<int, 1, 2, 1>
44 static_assert(std::is_same<bgr121_ref_t::value_type, packed_pixel_t >::value,
45 "value_type should be specialization of packed_pixel");