Skip to content

combine levels and lut only if both are present#1630

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:lut_combine
Mar 14, 2021
Merged

combine levels and lut only if both are present#1630
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:lut_combine

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Mar 13, 2021

This PR does a partial fix for #1590.

Previously, if levels was present but lut was not, levels would be converted into lut.
i.e. levels and ~lut --> ~levels and lut
However, since makeARGB always applies levels, this becomes a pessimization.
i.e. both levels and lut are now applied.

This PR changes it to become: levels and lut --> ~levels and lut

With this fix, in the (perhaps common) use case where the user does not provide a lut, the pessimization will no longer get triggered.

previously, if levels was present but lut was not, levels would be
converted into lut.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Mar 14, 2021

Thanks @pijyoi for narrowing down the code-paths and identifying unnecessary computation

@j9ac9k j9ac9k merged commit 3f9e56f into pyqtgraph:master Mar 14, 2021
@pijyoi pijyoi deleted the lut_combine branch March 15, 2021 09:34
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.

2 participants