20 template <
typename DstPixelT>
21 void operator()(
const boost::gil::gray32fc_pixel_t &src, DstPixelT &dst)
const {
22 using namespace boost::gil;
24 const float value = 1.0f + std::log(src[0u]) / 5.70378f;
26 const float clamped = std::max(std::min(value, 1.0f), 0.005f);
28 color_convert(gray32fc_pixel_t{clamped}, dst);
34 template <
typename SrcPixelT,
typename DstPixelT>
35 void operator()(
const SrcPixelT &src, DstPixelT &dst)
const {
36 using namespace boost::gil;
40 sizeof(
typename color_space_type<SrcPixelT>::type) ==
sizeof(uint8_t),
41 "Invalid pixel type.");
44 get_color(src, red_t()) +
45 (get_color(src, green_t()) * 256) +
46 (get_color(src, blue_t()) * 256 * 256);
47 const float normalized = depth /
static_cast<float>(256 * 256 * 256 - 1);
48 color_convert(gray32fc_pixel_t{normalized}, dst);
55 template <
typename SrcPixelT,
typename DstPixelT>
56 void operator()(
const SrcPixelT &src, DstPixelT &dst)
const {
57 using namespace boost::gil;
61 sizeof(
typename color_space_type<SrcPixelT>::type) ==
sizeof(uint8_t),
62 "Invalid pixel type.");
66 color_convert(rgb8c_pixel_t{color[0u], color[1u], color[2u]}, dst);
static constexpr auto GetColor(uint8_t tag)
根据标签返回对应的RGB颜色值。
void operator()(const SrcPixelT &src, DstPixelT &dst) const
void operator()(const SrcPixelT &src, DstPixelT &dst) const
void operator()(const boost::gil::gray32fc_pixel_t &src, DstPixelT &dst) const