Signed-off-by: André Agenor <andreagenor@icloud.com>
If all channels are selected a native Qt function is called, it is faster than calculating all channels and pixels in a loop
This is 97% faster than before
Details
Details
- Reviewers
tcanabrava - Commits
- R374:2bcf99128c60: Speed up invert colors effect
Diff Detail
Diff Detail
- Repository
- R374 KolourPaint
- Branch
- fix/invert-effect
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 10557 Build 10575: arc lint + arc unit
Comment Actions
The API documentation of kpEffectInvert::applyEffect() says:
// Inverts the colours of each pixel in the given image. // These functions differ from QImage::invertPixels() in the following ways: // // 1. for 8-bit images, it inverts the colours of the Colour Table // (this means that you would get visually similar results to inversion // at higher bit depths - rather than a "random-looking" inversion // depending on the contents of the Colour Table) // 2. never inverts the Alpha Buffer
Did you check that the change does not invalidate these? (especially point 1)
imagelib/effects/kpEffectInvert.cpp | ||
---|---|---|
44 | coding style, the opening curly bracket goes on its own line | |
45 | coding style, missing space before opening bracket |
Comment Actions
Yes, I tested with all kind of images, from 1 to 32 bits. Everything works the same as before.
The changes affect only if all channels are selected, the conversion is faster than before in this case.