Changeset View
Changeset View
Standalone View
Standalone View
imagelib/effects/kpEffectInvert.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | // public static | 42 | // public static | ||
43 | void kpEffectInvert::applyEffect (QImage *destImagePtr, int channels) | 43 | void kpEffectInvert::applyEffect (QImage *destImagePtr, int channels) | ||
44 | { | 44 | { | ||
45 | QRgb mask = qRgba ((channels & Red) ? 0xFF : 0, | 45 | QRgb mask = qRgba ((channels & Red) ? 0xFF : 0, | ||
46 | (channels & Green) ? 0xFF : 0, | 46 | (channels & Green) ? 0xFF : 0, | ||
47 | (channels & Blue) ? 0xFF : 0, | 47 | (channels & Blue) ? 0xFF : 0, | ||
48 | 0/*don't invert alpha*/); | 48 | 0/*don't invert alpha*/); | ||
49 | qCDebug(kpLogImagelib) << "kpEffectInvert::applyEffect(channels=" << channels | 49 | qCDebug(kpLogImagelib) << "kpEffectInvert::applyEffect(channels=" << channels | ||
50 | << ") mask=" << (int *) mask | 50 | << ") mask=" << (int *) mask; | ||
51 | << endl; | | |||
52 | 51 | | |||
53 | if (destImagePtr->depth () > 8) | 52 | if (destImagePtr->depth () > 8) | ||
54 | { | 53 | { | ||
55 | // Above version works for Qt 3.2 at least. | 54 | // Above version works for Qt 3.2 at least. | ||
56 | // But this version will always work (slower, though) and supports | 55 | // But this version will always work (slower, though) and supports | ||
57 | // inverting particular channels. | 56 | // inverting particular channels. | ||
58 | for (int y = 0; y < destImagePtr->height (); y++) | 57 | for (int y = 0; y < destImagePtr->height (); y++) | ||
59 | { | 58 | { | ||
Show All 24 Lines |