14 #include <type_traits> 22 template <
typename SrcViewT>
23 using GrayPixelLayout = boost::gil::pixel<typename boost::gil::channel_type<SrcViewT>::type, boost::gil::gray_layout_t>;
25 template <
typename DstPixelT,
typename ImageT>
27 using namespace boost::gil;
30 std::is_same<typename ImageT::pixel_type, sd::Color>::value,
31 "Invalid pixel type");
34 "Invalid pixel size");
35 return interleaved_view(
38 reinterpret_cast<DstPixelT*
>(image.data()),
44 template <
typename ImageT>
46 return boost::gil::view(image);
50 return MakeViewFromSensorImage<boost::gil::bgra8_pixel_t>(image);
54 return MakeViewFromSensorImage<boost::gil::bgra8c_pixel_t>(image);
57 template <
typename SrcViewT,
typename DstPixelT,
typename CC>
59 return _MakeColorConvertedView<DstPixelT>(src, cc);
62 template <
typename SrcViewT,
typename DstPixelT = GrayPixelLayout<SrcViewT>>
64 return _MakeColorConvertedView<DstPixelT>(src, cc);
67 template <
typename SrcViewT,
typename DstPixelT = GrayPixelLayout<SrcViewT>>
69 auto intermediate_view = _MakeColorConvertedView<boost::gil::gray32f_pixel_t>(src,
ColorConverter::Depth());
73 template <
typename SrcViewT,
typename DstPixelT =
typename SrcViewT::value_type>
75 return _MakeColorConvertedView<DstPixelT>(src, cc);
80 template <
typename SrcView,
typename DstP,
typename CC>
83 typedef boost::gil::color_convert_deref_fn<typename SrcView::const_t::reference, DstP, CC>
deref_t;
84 typedef typename SrcView::template add_deref<deref_t>
add_ref_t;
86 typedef typename add_ref_t::type
type;
90 template <
typename DstPixelT,
typename SrcViewT,
typename CC>
Templated image for any type of pixel.
static auto MakeView(sensor::data::ImageTmpl< sensor::data::Color > &image)
static auto MakeColorConvertedView(const SrcViewT &src, ColorConverter::CityScapesPalette cc)
sensor::data::Color Color
static auto MakeColorConvertedView(const SrcViewT &src, ColorConverter::LogarithmicDepth)
static shared_buffer make(const T &buffer)
static auto MakeView(const sensor::data::ImageTmpl< sensor::data::Color > &image)
This file contains definitions of common data structures used in traffic manager. ...
SrcView::template add_deref< deref_t > add_ref_t
static auto MakeViewFromSensorImage(ImageT &image)
static type make(const SrcView &sv, CC cc)
boost::gil::pixel< typename boost::gil::channel_type< SrcViewT >::type, boost::gil::gray_layout_t > GrayPixelLayout
static auto MakeView(ImageT &image)
static auto MakeColorConvertedView(const SrcViewT &src, ColorConverter::Depth cc)
static auto MakeColorConvertedView(const SrcViewT &src, CC cc)
static auto _MakeColorConvertedView(const SrcViewT &src, CC cc)
boost::gil::color_convert_deref_fn< typename SrcView::const_t::reference, DstP, CC > deref_t