5#include <qpa/qplatformintegration.h>
6#include <QtCore/qbuffer.h>
7#include <QtGui/qbitmap.h>
8#include <QtGui/qimagereader.h>
9#include <private/qguiapplication_p.h>
10#include <private/qimagepixmapcleanuphooks_p.h>
26 qFatal(
"QPlatformPixmap: QGuiApplication required");
77 if (
img.color(0) == c0 &&
img.color(1) == c1) {
89 Qt::ImageConversionFlags
flags)
96 Qt::ImageConversionFlags
flags)
138 const int w =
image.width();
139 const int h =
image.height();
146 mask.setColorCount(2);
152 for (
int y = 0;
y <
h; ++
y) {
155 memset(dest, 0, bpl);
156 for (
int x = 0;
x <
w; ++
x) {
158 dest[
x >> 3] |= (1 << (
x & 7));
169 if (
mask.size().isEmpty()) {
170 if (
image.depth() != 1) {
174 const int w =
image.width();
175 const int h =
image.height();
177 switch (
image.depth()) {
180 for (
int y = 0;
y <
h; ++
y) {
184 for (
int i = 0;
i < bytesPerLine; ++
i)
185 tscan[
i] &= mscan[
i];
192 for (
int y = 0;
y <
h; ++
y) {
195 for (
int x = 0;
x <
w; ++
x) {
196 if (!(mscan[
x>>3] & (1 << (
x&7))))
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags.
\inmodule QtCore \reentrant
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
The QColor class provides colors based on RGB, HSV or CMYK values.
QRgb rgb() const noexcept
Returns the RGB value of the color.
static QPlatformIntegration * platformIntegration()
static void executePlatformPixmapDestructionHooks(QPlatformPixmap *)
The QImageReader class provides a format independent interface for reading images from files or other...
QImage read()
Reads an image from the device.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
@ Format_ARGB32_Premultiplied
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr int qAlpha(QRgb rgb)