Qt 4.8
Public Functions | Public Variables | List of all members
QVolatileImageData Class Reference

#include <qvolatileimagedata_p.h>

Inheritance diagram for QVolatileImageData:
QSharedData

Public Functions

void beginDataAccess () const
 
void * duplicateNativeImage () const
 
void endDataAccess (bool readOnly=false) const
 
bool ensureFormat (QImage::Format format)
 
void ensureImage ()
 
 QVolatileImageData ()
 
 QVolatileImageData (int w, int h, QImage::Format format)
 
 QVolatileImageData (const QImage &sourceImage)
 
 QVolatileImageData (void *nativeImage, void *nativeMask)
 
 QVolatileImageData (const QVolatileImageData &other)
 
 ~QVolatileImageData ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 

Public Variables

QImage image
 
QPaintEnginepengine
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Definition at line 65 of file qvolatileimagedata_p.h.

Constructors and Destructors

◆ QVolatileImageData() [1/5]

QVolatileImageData::QVolatileImageData ( )

Definition at line 47 of file qvolatileimagedata.cpp.

48  : pengine(0)
49 {
50 }

◆ QVolatileImageData() [2/5]

QVolatileImageData::QVolatileImageData ( int  w,
int  h,
QImage::Format  format 
)

Definition at line 52 of file qvolatileimagedata.cpp.

53  : pengine(0)
54 {
55  image = QImage(w, h, format);
56 }
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87

◆ QVolatileImageData() [3/5]

QVolatileImageData::QVolatileImageData ( const QImage sourceImage)

Definition at line 58 of file qvolatileimagedata.cpp.

59  : pengine(0)
60 {
61  image = sourceImage;
62 }

◆ QVolatileImageData() [4/5]

QVolatileImageData::QVolatileImageData ( void *  nativeImage,
void *  nativeMask 
)

Definition at line 64 of file qvolatileimagedata.cpp.

65  : pengine(0)
66 {
67  // Not supported.
68 }

◆ QVolatileImageData() [5/5]

QVolatileImageData::QVolatileImageData ( const QVolatileImageData other)

Definition at line 70 of file qvolatileimagedata.cpp.

71  : QSharedData()
72 {
73  image = other.image;
74  // The detach is not mandatory here but we do it nonetheless in order to
75  // keep the behavior consistent with other platforms.
76  image.detach();
77  pengine = 0;
78 }
QSharedData()
Constructs a QSharedData object with a reference count of 0.
Definition: qshareddata.h:61
void detach()
If multiple images share common data, this image makes a copy of the data and detaches itself from th...
Definition: qimage.cpp:1359

◆ ~QVolatileImageData()

QVolatileImageData::~QVolatileImageData ( )

Definition at line 80 of file qvolatileimagedata.cpp.

81 {
82  delete pengine;
83 }

Functions

◆ beginDataAccess()

void QVolatileImageData::beginDataAccess ( ) const

Definition at line 85 of file qvolatileimagedata.cpp.

Referenced by QVolatileImage::beginDataAccess(), and QVolatileImage::toImage().

86 {
87  // nothing to do here
88 }

◆ duplicateNativeImage()

void * QVolatileImageData::duplicateNativeImage ( ) const

Definition at line 104 of file qvolatileimagedata.cpp.

Referenced by QVolatileImage::duplicateNativeImage().

105 {
106  return 0;
107 }

◆ endDataAccess()

void QVolatileImageData::endDataAccess ( bool  readOnly = false) const

Definition at line 90 of file qvolatileimagedata.cpp.

Referenced by QVolatileImage::endDataAccess(), and QVolatileImage::toImage().

91 {
92  Q_UNUSED(readOnly);
93  // nothing to do here
94 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ ensureFormat()

bool QVolatileImageData::ensureFormat ( QImage::Format  format)

Definition at line 96 of file qvolatileimagedata.cpp.

Referenced by QVolatileImage::ensureFormat().

97 {
98  if (image.format() != format) {
100  }
101  return true;
102 }
Format format() const
Returns the format of the image.
Definition: qimage.cpp:2305
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966

◆ ensureImage()

void QVolatileImageData::ensureImage ( )

Definition at line 109 of file qvolatileimagedata.cpp.

Referenced by QVolatileImage::fill(), QVolatileImage::imageRef(), and QVolatileImage::setAlphaChannel().

110 {
111  // nothing to do here
112 }

Properties

◆ image

QImage QVolatileImageData::image

◆ pengine

QPaintEngine* QVolatileImageData::pengine

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