21 #include "glog/logging.h" 26 std::unique_ptr<ColoringPointsProcessor>
30 const string frame_id = dictionary->
GetString(
"frame_id");
31 const std::vector<double> color_values =
32 dictionary->
GetDictionary(
"color")->GetArrayValuesAsDoubles();
33 const Color color = {{
static_cast<uint8_t
>(color_values[0]),
34 static_cast<uint8_t>(color_values[1]),
35 static_cast<uint8_t
>(color_values[2])}};
36 return common::make_unique<ColoringPointsProcessor>(color, frame_id, next);
40 const string& frame_id,
46 batch->colors.clear();
47 for (
size_t i = 0; i < batch->points.size(); ++i) {
48 batch->colors.push_back(
color_);
virtual void Process(std::unique_ptr< PointsBatch > points_batch)=0
ColoringPointsProcessor(const Color &color, const string &frame_id, PointsProcessor *next)
void Process(std::unique_ptr< PointsBatch > batch) override
FlushResult Flush() override
std::array< uint8_t, 3 > Color
virtual FlushResult Flush()=0
PointsProcessor *const next_
string GetString(const string &key)
std::unique_ptr< LuaParameterDictionary > GetDictionary(const string &key)
static std::unique_ptr< ColoringPointsProcessor > FromDictionary(common::LuaParameterDictionary *dictionary, PointsProcessor *next)