Qt 4.8
Public Functions | Public Variables | List of all members
QX11AlphaDetector Struct Reference

Public Functions

bool hasAlpha () const
 
bool hasXRenderAndAlpha () const
 
 QX11AlphaDetector (const QImage *i, Qt::ImageConversionFlags flags)
 

Public Variables

bool checked
 
bool has
 
const QImageimage
 

Detailed Description

Definition at line 379 of file qpixmap_x11.cpp.

Constructors and Destructors

◆ QX11AlphaDetector()

QX11AlphaDetector::QX11AlphaDetector ( const QImage i,
Qt::ImageConversionFlags  flags 
)
inline

Definition at line 396 of file qpixmap_x11.cpp.

397  : image(i), checked(false), has(false)
398  {
399  if (flags & Qt::NoOpaqueDetection) {
400  checked = true;
402  }
403  }
const QImage * image
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
Definition: qimage.cpp:6495

Functions

◆ hasAlpha()

bool QX11AlphaDetector::hasAlpha ( ) const
inline

Definition at line 381 of file qpixmap_x11.cpp.

Referenced by QX11PixmapData::fromImage().

381  {
382  if (checked)
383  return has;
384  // Will implicitly also check format and return quickly for opaque types...
385  checked = true;
386  has = image->isNull() ? false : const_cast<QImage *>(image)->data_ptr()->checkForAlphaPixels();
387  return has;
388  }
bool isNull() const
Returns true if it is a null image, otherwise returns false.
Definition: qimage.cpp:1542
const QImage * image
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
void * data_ptr(const QTransform &t)
Definition: qpainter_p.h:81

◆ hasXRenderAndAlpha()

bool QX11AlphaDetector::hasXRenderAndAlpha ( ) const
inline

Definition at line 390 of file qpixmap_x11.cpp.

Referenced by QX11PixmapData::fromImage().

390  {
391  if (!X11->use_xrender)
392  return false;
393  return hasAlpha();
394  }
#define X11
Definition: qt_x11_p.h:724
bool hasAlpha() const

Properties

◆ checked

bool QX11AlphaDetector::checked
mutable

Definition at line 406 of file qpixmap_x11.cpp.

◆ has

bool QX11AlphaDetector::has
mutable

Definition at line 407 of file qpixmap_x11.cpp.

◆ image

const QImage* QX11AlphaDetector::image

Definition at line 405 of file qpixmap_x11.cpp.


The documentation for this struct was generated from the following file: