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
QPlatformPixmap Class Referenceabstract

The QPlatformPixmap class provides an abstraction for native pixmaps. More...

#include <qplatformpixmap.h>

+ Inheritance diagram for QPlatformPixmap:
+ Collaboration diagram for QPlatformPixmap:

Public Types

enum  PixelType { PixmapType , BitmapType }
 
enum  ClassId {
  RasterClass , DirectFBClass , BlitterClass , Direct2DClass ,
  X11Class , CustomClass = 1024
}
 

Public Member Functions

 QPlatformPixmap (PixelType pixelType, int classId)
 
virtual ~QPlatformPixmap ()
 
virtual QPlatformPixmapcreateCompatiblePlatformPixmap () const
 
virtual void resize (int width, int height)=0
 
virtual void fromImage (const QImage &image, Qt::ImageConversionFlags flags)=0
 
virtual void fromImageInPlace (QImage &image, Qt::ImageConversionFlags flags)
 
virtual void fromImageReader (QImageReader *imageReader, Qt::ImageConversionFlags flags)
 
virtual bool fromFile (const QString &filename, const char *format, Qt::ImageConversionFlags flags)
 
virtual bool fromData (const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags)
 
virtual void copy (const QPlatformPixmap *data, const QRect &rect)
 
virtual bool scroll (int dx, int dy, const QRect &rect)
 
virtual int metric (QPaintDevice::PaintDeviceMetric metric) const =0
 
virtual void fill (const QColor &color)=0
 
virtual QBitmap mask () const
 
virtual void setMask (const QBitmap &mask)
 
virtual bool hasAlphaChannel () const =0
 
virtual QPixmap transformed (const QTransform &matrix, Qt::TransformationMode mode) const
 
virtual QImage toImage () const =0
 
virtual QImage toImage (const QRect &rect) const
 
virtual QPaintEnginepaintEngine () const =0
 
int serialNumber () const
 
PixelType pixelType () const
 
ClassId classId () const
 
virtual qreal devicePixelRatio () const =0
 
virtual void setDevicePixelRatio (qreal scaleFactor)=0
 
virtual QImagebuffer ()
 
int width () const
 
int height () const
 
int colorCount () const
 
int depth () const
 
bool isNull () const
 
qint64 cacheKey () const
 

Static Public Member Functions

static QPlatformPixmapcreate (int w, int h, PixelType type)
 

Protected Member Functions

void setSerialNumber (int serNo)
 
void setDetachNumber (int detNo)
 

Protected Attributes

int w
 
int h
 
int d
 
bool is_null
 

Friends

class QPixmap
 
class QX11PlatformPixmap
 
class QImagePixmapCleanupHooks
 
class QOpenGLTextureCache
 
class QExplicitlySharedDataPointer< QPlatformPixmap >
 

Detailed Description

The QPlatformPixmap class provides an abstraction for native pixmaps.

Since
5.0

\preliminary

Definition at line 25 of file qplatformpixmap.h.

Member Enumeration Documentation

◆ ClassId

Enumerator
RasterClass 
DirectFBClass 
BlitterClass 
Direct2DClass 
X11Class 
CustomClass 

Definition at line 34 of file qplatformpixmap.h.

◆ PixelType

Enumerator
PixmapType 
BitmapType 

Definition at line 28 of file qplatformpixmap.h.

Constructor & Destructor Documentation

◆ QPlatformPixmap()

QPlatformPixmap::QPlatformPixmap ( PixelType pixelType,
int classId )

Definition at line 34 of file qplatformpixmap.cpp.

◆ ~QPlatformPixmap()

QPlatformPixmap::~QPlatformPixmap ( )
virtual

Definition at line 48 of file qplatformpixmap.cpp.

References QImagePixmapCleanupHooks::executePlatformPixmapDestructionHooks().

+ Here is the call graph for this function:

Member Function Documentation

◆ buffer()

QImage * QPlatformPixmap::buffer ( )
virtual

Reimplemented in QBlittablePlatformPixmap, and QRasterPlatformPixmap.

Definition at line 231 of file qplatformpixmap.cpp.

Referenced by QRasterPaintEngine::begin().

+ Here is the caller graph for this function:

◆ cacheKey()

qint64 QPlatformPixmap::cacheKey ( ) const
inline

Definition at line 92 of file qplatformpixmap.h.

◆ classId()

ClassId QPlatformPixmap::classId ( ) const
inline

Definition at line 80 of file qplatformpixmap.h.

Referenced by QPixmapCacheEntry::QPixmapCacheEntry(), QRasterPaintEngine::begin(), CapabilitiesToStateMask::canBlitterDrawPixmap(), CapabilitiesToStateMask::canBlitterDrawPixmapOpacity(), QPixmap::detach(), QRasterPaintEngine::drawPixmap(), QRasterPaintEngine::drawPixmap(), and QRasterPaintEngine::drawTiledPixmap().

+ Here is the caller graph for this function:

◆ colorCount()

int QPlatformPixmap::colorCount ( ) const
inline

