update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -14,8 +14,8 @@
#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/channel.hpp>
#include <boost/gil/detail/mp11.hpp>
#include <boost/mpl/at.hpp>
#include <boost/utility/enable_if.hpp> // boost::lazy_enable_if
namespace boost{ namespace gil {
@@ -29,7 +29,7 @@ struct gen_chan_ref
using type = packed_dynamic_channel_reference
<
B,
mpl::at_c<C, 0>::type::value,
mp11::mp_at_c<C, 0>::value,
M
>;
};
@@ -58,27 +58,27 @@ struct gen_chan_ref_p
using type = packed_dynamic_channel_reference
<
B,
get_num_bits<typename mpl::at_c<C, 0>::type>::value,
get_num_bits<mp11::mp_at_c<C, 0>>::value,
true
>;
};
// packed_pixel
template < typename BitField
, typename ChannelRefVec
, typename ChannelRefs
, typename Layout
>
struct channel_type< packed_pixel< BitField
, ChannelRefVec
, ChannelRefs
, Layout
>
> : lazy_enable_if< is_homogeneous< packed_pixel< BitField
, ChannelRefVec
, ChannelRefs
, Layout
>
>
, gen_chan_ref_p< BitField
, ChannelRefVec
, ChannelRefs
, Layout
>
> {};

View File

