supereight
Loading...
Searching...
No Matches
data_colour.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2022 Smart Robotics Lab, Imperial College London, Technical University of Munich
3 * SPDX-FileCopyrightText: 2021-2022 Nils Funk
4 * SPDX-FileCopyrightText: 2021-2022 Sotiris Papatheodorou
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef SE_DATA_COLOUR_HPP
9#define SE_DATA_COLOUR_HPP
10
14
15namespace se {
16
17// Colour data
18template<Colour ColB>
19struct ColourData {
20 struct Config {
21 void readYaml(const std::string& /* yaml_file */)
22 {
23 }
24 };
25};
26
27template<>
30 std::uint8_t weight = 0;
31
35 bool update(const colour_t colour, const std::uint8_t max_weight);
36
39
40 struct Config {
44 void readYaml(const std::string& yaml_file);
45 };
46};
47
48std::ostream& operator<<(std::ostream& os, const ColourData<Colour::Off>::Config& c);
49std::ostream& operator<<(std::ostream& os, const ColourData<Colour::On>::Config& c);
50
51} // namespace se
52
53#include "impl/data_colour_impl.hpp"
54
55#endif // SE_DATA_COLOUR_HPP
Definition image.hpp:19
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
std::ostream & operator<<(std::ostream &os, const ColourData< Colour::Off >::Config &c)
Colour
Definition setup_util.hpp:19
Definition data_colour.hpp:20
void readYaml(const std::string &)
Definition data_colour.hpp:21
void readYaml(const std::string &yaml_file)
Reads the struct members from the "data" node of a YAML file.
bool update(const colour_t colour, const std::uint8_t max_weight)
Perform a weighted averge colour update using colour, while ensuring the weight doesn't exceed max_we...
colour_t colour
Definition data_colour.hpp:29
void setToMean(const BoundedVector< ColourData, 8 > &child_data)
Set to the mean of the data in child_data.
Definition data_colour.hpp:19
Definition config.hpp:105
A colour represented as a Red-Green-Blue tuple with 8-bits per channel.
Definition rgb.hpp:18