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");
33 sizeof(sd::Color) ==
sizeof(DstPixelT),
34 "Invalid pixel size");
35 return interleaved_view(
38 reinterpret_cast<DstPixelT*
>(image.data()),
39 sizeof(sd::Color) * image.GetWidth());
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>
static auto MakeView(const sensor::data::ImageTmpl< sensor::data::Color > &image)
static auto MakeView(ImageT &image)
static auto MakeColorConvertedView(const SrcViewT &src, CC cc)
static auto MakeColorConvertedView(const SrcViewT &src, ColorConverter::LogarithmicDepth)
static auto MakeView(sensor::data::ImageTmpl< sensor::data::Color > &image)
static auto MakeColorConvertedView(const SrcViewT &src, ColorConverter::CityScapesPalette cc)
static auto MakeColorConvertedView(const SrcViewT &src, ColorConverter::Depth cc)
boost::gil::pixel< typename boost::gil::channel_type< SrcViewT >::type, boost::gil::gray_layout_t > GrayPixelLayout
static auto MakeViewFromSensorImage(ImageT &image)
static auto _MakeColorConvertedView(const SrcViewT &src, CC cc)
Templated image for any type of pixel.
This file contains definitions of common data structures used in traffic manager.
SrcView::template add_deref< deref_t > add_ref_t
boost::gil::color_convert_deref_fn< typename SrcView::const_t::reference, DstP, CC > deref_t
static type make(const SrcView &sv, CC cc)