@@ -13,28 +13,28 @@
namespace boost {
namespace gil {
template < typename Channel
, typename View
>
template <typename Channel, typename View>
struct channel_type_to_index
{
static const int value = detail::type_to_index< typename color_space_type< View >::type // color (mpl::vector)
, Channel // channel type
>::value; //< index of the channel in the color (mpl::vector)
static constexpr int value = detail::type_to_index
<
typename color_space_type<View>::type, // color (Boost.MP11-compatible list)
Channel // channel type
>::value; // index of the channel in the color (Boost.MP11-compatible list)
};
template< typename Channel
, typename View
>
struct channel_view_type : public kth_channel_view_type< channel_type_to_index< Channel
, View
>::value
, View
>
template<typename Channel, typename View>
struct channel_view_type : kth_channel_view_type
<
channel_type_to_index<Channel, View>::value,
View
>
{
static const int index = channel_type_to_index< Channel
, View
>::value;
static constexpr int index = channel_type_to_index
<
Channel,
View
>::value;
using parent_t = kth_channel_view_type<index, View>;
using type = typename parent_t::type;
@@ -46,19 +46,13 @@ struct channel_view_type : public kth_channel_view_type< channel_type_to_index<
};
/// \ingroup ImageViewTransformationsKthChannel
template< typename Channel
, typename View
>
typename channel_view_type< Channel
, View
>::type channel_view( const View& src )
template<typename Channel, typename View>
auto channel_view(View const& src)
-> typename channel_view_type<Channel, View>::type
{
return channel_view_type< Channel
, View
>::make( src );
return channel_view_type<Channel, View>::make(src);
}
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif

View File

@@ -9,13 +9,8 @@
#define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_GET_NUM_BITS_HPP
#include <boost/gil/channel.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/size_t.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/gil/detail/is_channel_integral.hpp>
#include <boost/gil/detail/mp11.hpp>
#include <type_traits>
@@ -24,50 +19,53 @@ namespace boost{ namespace gil {
/// get_num_bits metafunctions
/// \brief Determines the numbers of bits for the given channel type.
template <typename T, class = void >
template <typename T, class = void>
struct get_num_bits;
template< typename B, int I, int S, bool M >
struct get_num_bits< packed_channel_reference< B, I, S, M > > : mpl::int_< S >
template<typename B, int I, int S, bool M>
struct get_num_bits<packed_channel_reference<B, I, S, M>>
: std::integral_constant<int, S>
{};
template< typename B, int I, int S, bool M >
struct get_num_bits< const packed_channel_reference< B, I, S, M > > : mpl::int_< S >
template<typename B, int I, int S, bool M>
struct get_num_bits<packed_channel_reference<B, I, S, M> const>
: std::integral_constant<int, S>
{};
template<typename B, int I, bool M>
struct get_num_bits< packed_dynamic_channel_reference< B, I, M > > : mpl::int_< I >
struct get_num_bits<packed_dynamic_channel_reference<B, I, M>>
: std::integral_constant<int, I>
{};
template<typename B, int I, bool M>
struct get_num_bits< const packed_dynamic_channel_reference< B, I, M > > : mpl::int_< I >
struct get_num_bits<packed_dynamic_channel_reference<B, I, M> const>
: std::integral_constant<int, I>
{};
template< int N >
struct get_num_bits< packed_channel_value< N > > : mpl::int_< N >
template<int N>
struct get_num_bits<packed_channel_value<N>> : std::integral_constant<int, N>
{};
template< int N >
struct get_num_bits< const packed_channel_value< N > > : mpl::int_< N >
template<int N>
struct get_num_bits<packed_channel_value<N> const> : std::integral_constant<int, N>
{};
template <typename T>
struct get_num_bits
<
T,
typename std::enable_if
<
mpl::and_
T,
typename std::enable_if
<
is_integral<T>,
mpl::not_<is_class<T>>
>::value
>::type
> : mpl::size_t<sizeof(T) * 8>
{
};
mp11::mp_and
<
detail::is_channel_integral<T>,
mp11::mp_not<std::is_class<T>>
>::value
>::type
>
: std::integral_constant<std::size_t, sizeof(T) * 8>
{};
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif

View File

@@ -11,25 +11,31 @@
#include <boost/gil/extension/toolbox/dynamic_images.hpp>
#include <boost/gil/extension/toolbox/metafunctions/is_bit_aligned.hpp>
#include <boost/gil/detail/mp11.hpp>
namespace boost{ namespace gil {
/// get_pixel_type metafunction
/// \brief Depending on Image this function generates either
/// the pixel type or the reference type in case
/// the image is bit_aligned.
template< typename View >
struct get_pixel_type : mpl::if_< typename is_bit_aligned< typename View::value_type >::type
, typename View::reference
, typename View::value_type
> {};
template<typename View>
struct get_pixel_type
{
using type = mp11::mp_if
<
is_bit_aligned<typename View::value_type>,
typename View::reference,
typename View::value_type
>;
};
template< typename ImageViewTypes >
struct get_pixel_type< any_image_view< ImageViewTypes > >
template<typename ...Views>
struct get_pixel_type<any_image_view<Views...>>
{
using type = any_image_pixel_t;
};
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif

View File

@@ -10,27 +10,28 @@
#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <type_traits>
namespace boost{ namespace gil {
/// is_bit_aligned metafunctions
/// \brief Determines whether the given type is bit_aligned.
template< typename PixelRef >
struct is_bit_aligned : mpl::false_{};
struct is_bit_aligned : std::false_type {};
template <typename B, typename C, typename L, bool M>
struct is_bit_aligned<bit_aligned_pixel_reference<B,C,L,M> > : mpl::true_{};
struct is_bit_aligned<bit_aligned_pixel_reference<B, C, L, M>> : std::true_type {};
template <typename B, typename C, typename L, bool M>
struct is_bit_aligned<const bit_aligned_pixel_reference<B,C,L,M> > : mpl::true_{};
struct is_bit_aligned<bit_aligned_pixel_reference<B, C, L, M> const> : std::true_type {};
template <typename B, typename C, typename L>
struct is_bit_aligned<packed_pixel<B,C,L> > : mpl::true_{};
struct is_bit_aligned<packed_pixel<B, C, L>> : std::true_type {};
template <typename B, typename C, typename L>
struct is_bit_aligned<const packed_pixel<B,C,L> > : mpl::true_{};
struct is_bit_aligned<packed_pixel<B, C, L> const> : std::true_type {};
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif

View File

@@ -9,74 +9,91 @@
#define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_HOMOGENEOUS_HPP
#include <boost/gil/pixel.hpp>
#include <boost/gil/detail/mp11.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/at.hpp>
#include <type_traits>
namespace boost{ namespace gil {
/// is_homogeneous metafunctions
/// \brief Determines if a pixel types are homogeneous.
template<typename C,typename CMP, int Next, int Last> struct is_homogeneous_impl;
template<typename C,typename CMP, int Last>
struct is_homogeneous_impl<C,CMP,Last,Last> : mpl::true_{};
template<typename C,typename CMP, int Next, int Last>
struct is_homogeneous_impl : mpl::and_< is_homogeneous_impl< C, CMP,Next + 1, Last >
, is_same< CMP, typename mpl::at_c<C,Next>::type
> > {};
struct is_homogeneous_impl;
template < typename P > struct is_homogeneous : mpl::false_ {};
template<typename C, typename CMP, int Last>
struct is_homogeneous_impl<C, CMP, Last, Last> : std::true_type {};
template<typename C, typename CMP, int Next, int Last>
struct is_homogeneous_impl
: mp11::mp_and
<
is_homogeneous_impl<C, CMP, Next + 1, Last>,
std::is_same<CMP, mp11::mp_at_c<C, Next>>
>
{};
template <typename P>
struct is_homogeneous : std::false_type {};
// pixel
template < typename C, typename L > struct is_homogeneous< pixel<C,L> > : mpl::true_ {};
template < typename C, typename L > struct is_homogeneous<const pixel<C,L> > : mpl::true_ {};
template < typename C, typename L > struct is_homogeneous< pixel<C,L>& > : mpl::true_ {};
template < typename C, typename L > struct is_homogeneous<const pixel<C,L>& > : mpl::true_ {};
template <typename C, typename L>
struct is_homogeneous<pixel<C, L>> : std::true_type {};
template <typename C, typename L >
struct is_homogeneous<pixel<C, L> const> : std::true_type {};
template <typename C, typename L>
struct is_homogeneous<pixel<C, L>&> : std::true_type {};
template <typename C, typename L>
struct is_homogeneous<pixel<C, L> const&> : std::true_type {};
// planar pixel reference
template <typename Channel, typename ColorSpace>
struct is_homogeneous< planar_pixel_reference< Channel, ColorSpace > > : mpl::true_ {};
template <typename Channel, typename ColorSpace>
struct is_homogeneous< const planar_pixel_reference< Channel, ColorSpace > > : mpl::true_ {};
struct is_homogeneous<planar_pixel_reference<Channel, ColorSpace>> : std::true_type {};
template<typename C,typename CMP, int I,int Last>
template <typename Channel, typename ColorSpace>
struct is_homogeneous<planar_pixel_reference<Channel, ColorSpace> const> : std::true_type {};
template<typename C, typename CMP, int I, int Last>
struct is_homogeneous_impl_p {};
// for packed_pixel
template <typename B, typename C, typename L >
struct is_homogeneous<packed_pixel< B, C, L > >
: is_homogeneous_impl_p< C
, typename mpl::at_c< C, 0 >::type
, 1
, mpl::size< C >::value
> {};
template <typename B, typename C, typename L>
struct is_homogeneous<packed_pixel<B, C, L>>
: is_homogeneous_impl_p
<
C,
mp11::mp_at_c<C, 0>,
1,
mp11::mp_size<C>::value
> {};
template< typename B
, typename C
, typename L
>
struct is_homogeneous< const packed_pixel< B, C, L > >
: is_homogeneous_impl_p< C
, typename mpl::at_c<C,0>::type
, 1
, mpl::size< C >::value
> {};
struct is_homogeneous<packed_pixel<B, C, L> const>
: is_homogeneous_impl_p
<
C,
mp11::mp_at_c<C, 0>,
1,
mp11::mp_size<C>::value
> {};
// for bit_aligned_pixel_reference
template <typename B, typename C, typename L, bool M>
struct is_homogeneous<bit_aligned_pixel_reference<B,C,L,M> >
: is_homogeneous_impl<C,typename mpl::at_c<C,0>::type,1,mpl::size<C>::value>
struct is_homogeneous<bit_aligned_pixel_reference<B, C, L, M>>
: is_homogeneous_impl<C, mp11::mp_at_c<C, 0>, 1, mp11::mp_size<C>::value>
{};
template <typename B, typename C, typename L, bool M>
struct is_homogeneous<const bit_aligned_pixel_reference<B,C,L,M> >
: is_homogeneous_impl<C,typename mpl::at_c<C,0>::type,1,mpl::size<C>::value>
struct is_homogeneous<const bit_aligned_pixel_reference<B, C, L, M> >
: is_homogeneous_impl<C, mp11::mp_at_c<C, 0>, 1, mp11::mp_size<C>::value>
{};
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif

View File

@@ -10,23 +10,26 @@
#include <boost/gil/channel.hpp>
#include <type_traits>
namespace boost{ namespace gil {
/// is_similar metafunctions
/// \brief Determines if two pixel types are similar.
template< typename A, typename B >
struct is_similar : mpl::false_ {};
template<typename A, typename B>
struct is_similar : std::false_type {};
template<typename A>
struct is_similar< A, A > : mpl::true_ {};
struct is_similar<A, A> : std::true_type {};
template<typename B,int I, int S, bool M, int I2>
struct is_similar< packed_channel_reference< B, I, S, M >
, packed_channel_reference< B, I2, S, M >
> : mpl::true_ {};
struct is_similar
<
packed_channel_reference<B, I, S, M>,
packed_channel_reference<B, I2, S, M>
> : std::true_type {};
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif

View File

@@ -11,9 +11,6 @@
#include <boost/gil/bit_aligned_pixel_reference.hpp>
#include <boost/gil/packed_pixel.hpp>
#include <boost/mpl/accumulate.hpp>
#include <boost/mpl/int.hpp>
namespace boost{ namespace gil {
/// pixel_bit_size metafunctions
@@ -23,22 +20,50 @@ namespace boost{ namespace gil {
/// using image_t = bit_aligned_image5_type<16, 16, 16, 8, 8, devicen_layout_t<5>>::type;
/// const int size = pixel_bit_size<image_t::view_t::reference>::value;
/// \endcode
template< typename PixelRef >
struct pixel_bit_size : mpl::int_<0> {};
template< typename PixelRef>
struct pixel_bit_size : std::integral_constant<int, 0> {};
template <typename B, typename C, typename L, bool M>
struct pixel_bit_size<bit_aligned_pixel_reference<B,C,L,M> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
struct pixel_bit_size<bit_aligned_pixel_reference<B, C, L, M>>
: mp11::mp_fold
<
C,
std::integral_constant<int, 0>,
mp11::mp_plus
>
{};
template <typename B, typename C, typename L, bool M>
struct pixel_bit_size<const bit_aligned_pixel_reference<B,C,L,M> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
struct pixel_bit_size<bit_aligned_pixel_reference<B, C, L, M> const>
: mp11::mp_fold
<
C,
std::integral_constant<int, 0>,
mp11::mp_plus
>
{};
template <typename B, typename C, typename L>
struct pixel_bit_size<packed_pixel<B,C,L> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
struct pixel_bit_size<packed_pixel<B, C, L>>
: mp11::mp_fold
<
C,
std::integral_constant<int, 0>,
mp11::mp_plus
>
{};
template <typename B, typename C, typename L>
struct pixel_bit_size<const packed_pixel<B,C,L> > : mpl::int_< mpl::accumulate< C, mpl::int_<0>, mpl::plus<mpl::_1, mpl::_2> >::type::value >{};
struct pixel_bit_size<const packed_pixel<B,C,L> >
: mp11::mp_fold
<
C,
std::integral_constant<int, 0>,
mp11::mp_plus
>
{};
} // namespace gil
} // namespace boost
}} // namespace boost::gil
#endif