Skip to content

fix: Problems with textures in 3d visualizer with bitmap visualizer. #2167

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

paxcut
Copy link
Collaborator

@paxcut paxcut commented Mar 13, 2025

In 3d visualizer there is an option to specify the path to the texture file that will be applied using the uv coordinates. Unfortunately any attempts to fill in the text field for the path is met with the immediate removal of the text with no other consequences.

This occurred because the value was being reset when more than one frame was needed to process the request which is always. The variable doing the replacement is the one used to specify the texture path from the commend line.

The fix is to check which of the two names is empty and if both are not empty then keep the last one assigned and discard the older one.

Another problem with images was found in the bitmap visualizer when colors were stored as 32 bit values like eg rgba. I made some changes so that it works but the number of rows passed to the visualizer must be half of the actual number of rows the image contains.

This is done so that the code still works for the older images with 16 bit indices and even further down to 4 bits per index. The visualizer should calculate those values automatically based on the input data and the numbers passed on the command line.

paxcut and others added 9 commits March 13, 2025 10:30
In 3d visualizer there is an option to specify the path  to the texture file that will be applied using the uv coordinates. Unfortunately any attempts to fill in the text field for the path is met with the immediate removal of the text with no other consequences.

This occurred because the value was being reset when more than one frame was needed to process the request which is always. The variable doing the replacement is the one used to specify the texture path from the commend line.

The fix is to check which of the two names is empty and if both are not empty then keep the last one assigned and discard the older one.

Another problem with images was found in the bitmap visualizer when colors were stored as 32 bit values like eg rgba. I made some changes so that it works but the number of rows passed to the visualizer must be half of the actual number of rows the image contains.

This is done so that the code still works for the older images with 16 bit indices and even further down to 4 bits per index. The visualizer should calculate those values automatically based on the input data and the numbers passed on the command line.
…version was designed to work with the TIM format which has some peculiarities that are not general enough. The current implementation has the following specifications.

. Whether colors are in a lookup table or part of the image itself they are always 32 bit R8G8B8A8.

. If using a color LUT the image then has indices as its element. Indices can have 16(32000 colors), 8 (256 colors) or 4(16 colors) bits each.

.For the cases 0f 16 and 8 bits, the data should be an array of N*M elements of the given size where N is the number of rows and M is the number of columns of the image.

. For the 4 bit case use an array of N*M/2 bytes so that each column contains two indices.

ToDo: Documentation, sample patterns and unit tests.

The 3-d visualizer can now handle textures from both the command line or the user interface and things should work as expected. A command line entry will be automatically displayed in the user interface, but changes will be applied immediately as you type or use the file picker. If the user interface text is deleted, then the command line texture will be used again.  If a texture is invalid for any reason, then the previous one, if any, will be still in use and an error message will be displayed until the problem is cleared. Valid textures are image files that the stb library can open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant