Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_gui_image_qimage.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QImage>
4#include <QRgb>
5
7void wrapper0() {
11
12value = qRgb(189, 149, 39); // 0xffbd9527
13image.setPixel(1, 1, value);
14
15value = qRgb(122, 163, 39); // 0xff7aa327
16image.setPixel(0, 1, value);
17image.setPixel(1, 0, value);
18
19value = qRgb(237, 187, 51); // 0xffedba31
20image.setPixel(2, 1, value);
22
23} // wrapper0
24void wrapper1() {
25
26
30
31value = qRgb(122, 163, 39); // 0xff7aa327
32image.setColor(0, value);
33
34value = qRgb(237, 187, 51); // 0xffedba31
35image.setColor(1, value);
36
37value = qRgb(189, 149, 39); // 0xffbd9527
38image.setColor(2, value);
39
40image.setPixel(0, 1, 0);
41image.setPixel(1, 0, 0);
42image.setPixel(1, 1, 2);
43image.setPixel(2, 1, 1);
45
46
48static const char * const start_xpm[] = {
49 "16 15 8 1",
50 "a c #cec6bd",
51 // etc.
52};
54
55
57for (int y = 0; y < image.height(); ++y) {
58 QRgb *line = reinterpret_cast<QRgb*>(image.scanLine(y));
59 for (int x = 0; x < image.width(); ++x) {
60 QRgb &rgb = line[x];
62 }
63}
65
66Q_UNUSED(start_xpm);
67} // wrapper1
68} // src_gui_image_qimage
\inmodule QtGui
Definition qimage.h:37
@ Format_RGB32
Definition qimage.h:46
@ Format_Indexed8
Definition qimage.h:45
Definition image.cpp:4
#define rgb(r, g, b)
Definition qcolor.cpp:124
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLint GLint GLint GLint x
[0]
GLint y
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
Definition qrgb.h:13
constexpr QRgb qRgb(int r, int g, int b)
Definition qrgb.h:30
constexpr int qRed(QRgb rgb)
Definition qrgb.h:18
constexpr int qGreen(QRgb rgb)
Definition qrgb.h:21
constexpr QRgb qRgba(int r, int g, int b, int a)
Definition qrgb.h:33
constexpr int qBlue(QRgb rgb)
Definition qrgb.h:24
constexpr int qAlpha(QRgb rgb)
Definition qrgb.h:27
#define Q_UNUSED(x)