15 : QQuickImageProvider(QQuickImageProvider::Image)
20 QImage ImageProvider::brightness(
const QImage& imgOrig,
int n)
22 QImage imgTemp = imgOrig.convertToFormat(QImage::Format_ARGB32);
23 qint32 nHeight = imgTemp.height();
24 qint32 nWidth = imgTemp.width();
26 for (qint32 y = 0; y < nHeight; ++y) {
27 QRgb* tempLine =
reinterpret_cast<QRgb*
>(imgTemp.scanLine(y));
29 for (qint32 x = 0; x < nWidth; ++x) {
30 int r = qRed(*tempLine) + n;
31 int g = qGreen(*tempLine) + n;
32 int b = qBlue(*tempLine) + n;
33 int a = qAlpha(*tempLine);
35 *tempLine++ = qRgba(r > 255 ? 255 : r < 0 ? 0 : r,
36 g > 255 ? 255 : g < 0 ? 0 : g,
37 b > 255 ? 255 : b < 0 ? 0 : b,
49 QStringList lst = strId.split(
";");
51 int nBrightness = lst.last().toInt(&bOk);
52 QImage img = brightness(QImage(
":/" + lst.first()), nBrightness);
QImage requestImage(const QString &, QSize *, const QSize &)