Compatibility patch for Boost GIL v1.68

A number of basic typedef were removed in the Boost GIL 1.68 release,
notably `bits32` and `bits32f`. Additionally the
`GIL_DEFINE_ALL_TYPEDEFS` macro signature changed.

This commit introduces compatibility type aliases and conditionally
calls the new macro if `BOOST_VERSION` is high enough.
This commit is contained in:
Tomek Dubrownik 2018-09-29 13:43:44 +08:00 committed by Artem Pavlenko
parent 4698d43234
commit a1543b359f
3 changed files with 20 additions and 2 deletions

View file

@ -48,8 +48,12 @@ typedef mpl::vector3< hsl_color_space::hue_t
/// \ingroup LayoutModel
typedef layout<hsl_t> hsl_layout_t;
#if BOOST_VERSION >= 106800
using bits32f = boost::gil::float32_t;
GIL_DEFINE_ALL_TYPEDEFS( 32f, float32_t, hsl );
#else
GIL_DEFINE_ALL_TYPEDEFS( 32f, hsl );
#endif
/// \ingroup ColorConvert
/// \brief RGB to HSL

View file

@ -49,7 +49,13 @@ typedef mpl::vector3< hsv_color_space::hue_t
typedef layout<hsv_t> hsv_layout_t;
GIL_DEFINE_ALL_TYPEDEFS( 32f, hsv )
#if BOOST_VERSION >= 106800
using bits32 = uint32_t;
using bits32f = float32_t;
GIL_DEFINE_ALL_TYPEDEFS( 32f, float32_t, hsv )
#else
GIL_DEFINE_ALL_TYPEDEFS( 32f, hsv );
#endif
/// \ingroup ColorConvert
/// \brief RGB to HSV

View file

@ -52,6 +52,14 @@
// stl
#include <cmath>
#if BOOST_VERSION >= 106800
namespace boost {
namespace gil {
using bits32f = boost::gil::float32_t;
}
}
#endif
// 8-bit YUV
//Y = ( ( 66 * R + 129 * G + 25 * B + 128) >> 8) + 16
//U = ( ( -38 * R - 74 * G + 112 * B + 128) >> 8) + 128