Changeset View
Changeset View
Standalone View
Standalone View
imagelib/effects/kpEffectGrayscale.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 59 | { | |||
---|---|---|---|---|---|
61 | { | 61 | { | ||
62 | qimage.setPixel (x, y, toGray (qimage.pixel (x, y))); | 62 | qimage.setPixel (x, y, toGray (qimage.pixel (x, y))); | ||
63 | } | 63 | } | ||
64 | } | 64 | } | ||
65 | } | 65 | } | ||
66 | else | 66 | else | ||
67 | { | 67 | { | ||
68 | // 1- & 8- bit images use a color table | 68 | // 1- & 8- bit images use a color table | ||
69 | for (int i = 0; i < qimage.colorCount (); i++) | 69 | for (int i = 0; i < qimage.colorCount (); i++) { | ||
70 | qimage.setColor (i, toGray (qimage.color (i))); | 70 | qimage.setColor (i, toGray (qimage.color (i))); | ||
71 | } | 71 | } | ||
72 | } | ||||
72 | 73 | | |||
73 | return qimage; | 74 | return qimage; | ||
74 | } | 75 | } |