ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PclCloudLUT.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include "PclCloudLUT.h"
9 
10 #include <pcl/point_types.h>
11 // #include <pcl/common/colors.h>
12 #include <ecvColorTypes.h>
13 
15 static const unsigned char CloudLUT[] = {
16  255, 255, 255, // default
17  255, 0, 0, // highted
18 };
19 
21 static const unsigned int CloudLUT_SIZE =
22  sizeof(CloudLUT) / (sizeof(CloudLUT[0]) * 3);
23 
24 pcl::RGB PclCloudLUT::at(int color_id) {
25  // assert (color_id < CloudLUT_SIZE);
26  pcl::RGB color;
27  if (color_id == -1) {
28  color_id = -color_id;
29  color.r = CloudLUT[color_id * 3 + 0];
30  color.g = CloudLUT[color_id * 3 + 1];
31  color.b = CloudLUT[color_id * 3 + 2];
32  } else if (color_id == 0) {
33  color.r = CloudLUT[color_id * 3 + 0];
34  color.g = CloudLUT[color_id * 3 + 1];
35  color.b = CloudLUT[color_id * 3 + 2];
36  } else if (color_id > 0) {
37  // color = pcl::GlasbeyLUT::at(color_id + 20);
39  color.r = col.r;
40  color.g = col.g;
41  color.b = col.b;
42  }
43 
44  return (color);
45 }
46 
47 size_t PclCloudLUT::size() { return CloudLUT_SIZE; }
48 
49 const unsigned char* PclCloudLUT::data() { return CloudLUT; }
math::float4 color
static const unsigned int CloudLUT_SIZE
Number of colors in Glasbey lookup table.
Definition: PclCloudLUT.cpp:21
static const unsigned char CloudLUT[]
Lookup table.
Definition: PclCloudLUT.cpp:15
static const unsigned char * data()
Definition: PclCloudLUT.cpp:49
static pcl::RGB at(int color_id)
Definition: PclCloudLUT.cpp:24
static size_t size()
Definition: PclCloudLUT.cpp:47
RGB color structure.
Definition: ecvColorTypes.h:49
Rgb at(size_t color_id)