-
Notifications
You must be signed in to change notification settings - Fork 32
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
Bug: mouse hover over color map panel editor turns volume black #757
Comments
I played around with it a bit, and this line appears to be the culprit. The returned colormap always seems to be black. |
I was looking at Colormap.kt, and I am not sure I understand what it does. When I look at Colormap#sample I expect it should interpolate the color along the center line of the byte buffer. globalOffset seems to make some assumptions that aren't always true.
This assumes the buffer is always 4 bytes per sample and the height is greater than 1. I know the first assumption can be wrong from based on Image#bufferedImageToRGBABuffer
That occurs if the provided image doesn't have an alpha component. Which will create a 3 byte version. I think that clause should be removed and make a 4 byte raster either way. Java should draw the image ok and the buffer will always be 4 bytes. How should a Colormap#fromColor work? Currently it starts at the target color and ends at black. It also ignores the A component of the provided color. This seems to contradict the ColormapPanel where a "yellow.lut" is drawn from left to right. If I understand the Colormap a bit better I could make a pull request regarding this issue. |
The problem is caused by this line in ColormapPanel The gradient image is only being filled halfway because of the h-10. Then sample is taking the "center" of the buffered image which happens to be a section that is blank. |
with odd h values. Issue scenerygraphics#750 Made a hot fix for generating an image form the ColormapEditor the image was only halfdrawn. Issue scenerygraphics#757
The bug is likely caused by repainting the colormap panel and loading the color map from buffer here, introduced in this commit.
The issue was moved here from this sciview issue.
The text was updated successfully, but these errors were encountered: