Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent handling of the alpha value in PointCloudDepthAndRGBtoXYZRGBA #2476

Closed
csukuangfj opened this issue Sep 26, 2018 · 1 comment
Closed

Comments

@csukuangfj
Copy link
Contributor

Your Environment

  • PCL Version: the master branch

Context

See the code

PointXYZRGBA pt;
pt.a = 0;

alpha is set to 0.
But

inline RGB ()
{
r = g = b = 0;
a = 255;
}

inline RGB (uint8_t _r, uint8_t _g, uint8_t _b)
{
r = _r;
g = _g;
b = _b;
a = 255;
}

inline PointXYZRGBA ()
{
x = y = z = 0.0f;
data[3] = 1.0f;
r = g = b = 0;
a = 255;
}

inline PointXYZRGB ()
{
x = y = z = 0.0f;
data[3] = 1.0f;
r = g = b = 0;
a = 255;
}

inline PointXYZRGB (uint8_t _r, uint8_t _g, uint8_t _b)
{
x = y = z = 0.0f;
data[3] = 1.0f;
r = _r;
g = _g;
b = _b;
a = 255;
}

inline PointXYZRGBL ()
{
x = y = z = 0.0f;
data[3] = 1.0f;
r = g = b = 0;
a = 255;
label = 255;
}

inline PointXYZRGBL (uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label)
{
x = y = z = 0.0f;
data[3] = 1.0f;
r = _r;
g = _g;
b = _b;
a = 255;
label = _label;
}

all set alpha to 255.

Expected Behavior

For consistency, alpha in PointCloudDepthAndRGBtoXYZRGBA should be set to 255 instead of 0.

Current Behavior

alpha in PointCloudDepthAndRGBtoXYZRGBA is set to 0.

Code to Reproduce

See the code above.

Possible Solution

Set alpha in PointCloudDepthAndRGBtoXYZRGBA to 255.

@taketwo
Copy link
Member

taketwo commented Oct 7, 2018

Agree, alpha should be 255. Since it is already initialized inside the constructor, line 374 may be removed altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants