19 template <
typename DstPixelT>
20 void operator()(
const boost::gil::gray32fc_pixel_t &src, DstPixelT &dst)
const {
21 using namespace boost::gil;
22 const float value = 1.0f +
std::log(src[0u]) / 5.70378f;
23 const float clamped = std::max(
std::min(value, 1.0f), 0.005f);
24 color_convert(gray32fc_pixel_t{clamped}, dst);
29 template <
typename SrcPixelT,
typename DstPixelT>
30 void operator()(
const SrcPixelT &src, DstPixelT &dst)
const {
31 using namespace boost::gil;
33 sizeof(
typename color_space_type<SrcPixelT>::type) ==
sizeof(uint8_t),
34 "Invalid pixel type.");
36 get_color(src, red_t()) +
37 (get_color(src, green_t()) * 256) +
38 (get_color(src, blue_t()) * 256 * 256);
39 const float normalized = depth /
static_cast<float>(256 * 256 * 256 - 1);
40 color_convert(gray32fc_pixel_t{normalized}, dst);
47 template <
typename SrcPixelT,
typename DstPixelT>
48 void operator()(
const SrcPixelT &src, DstPixelT &dst)
const {
49 using namespace boost::gil;
51 sizeof(
typename color_space_type<SrcPixelT>::type) ==
sizeof(uint8_t),
52 "Invalid pixel type.");
54 color_convert(rgb8c_pixel_t{color[0u], color[1u], color[2u]}, dst);
static void log(Args &&... args)
void operator()(const SrcPixelT &src, DstPixelT &dst) const
This file contains definitions of common data structures used in traffic manager. ...
static constexpr auto GetColor(uint8_t tag)
Return an RGB uint8_t array.
void operator()(const boost::gil::gray32fc_pixel_t &src, DstPixelT &dst) const
double min(double v1, double v2)
void operator()(const SrcPixelT &src, DstPixelT &dst) const