Definition at line 89 of file qplatformpixmap.h.

References QPaintDevice::PdmNumColors.

◆ copy()

void QPlatformPixmap::copy ( const QPlatformPixmap * data,
const QRect & rect )
virtual

Reimplemented in QRasterPlatformPixmap, and QX11PlatformPixmap.

Definition at line 117 of file qplatformpixmap.cpp.

References fromImage(), Qt::NoOpaqueDetection, and rect.

+ Here is the call graph for this function:

◆ create()

QPlatformPixmap * QPlatformPixmap::create ( int w,
int h,
PixelType type )
static

Definition at line 23 of file qplatformpixmap.cpp.

References QGuiApplicationPrivate::platformIntegration(), Q_UNLIKELY, and qFatal.

Referenced by QPixmap::load(), and QPixmap::loadFromData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createCompatiblePlatformPixmap()

QPlatformPixmap * QPlatformPixmap::createCompatiblePlatformPixmap ( ) const
virtual

Reimplemented in QRasterPlatformPixmap, and QX11PlatformPixmap.

Definition at line 62 of file qplatformpixmap.cpp.

References d, pixelType(), and QGuiApplicationPrivate::platformIntegration().

Referenced by QPixmap::copy(), and QPixmap::fill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ depth()

int QPlatformPixmap::depth ( ) const
inline

Definition at line 90 of file qplatformpixmap.h.

References d.

Referenced by QX11PlatformPixmap::fill(), QX11PlatformPixmap::setMask(), and QX11PlatformPixmap::transformed().

+ Here is the caller graph for this function:

◆ devicePixelRatio()

virtual qreal QPlatformPixmap::devicePixelRatio ( ) const
pure virtual

Implemented in QBlittablePlatformPixmap, QRasterPlatformPixmap, QWindowsDirect2DPlatformPixmap, and QX11PlatformPixmap.

Referenced by mask().

+ Here is the caller graph for this function:

◆ fill()

virtual void QPlatformPixmap::fill ( const QColor & color)
pure virtual

◆ fromData()

bool QPlatformPixmap::fromData ( const uchar * buffer,
uint len,
const char * format,
Qt::ImageConversionFlags flags )
virtual

Reimplemented in QRasterPlatformPixmap.

Definition at line 105 of file qplatformpixmap.cpp.

References fromImage(), QByteArray::fromRawData(), isNull(), makeBitmapCompliantIfNeeded(), QImageReader::read(), and QIODeviceBase::ReadOnly.

+ Here is the call graph for this function:

◆ fromFile()

bool QPlatformPixmap::fromFile ( const QString & filename,
const char * format,
Qt::ImageConversionFlags flags )
virtual

Reimplemented in QDirectFbBlitterPlatformPixmap.

Definition at line 95 of file qplatformpixmap.cpp.

References fileName, fromImage(), isNull(), makeBitmapCompliantIfNeeded(), and QImageReader::read().

Referenced by QDirectFbBlitterPlatformPixmap::fromFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromImage()

virtual void QPlatformPixmap::fromImage ( const QImage & image,
Qt::ImageConversionFlags flags )
pure virtual

Implemented in QBlittablePlatformPixmap, QRasterPlatformPixmap, QWindowsDirect2DPlatformPixmap, and QX11PlatformPixmap.

Referenced by copy(), fromData(), fromFile(), fromImageReader(), and setMask().

+ Here is the caller graph for this function:

◆ fromImageInPlace()

virtual void QPlatformPixmap::fromImageInPlace ( QImage & image,
Qt::ImageConversionFlags flags )
inlinevirtual

Reimplemented in QRasterPlatformPixmap.

Definition at line 46 of file qplatformpixmap.h.

Referenced by QPixmap::fromImage().

+ Here is the caller graph for this function:

◆ fromImageReader()

void QPlatformPixmap::fromImageReader ( QImageReader * imageReader,
Qt::ImageConversionFlags flags )
virtual

Reimplemented in QRasterPlatformPixmap.

Definition at line 88 of file qplatformpixmap.cpp.

References fromImage().

+ Here is the call graph for this function:

◆ hasAlphaChannel()

virtual bool QPlatformPixmap::hasAlphaChannel ( ) const
pure virtual

Implemented in QBlittablePlatformPixmap, QRasterPlatformPixmap, QWindowsDirect2DPlatformPixmap, and QX11PlatformPixmap.

Referenced by mask().

+ Here is the caller graph for this function:

◆ height()

int QPlatformPixmap::height ( ) const
inline

Definition at line 88 of file qplatformpixmap.h.

Referenced by QX11PlatformPixmap::fill(), QDirectFbBackingStore::resize(), QBlittablePlatformPixmap::resize(), QRasterPlatformPixmap::resize(), QWindowsDirect2DPlatformPixmap::resize(), QX11PlatformPixmap::resize(), QX11PlatformPixmap::setMask(), and QX11PlatformPixmap::transformed().

+ Here is the caller graph for this function:

◆ isNull()

