Changeset View
Changeset View
Standalone View
Standalone View
imagelib/effects/kpEffectInvert.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
49 | #if DEBUG_KP_EFFECT_INVERT | 49 | #if DEBUG_KP_EFFECT_INVERT | ||
50 | qCDebug(kpLogImagelib) << "kpEffectInvert::applyEffect(channels=" << channels | 50 | qCDebug(kpLogImagelib) << "kpEffectInvert::applyEffect(channels=" << channels | ||
51 | << ") mask=" << (int *) mask | 51 | << ") mask=" << (int *) mask | ||
52 | << endl; | 52 | << endl; | ||
53 | #endif | 53 | #endif | ||
54 | 54 | | |||
55 | if (destImagePtr->depth () > 8) | 55 | if (destImagePtr->depth () > 8) | ||
56 | { | 56 | { | ||
57 | #if 0 | | |||
58 | // SYNC: TODO: Qt BUG - invertAlpha argument is inverted!!! | | |||
59 | destImagePtr->invertPixels (true/*no invert alpha (Qt 3.2)*/); | | |||
60 | #else | | |||
61 | // Above version works for Qt 3.2 at least. | 57 | // Above version works for Qt 3.2 at least. | ||
62 | // But this version will always work (slower, though) and supports | 58 | // But this version will always work (slower, though) and supports | ||
63 | // inverting particular channels. | 59 | // inverting particular channels. | ||
64 | for (int y = 0; y < destImagePtr->height (); y++) | 60 | for (int y = 0; y < destImagePtr->height (); y++) | ||
65 | { | 61 | { | ||
66 | for (int x = 0; x < destImagePtr->width (); x++) | 62 | for (int x = 0; x < destImagePtr->width (); x++) | ||
67 | { | 63 | { | ||
68 | destImagePtr->setPixel (x, y, destImagePtr->pixel (x, y) ^ mask); | 64 | destImagePtr->setPixel (x, y, destImagePtr->pixel (x, y) ^ mask); | ||
69 | } | 65 | } | ||
70 | } | 66 | } | ||
71 | #endif | | |||
72 | } | 67 | } | ||
73 | else | 68 | else | ||
74 | { | 69 | { | ||
75 | for (int i = 0; i < destImagePtr->colorCount (); i++) | 70 | for (int i = 0; i < destImagePtr->colorCount (); i++) | ||
76 | { | 71 | { | ||
77 | destImagePtr->setColor (i, destImagePtr->color (i) ^ mask); | 72 | destImagePtr->setColor (i, destImagePtr->color (i) ^ mask); | ||
78 | } | 73 | } | ||
79 | } | 74 | } | ||
Show All 11 Lines |