#include <qpixmap_raster_p.h>
|
QImage * | buffer () |
|
void | copy (const QPixmapData *data, const QRect &rect) |
|
QPixmapData * | createCompatiblePixmapData () const |
|
void | fill (const QColor &color) |
|
bool | fromData (const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags) |
|
void | fromFile (const QString &filename, Qt::ImageConversionFlags flags) |
|
void | fromImage (const QImage &image, Qt::ImageConversionFlags flags) |
|
void | fromImageReader (QImageReader *imageReader, Qt::ImageConversionFlags flags) |
|
bool | hasAlphaChannel () const |
|
QPaintEngine * | paintEngine () const |
|
| QRasterPixmapData (PixelType type) |
|
void | resize (int width, int height) |
|
bool | scroll (int dx, int dy, const QRect &rect) |
|
void | setAlphaChannel (const QPixmap &alphaChannel) |
|
void | setMask (const QBitmap &mask) |
|
QImage | toImage () const |
|
QImage | toImage (const QRect &rect) const |
|
| ~QRasterPixmapData () |
|
virtual QPixmap | alphaChannel () const |
|
qint64 | cacheKey () const |
|
ClassId | classId () const |
|
int | colorCount () const |
|
int | depth () const |
|
virtual bool | fromFile (const QString &filename, const char *format, Qt::ImageConversionFlags flags) |
|
int | height () const |
|
bool | isNull () const |
|
virtual QBitmap | mask () const |
|
QT_DEPRECATED int | numColors () const |
|
PixelType | pixelType () const |
|
| QPixmapData (PixelType pixelType, int classId) |
|
virtual QPixmapData * | runtimeData () const |
|
int | serialNumber () const |
|
virtual QPixmap | transformed (const QTransform &matrix, Qt::TransformationMode mode) const |
|
int | width () const |
|
virtual | ~QPixmapData () |
|
|
enum | ClassId {
RasterClass,
X11Class,
MacClass,
DirectFBClass,
OpenGLClass,
OpenVGClass,
RuntimeClass,
BlitterClass,
CustomClass = 1024
} |
|
enum | PixelType { PixmapType,
BitmapType
} |
|
static QPixmapData * | create (int w, int h, PixelType type) |
|
Definition at line 65 of file qpixmap_raster_p.h.
◆ QRasterPixmapData()
QRasterPixmapData::QRasterPixmapData |
( |
PixelType |
type | ) |
|
◆ ~QRasterPixmapData()
QRasterPixmapData::~QRasterPixmapData |
( |
| ) |
|
◆ buffer()
QImage * QRasterPixmapData::buffer |
( |
| ) |
|
|
virtual |
◆ copy()
◆ createCompatiblePixmapData()
QPixmapData * QRasterPixmapData::createCompatiblePixmapData |
( |
| ) |
const |
|
virtual |
◆ createPixmapForImage()
void QRasterPixmapData::createPixmapForImage |
( |
QImage & |
sourceImage, |
|
|
Qt::ImageConversionFlags |
flags, |
|
|
bool |
inPlace |
|
) |
| |
|
protected |
Definition at line 386 of file qpixmap_raster.cpp.
Referenced by fromData(), fromImage(), and fromImageReader().
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;
Format
The following image formats are available in Qt.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
static QImage::Format systemFormat()
Format format() const
Returns the format of the image.
PixelType pixelType() const
void detach()
If multiple images share common data, this image makes a copy of the data and detaches itself from th...
The QImage class provides a hardware-independent image representation that allows direct access to th...
static QScreen * instance()
Returns a pointer to the application's QScreen instance.
int depth() const
Returns the depth of the image.
int serialNumber() const
Returns a number that identifies the contents of this QImage object.
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...
void * data_ptr(const QTransform &t)
bool convertInPlace(QImage::Format newFormat, Qt::ImageConversionFlags)
void setSerialNumber(int serNo)
◆ fill()
void QRasterPixmapData::fill |
( |
const QColor & |
color | ) |
|
|
virtual |
Implements QPixmapData.
Definition at line 185 of file qpixmap_raster.cpp.
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();
Format
The following image formats are available in Qt.
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.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
Q_DECL_CONSTEXPR T qAbs(const T &t)
Format format() const
Returns the format of the image.
Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x)
void detach()
If multiple images share common data, this image makes a copy of the data and detaches itself from th...
The QImage class provides a hardware-independent image representation that allows direct access to th...
int depth() const
Returns the depth of the image.
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
int width() const
Returns the width of the image.
ushort alpha
Returns the alpha color component of this color.
int height() const
Returns the height of the image.
int qt_depthForFormat(QImage::Format format)
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
QRgb color(int i) const
Returns the color in the color table at index i.
◆ fromData()
bool QRasterPixmapData::fromData |
( |
const uchar * |
buffer, |
|
|
uint |
len, |
|
|
const char * |
format, |
|
|
Qt::ImageConversionFlags |
flags |
|
) |
| |
|
virtual |
Reimplemented from QPixmapData.
Definition at line 137 of file qpixmap_raster.cpp.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
The QByteArray class provides an array of bytes.
long ASN1_INTEGER_get ASN1_INTEGER * a
The QBuffer class provides a QIODevice interface for a QByteArray.
static QByteArray fromRawData(const char *, int size)
Constructs a QByteArray that uses the first size bytes of the data array.
The QImage class provides a hardware-independent image representation that allows direct access to th...
void createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
The QImageReader class provides a format independent interface for reading images from files or other...
QImage read()
Reads an image from the device.
◆ fromFile()
void QRasterPixmapData::fromFile |
( |
const QString & |
filename, |
|
|
Qt::ImageConversionFlags |
flags |
|
) |
| |
◆ fromImage()
void QRasterPixmapData::fromImage |
( |
const QImage & |
image, |
|
|
Qt::ImageConversionFlags |
flags |
|
) |
| |
|
virtual |
◆ fromImageReader()
void QRasterPixmapData::fromImageReader |
( |
QImageReader * |
imageReader, |
|
|
Qt::ImageConversionFlags |
flags |
|
) |
| |
|
virtual |
Reimplemented from QPixmapData.
Definition at line 159 of file qpixmap_raster.cpp.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
The QImage class provides a hardware-independent image representation that allows direct access to th...
void createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QImage read()
Reads an image from the device.
◆ hasAlphaChannel()
bool QRasterPixmapData::hasAlphaChannel |
( |
| ) |
const |
|
virtual |
Implements QPixmapData.
Definition at line 308 of file qpixmap_raster.cpp.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
◆ metric()
Implements QPixmapData.
Definition at line 352 of file qpixmap_raster.cpp.
379 qWarning(
"QRasterPixmapData::metric(): Unhandled metric type %d",
metric);
Q_GUI_EXPORT int qt_defaultDpiY()
Q_GUI_EXPORT int qt_defaultDpiX()
QVector< QRgb > colortable
int metric(QPaintDevice::PaintDeviceMetric metric) const
Q_CORE_EXPORT void qWarning(const char *,...)
int size() const
Returns the number of items in the vector.
Q_DECL_CONSTEXPR int qRound(qreal d)
◆ paintEngine()
Implements QPixmapData.
Definition at line 347 of file qpixmap_raster.cpp.
QPaintEngine * paintEngine() const
Used by QPainter to retrieve a paint engine for the image.
◆ resize()
void QRasterPixmapData::resize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
virtual |
Implements QPixmapData.
Definition at line 102 of file qpixmap_raster.cpp.
The QColor class provides colors based on RGB, HSV or CMYK values.
Format
The following image formats are available in Qt.
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue. ...
bool isNull() const
Returns true if it is a null image, otherwise returns false.
static QImage::Format systemFormat()
PixelType pixelType() const
void setColorCount(int)
Resizes the color table to contain colorCount entries.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static QScreen * instance()
Returns a pointer to the application's QScreen instance.
int depth() const
Returns the depth of the image.
int serialNumber() const
Returns a number that identifies the contents of this QImage object.
QImage::Format pixelFormat() const
Returns the pixel format of the screen, or QImage::Format_Invalid if the pixel format is not a suppor...
void setSerialNumber(int serNo)
◆ scroll()
bool QRasterPixmapData::scroll |
( |
int |
dx, |
|
|
int |
dy, |
|
|
const QRect & |
rect |
|
) |
| |
|
virtual |
Reimplemented from QPixmapData.
Definition at line 178 of file qpixmap_raster.cpp.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)
The QPoint class defines a point in the plane using integer precision.
◆ setAlphaChannel()
void QRasterPixmapData::setAlphaChannel |
( |
const QPixmap & |
alphaChannel | ) |
|
|
virtual |
Reimplemented from QPixmapData.
Definition at line 342 of file qpixmap_raster.cpp.
QImage toImage() const
Converts the pixmap to a QImage.
void setAlphaChannel(const QImage &alphaChannel)
Sets the alpha channel of this image to the given alphaChannel.
◆ setImage()
void QRasterPixmapData::setImage |
( |
const QImage & |
image | ) |
|
|
protected |
◆ setMask()
void QRasterPixmapData::setMask |
( |
const QBitmap & |
mask | ) |
|
|
virtual |
Reimplemented from QPixmapData.
Definition at line 269 of file qpixmap_raster.cpp.
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) {
QImage toImage() const
Converts the pixmap to a QImage.
QSize size() const
Returns the size of the pixmap.
int bytesPerLine() const
Returns the number of bytes per image scanline.
Format format() const
Returns the format of the image.
const uchar qt_pixmap_bit_mask[]
The QImage class provides a hardware-independent image representation that allows direct access to th...
int depth() const
Returns the depth of the image.
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.
int height() const
Returns the height of the image.
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
◆ toImage() [1/2]
QImage QRasterPixmapData::toImage |
( |
| ) |
const |
|
virtual |
Implements QPixmapData.
Definition at line 313 of file qpixmap_raster.cpp.
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
QPaintDevice * paintDevice() const
Returns the device that this engine is painting on, if painting is active; otherwise returns 0...
bool isNull() const
Returns true if it is a null image, otherwise returns false.
bool isActive() const
Returns true if the paint engine is actively drawing; otherwise returns false.
QPaintEngine * paintEngine
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
void * data_ptr(const QTransform &t)
◆ toImage() [2/2]
QImage QRasterPixmapData::toImage |
( |
const QRect & |
rect | ) |
const |
|
virtual |
Reimplemented from QPixmapData.
Definition at line 327 of file qpixmap_raster.cpp.
334 if ((du % 8 == 0) && (((
uint(clipped.
x()) * du)) % 32 == 0))
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.
int width() const
Returns the width of the rectangle.
int bytesPerLine() const
Returns the number of bytes per image scanline.
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
int height() const
Returns the height of the rectangle.
Format format() const
Returns the format of the image.
The QImage class provides a hardware-independent image representation that allows direct access to th...
int y() const
Returns the y-coordinate of the rectangle's top edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
The QRect class defines a rectangle in the plane using integer precision.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
◆ QBitmap
◆ QPixmap
◆ QPixmapCacheEntry
◆ QRasterPaintEngine
◆ image
QImage QRasterPixmapData::image |
|
protected |
Definition at line 94 of file qpixmap_raster_p.h.
Referenced by buffer(), QPixmap::clut(), QPixmap::colorCount(), createPixmapForImage(), QPixmap::detach(), fill(), fromData(), fromImage(), fromImageReader(), hasAlphaChannel(), metric(), paintEngine(), QPixmapCacheEntry::QPixmapCacheEntry(), QPixmap::qwsBits(), QPixmap::qwsBytesPerLine(), resize(), scroll(), setAlphaChannel(), setMask(), toImage(), and QPixmap::toWinHBITMAP().
The documentation for this class was generated from the following files: