Signed-off-by: André Agenor <firstname.lastname@example.org>
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
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)
coding style, the opening curly bracket goes on its own line
coding style, missing space before opening bracket
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.