23 template <
typename SrcViewT>
24 using GrayPixelLayout = boost::gil::pixel<typename boost::gil::channel_type<SrcViewT>::type, boost::gil::gray_layout_t>;
27 template <
typename DstPixelT,
typename ImageT>
29 using namespace boost::gil;
32 std::is_same<typename ImageT::pixel_type, sd::Color>::value,
33 "Invalid pixel type");
35 sizeof(sd::Color) ==
sizeof(DstPixelT),
36 "Invalid pixel size");
37 return interleaved_view(
40 reinterpret_cast<DstPixelT*
>(image.data()),
41 sizeof(sd::Color) * image.GetWidth());
47 template <
typename ImageT>
49 return boost::gil::view(image);
54 return MakeViewFromSensorImage<boost::gil::bgra8_pixel_t>(image);
59 return MakeViewFromSensorImage<boost::gil::bgra8c_pixel_t>(image);
63 template <
typename SrcViewT,
typename DstPixelT,
typename CC>
65 return _MakeColorConvertedView<DstPixelT>(src,
cc);
69 template <
typename SrcViewT,
typename DstPixelT = GrayPixelLayout<SrcViewT>>
71 return _MakeColorConvertedView<DstPixelT>(src,
cc);
75 template <
typename SrcViewT,
typename DstPixelT = GrayPixelLayout<SrcViewT>>
77 auto intermediate_view = _MakeColorConvertedView<boost::gil::gray32f_pixel_t>(src,
ColorConverter::Depth());
82 template <
typename SrcViewT,
typename DstPixelT =
typename SrcViewT::value_type>
84 return _MakeColorConvertedView<DstPixelT>(src,
cc);
90 template <
typename SrcView,
typename DstP,
typename CC>
93 typedef boost::gil::color_convert_deref_fn<typename SrcView::const_t::reference, DstP, CC>
deref_t;
94 typedef typename SrcView::template add_deref<deref_t>
add_ref_t;
96 typedef typename add_ref_t::type
type;
101 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.
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)