ColorAlgorithms.hpp
Go to the documentation of this file.
1 
28 /*
29  * ColorAlgorithms.hpp
30  *
31  * Collection of algorithms for color calculation.
32  *
33  * @date 21.07.2017
34  * @author Johan M. von Behren <johan@vonbehren.eu>
35  */
36 
37 #ifndef LVR2_ALGORITHM_COLORALGORITHMS_H_
38 #define LVR2_ALGORITHM_COLORALGORITHMS_H_
39 
40 #include <vector>
41 #include <array>
42 
43 #include <boost/optional.hpp>
44 
45 
46 
50 
51 namespace lvr2
52 {
53 
54 using Rgb8Color = std::array<uint8_t, 3>;
55 
67 template<typename BaseVecT>
68 boost::optional<DenseVertexMap<Rgb8Color>> calcColorFromPointCloud(
69  const BaseMesh<BaseVecT>& mesh,
70  const PointsetSurfacePtr<BaseVecT> surface
71 );
72 
84 static Rgb8Color floatToRainbowColor(float value);
85 
97 static Rgb8Color floatToGrayScaleColor(float value);
98 
111 template<typename BaseVecT>
113  const BaseMesh<BaseVecT>& mesh,
114  const PointsetSurface<BaseVecT>& surface,
115  FaceHandle faceH
116 );
117 
118 } // namespace lvr2
119 
120 #include "lvr2/algorithm/ColorAlgorithms.tcc"
121 
122 #endif /* LVR2_ALGORITHM_COLORALGORITHMS_H_ */
HalfEdgeMesh< Vec > mesh
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
boost::optional< DenseVertexMap< Rgb8Color > > calcColorFromPointCloud(const BaseMesh< BaseVecT > &mesh, const PointsetSurfacePtr< BaseVecT > surface)
Calculates the color of each vertex from the point cloud.
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
Rgb8Color calcColorForFaceCentroid(const BaseMesh< BaseVecT > &mesh, const PointsetSurface< BaseVecT > &surface, FaceHandle faceH)
Calculate the color for the centroid of a given face.
static Rgb8Color floatToGrayScaleColor(float value)
Convert a given float to an 8-bit Grayscale-Color.
static Rgb8Color floatToRainbowColor(float value)
Convert a given float to an 8-bit RGB-Color, using the rainbowcolor scale.
std::array< uint8_t, 3 > Rgb8Color
std::shared_ptr< PointsetSurface< BaseVecT > > PointsetSurfacePtr
Handle to access faces of the mesh.
Definition: Handles.hpp:140


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06