bool QPlatformPixmap::isNull ( ) const
inline

Definition at line 91 of file qplatformpixmap.h.

Referenced by fromData(), QRasterPlatformPixmap::fromData(), fromFile(), and QPixmap::operator!().

+ Here is the caller graph for this function:

◆ mask()

QBitmap QPlatformPixmap::mask ( ) const
virtual

Reimplemented in QX11PlatformPixmap.

Definition at line 130 of file qplatformpixmap.cpp.

References Qt::color0, Qt::color1, devicePixelRatio(), QImage::Format_ARGB32, QImage::Format_ARGB32_Premultiplied, QImage::Format_MonoLSB, QBitmap::fromImage(), h, hasAlphaChannel(), mask(), qAlpha(), QRgb, toImage(), and w.

Referenced by mask().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ metric()

virtual int QPlatformPixmap::metric ( QPaintDevice::PaintDeviceMetric metric) const
pure virtual

◆ paintEngine()

virtual QPaintEngine * QPlatformPixmap::paintEngine ( ) const
pure virtual

◆ pixelType()

PixelType QPlatformPixmap::pixelType ( ) const
inline

◆ resize()

virtual void QPlatformPixmap::resize ( int width,
int height )
pure virtual

◆ scroll()

bool QPlatformPixmap::scroll ( int dx,
int dy,
const QRect & rect )
virtual

Reimplemented in QRasterPlatformPixmap, and QX11PlatformPixmap.

Definition at line 122 of file qplatformpixmap.cpp.

References Q_UNUSED, and rect.

◆ serialNumber()

int QPlatformPixmap::serialNumber ( ) const
inline

Definition at line 77 of file qplatformpixmap.h.

◆ setDetachNumber()

void QPlatformPixmap::setDetachNumber ( int detNo)
protected

Definition at line 218 of file qplatformpixmap.cpp.

Referenced by QRasterPlatformPixmap::createPixmapForImage().

+ Here is the caller graph for this function:

◆ setDevicePixelRatio()

virtual void QPlatformPixmap::setDevicePixelRatio ( qreal scaleFactor)
pure virtual

◆ setMask()

void QPlatformPixmap::setMask ( const QBitmap & mask)
virtual

Reimplemented in QX11PlatformPixmap.

Definition at line 166 of file qplatformpixmap.cpp.

References Qt::AutoColor, QImage::convertToFormat(), QImage::Format_ARGB32_Premultiplied, QImage::Format_MonoLSB, QImage::Format_RGB32, fromImage(), h, i, QRgb, QImage::scanLine(), toImage(), and w.

+ Here is the call graph for this function:

◆ setSerialNumber()

◆ toImage() [1/2]

virtual QImage QPlatformPixmap::toImage ( ) const
pure virtual

Implemented in QBlittablePlatformPixmap, QRasterPlatformPixmap, QWindowsDirect2DPlatformPixmap, and QX11PlatformPixmap.

Referenced by QRasterPaintEngine::drawPixmap(), mask(), setMask(), toImage(), and transformed().

+ Here is the caller graph for this function:

◆ toImage() [2/2]

QImage QPlatformPixmap::toImage ( const QRect & rect) const
virtual

Reimplemented in QRasterPlatformPixmap, QWindowsDirect2DPlatformPixmap, and QX11PlatformPixmap.

Definition at line 223 of file qplatformpixmap.cpp.

References rect, and toImage().

+ Here is the call graph for this function:

◆ transformed()

QPixmap QPlatformPixmap::transformed ( const QTransform & matrix,
Qt::TransformationMode mode ) const
virtual

Reimplemented in QX11PlatformPixmap.

Definition at line 207 of file qplatformpixmap.cpp.

References QPixmap::fromImage(), toImage(), and transformed().

Referenced by transformed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ width()

int QPlatformPixmap::width ( ) const
inline

Definition at line 87 of file qplatformpixmap.h.

Referenced by QX11PlatformPixmap::fill(), QDirectFbBackingStore::resize(), QBlittablePlatformPixmap::resize(), QRasterPlatformPixmap::resize(), QWindowsDirect2DPlatformPixmap::resize(), QX11PlatformPixmap::resize(), QX11PlatformPixmap::setMask(), and QX11PlatformPixmap::transformed().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QExplicitlySharedDataPointer< QPlatformPixmap >

Definition at line 116 of file qplatformpixmap.h.

◆ QImagePixmapCleanupHooks

friend class QImagePixmapCleanupHooks
friend

Definition at line 115 of file qplatformpixmap.h.

◆ QOpenGLTextureCache

friend class QOpenGLTextureCache
friend

Definition at line 116 of file qplatformpixmap.h.

◆ QPixmap

friend class QPixmap
friend

Definition at line 113 of file qplatformpixmap.h.

Referenced by QX11PlatformPixmap::mask(), and QX11PlatformPixmap::transformed().

◆ QX11PlatformPixmap

Member Data Documentation

◆ d

◆ h

◆ is_null

◆ w


The documentation for this class was generated from the following files: