From a97d0a9c1076a2662f9e8e8f3a02c16d866fe607 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Mon, 9 Sep 2024 15:53:32 +0200 Subject: [PATCH] Document the RGBA structure --- common/include/pcl/impl/point_types.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/include/pcl/impl/point_types.hpp b/common/include/pcl/impl/point_types.hpp index 88ca63a4d1a..1ae4d3346a3 100644 --- a/common/include/pcl/impl/point_types.hpp +++ b/common/include/pcl/impl/point_types.hpp @@ -342,7 +342,7 @@ namespace pcl PCL_EXPORTS std::ostream& operator << (std::ostream& os, const RGB& p); /** \brief A structure representing RGB color information. * - * The RGBA information is available either as separate r, g, b, or as a + * The RGB information is available either as separate r, g, b or as a * packed std::uint32_t rgba value. To pack it, use: * * \code @@ -355,7 +355,7 @@ namespace pcl * int rgb = ...; * std::uint8_t r = (rgb >> 16) & 0x0000ff; * std::uint8_t g = (rgb >> 8) & 0x0000ff; - * std::uint8_t b = (rgb) & 0x0000ff; + * std::uint8_t b = (rgb) & 0x0000ff; * \endcode * */ @@ -506,20 +506,21 @@ namespace pcl PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p); /** \brief A point structure representing Euclidean xyz coordinates, and the RGBA color. * - * The RGBA information is available either as separate r, g, b, or as a - * packed std::uint32_t rgba value. To pack it, use: + * The RGBA information is available either as separate r, g, b and a uint8_t values, + * or as a packed std::uint32_t rgba value. To pack it, use: * * \code - * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b); + * int rgba = ((int)a) << 24 | (int)r) << 16 | ((int)g) << 8 | ((int)b); * \endcode * * To unpack it use: * * \code * int rgb = ...; + * std::uint8_t a = (rgb >> 24) & 0x0000ff; * std::uint8_t r = (rgb >> 16) & 0x0000ff; * std::uint8_t g = (rgb >> 8) & 0x0000ff; - * std::uint8_t b = (rgb) & 0x0000ff; + * std::uint8_t b = (rgb) & 0x0000ff; * \endcode * * \ingroup common