avoid PyOpenGL automatic array conversion#2131
Merged
j9ac9k merged 9 commits intopyqtgraph:masterfrom Dec 9, 2021
Merged
Conversation
this is probably also fixing a bug: the code was using np.empty() but was not filling up all the elements.
transpose texture coords instead of image data this doesn't alter the displayed image's orientation.
Member
|
Given this comment #825 (comment) think we should take the draft label off this PR and merge? |
This was referenced Mar 16, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following #2111, this PR tries to eliminate PyOpenGL automatic array conversions in the OpenGL items by making the conversions explicitly. The places where conversion was taking place was discovered by setting
OpenGL.ERROR_ON_COPY = Truein the examples and running them. With this PR, all included OpenGL examples are able to run without error with the above attribute set.GLImageItem and GLVolumeItem deserve a mention. Pyqtgraph uses Fortran-major axes and thus transposes the texture data before uploading them. GLImageItem was fixed to avoid the transpose by changing the texture coordinate code. The texture coordinate code of GLVolumeItem was too complicated to fix, thus a memory copy is forced.
The script below was used to verify that GLImageItem draws the same before and after this PR.
This PR may fix #825.