8 #ifndef SE_COLOUR_UTILS_HPP 9 #define SE_COLOUR_UTILS_HPP 11 #include <Eigen/Dense> 22 static const std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f>>
scale = {
49 static inline uint32_t
50 pack_rgba(
const uint8_t r,
const uint8_t g,
const uint8_t b,
const uint8_t a);
63 static inline uint32_t
pack_rgba(
const Eigen::Vector4f& color);
76 static inline uint32_t
pack_rgba(
const Eigen::Vector3f& color);
89 static inline uint32_t
pack_rgba(
const Eigen::Vector4i& color);
103 static inline uint32_t
pack_rgba(
const Eigen::Vector3i& color);
113 static inline uint8_t
r_from_rgba(
const uint32_t rgba);
123 static inline uint8_t
g_from_rgba(
const uint32_t rgba);
133 static inline uint8_t
b_from_rgba(
const uint32_t rgba);
143 static inline uint8_t
a_from_rgba(
const uint32_t rgba);
162 static inline uint32_t
blend(
const uint32_t rgba_1,
const uint32_t rgba_2,
const float alpha);
166 static inline void rgb_to_rgba(
const uint8_t* rgb, uint32_t* rgba,
size_t num_pixels);
170 static inline void rgba_to_rgb(
const uint32_t* rgba, uint8_t* rgb,
size_t num_pixels);
187 const float* depth_image_data,
188 const Eigen::Vector2i& depth_image_res,
189 const float min_depth,
190 const float max_depth);
193 #include "impl/colour_utils_impl.hpp" 195 #endif // SE_COLOUR_UTILS_HPP static void rgba_to_rgb(const uint32_t *rgba, uint8_t *rgb, size_t num_pixels)
static uint32_t pack_rgba(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t a)
Pack the individual RGBA channels into a single 32-bit unsigned integer.
static uint8_t r_from_rgba(const uint32_t rgba)
Get the value of the red channel from a 32-bit packed RGBA value.
static void rgb_to_rgba(const uint8_t *rgb, uint32_t *rgba, size_t num_pixels)
static uint32_t blend(const uint32_t rgba_1, const uint32_t rgba_2, const float alpha)
Blend two RGBA colors based on the value of the blending parameter alpha.
void depth_to_rgba(uint32_t *depth_RGBA_image_data, const float *depth_image_data, const Eigen::Vector2i &depth_image_res, const float min_depth, const float max_depth)
Convert a depth image to an RGBA image to allow visualizing it.
static uint8_t a_from_rgba(const uint32_t rgba)
Get the value of the alpha channel from a 32-bit packed RGBA value.
static uint8_t b_from_rgba(const uint32_t rgba)
Get the value of the blue channel from a 32-bit packed RGBA value.
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17
static const std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > scale
The colours used for the various integration scales.
Definition: colour_utils.hpp:22
static uint8_t g_from_rgba(const uint32_t rgba)
Get the value of the green channel from a 32-bit packed RGBA value.