44 #include <private/qfont_p.h> 54 #include <QImageReader> 55 #include <private/qimage_p.h> 56 #include <private/qsimd_p.h> 57 #include <private/qwidget_p.h> 58 #include <private/qdrawhelper_p.h> 63 0x10, 0x20, 0x40, 0x80 };
138 Qt::ImageConversionFlags flags)
152 Qt::ImageConversionFlags flags)
160 Qt::ImageConversionFlags flags)
197 int alpha = color.
alpha();
201 #if !(defined(QT_HAVE_NEON) || defined(QT_ALWAYS_HAVE_SSE2)) 242 pixel = qt_colorConvert<quint16, quint32>(color.
rgba(), 0);
257 pixel = color.
rgba();
282 for (
int y = 0; y <
h; ++y) {
286 for (
int i = 0; i < bytesPerLine; ++i)
287 tscan[i] &= mscan[i];
294 for (
int y = 0; y <
h; ++y) {
297 for (
int x = 0; x <
w; ++x) {
334 if ((du % 8 == 0) && (((
uint(clipped.
x()) * du)) % 32 == 0))
379 qWarning(
"QRasterPixmapData::metric(): Unhandled metric type %d", metric);
390 format = sourceImage.
format();
405 || const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels())) {
430 if (sourceImage.
depth() == 1) {
438 #if !defined(QT_HAVE_NEON) && !defined(QT_ALWAYS_HAVE_SSE2) 439 switch (opaqueFormat) {
449 format = opaqueFormat;
451 && !
const_cast<QImage &
>(sourceImage).
data_ptr()->checkForAlphaPixels())
462 format = opaqueFormat;
464 format = alphaFormat;
The QColor class provides colors based on RGB, HSV or CMYK values.
QPixmap qt_toRasterPixmap(const QImage &image)
QImage toImage() const
Converts the pixmap to a QImage.
Format
The following image formats are available in Qt.
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue. ...
#define QT_END_NAMESPACE
This macro expands to.
QPaintDevice * paintDevice() const
Returns the device that this engine is painting on, if painting is active; otherwise returns 0...
QSize size() const
Returns the size of the pixmap.
Q_GUI_EXPORT int qt_defaultDpiY()
bool open(OpenMode openMode)
Reimplemented Function
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void fill(uint pixel)
Fills the entire image with the given pixelValue.
The QByteArray class provides an array of bytes.
Q_GUI_EXPORT int qt_defaultDpiX()
int width() const
Returns the width of the rectangle.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
int bytesPerLine() const
Returns the number of bytes per image scanline.
static QImage::Format systemFormat()
long ASN1_INTEGER_get ASN1_INTEGER * a
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
The QBuffer class provides a QIODevice interface for a QByteArray.
int height() const
Returns the height of the rectangle.
Q_DECL_CONSTEXPR T qAbs(const T &t)
virtual QBitmap mask() const
QVector< QRgb > colortable
void copy(const QPixmapData *data, const QRect &rect)
Format format() const
Returns the format of the image.
void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
PixelType pixelType() const
virtual QPixmap alphaChannel() const
int metric(QPaintDevice::PaintDeviceMetric metric) const
The QBitmap class provides monochrome (1-bit depth) pixmaps.
virtual QImage toImage() const =0
void setColorCount(int)
Resizes the color table to contain colorCount entries.
const uchar qt_pixmap_bit_mask[]
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isActive() const
Returns true if the paint engine is actively drawing; otherwise returns false.
void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)
Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x)
virtual void fromImage(const QImage &image, Qt::ImageConversionFlags flags)=0
static QByteArray fromRawData(const char *, int size)
Constructs a QByteArray that uses the first size bytes of the data array.
void detach()
If multiple images share common data, this image makes a copy of the data and detaches itself from th...
QPaintEngine * paintEngine
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
static QScreen * instance()
Returns a pointer to the application's QScreen instance.
int depth() const
Returns the depth of the image.
bool hasAlphaChannel() const
void createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
The QImageReader class provides a format independent interface for reading images from files or other...
void resize(int width, int height)
bool scroll(int dx, int dy, const QRect &rect)
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
void setMask(const QBitmap &mask)
int serialNumber() const
Returns a number that identifies the contents of this QImage object.
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
ushort alpha
Returns the alpha color component of this color.
int y() const
Returns the y-coordinate of the rectangle's top edge.
void * data_ptr(const QTransform &t)
int x() const
Returns the x-coordinate of the rectangle's left edge.
QPixmapData * createCompatiblePixmapData() const
The QPoint class defines a point in the plane using integer precision.
QRasterPixmapData(PixelType type)
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the image.
void setAlphaChannel(const QPixmap &alphaChannel)
The QPixmap class is an off-screen image representation that can be used as a paint device...
void fill(const QColor &color)
QPaintEngine * paintEngine() const
Used by QPainter to retrieve a paint engine for the image.
int qt_depthForFormat(QImage::Format format)
bool convertInPlace(QImage::Format newFormat, Qt::ImageConversionFlags)
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
void setAlphaChannel(const QImage &alphaChannel)
Sets the alpha channel of this image to the given alphaChannel.
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
void setSerialNumber(int serNo)
bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags)
QPaintEngine * paintEngine() const
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
QImage read()
Reads an image from the device.
QRgb color(int i) const
Returns the color in the color table at index i.
Q_DECL_CONSTEXPR int qRound(qreal d)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
void fromImage(const QImage &image, Qt::ImageConversionFlags flags)