47 #include <private/qapplication_p.h> 48 #include <private/qgraphicssystem_p.h> 49 #include <private/qblittable_p.h> 51 #include <private/qdrawhelper_p.h> 52 #include <private/qfont_p.h> 54 #ifndef QT_NO_BLITTABLE 62 #ifdef QT_BLITTER_RASTEROVERLAY
63 ,m_rasterOverlay(0), m_unmergedCopy(0)
71 #ifdef QT_BLITTER_RASTEROVERLAY 72 delete m_rasterOverlay;
73 delete m_unmergedCopy;
74 #endif //QT_BLITTER_RASTEROVERLAY 99 d = QApplicationPrivate::platformIntegration()->screens().at(0)->depth();
127 qWarning(
"QRasterPixmapData::metric(): Unhandled metric type %d", metric);
170 pixel = color.
rgba();
195 Qt::ImageConversionFlags flags)
202 QImage correctFormatPic = image;
207 const uchar *bits = correctFormatPic.
bits();
209 while (bytesCopied < correctFormatPic.
byteCount()) {
226 #ifdef QT_BLITTER_RASTEROVERLAY 228 static bool showRasterOverlay = !
qgetenv(
"QT_BLITTER_RASTEROVERLAY").
isEmpty();
230 void QBlittablePixmapData::mergeOverlay()
232 if (m_unmergedCopy || !showRasterOverlay)
241 void QBlittablePixmapData::unmergeOverlay()
243 if (!m_unmergedCopy || !showRasterOverlay)
250 delete m_unmergedCopy;
254 QImage *QBlittablePixmapData::overlay()
256 if (!m_rasterOverlay||
257 m_rasterOverlay->size() !=
QSize(
w,
h)){
259 m_rasterOverlay->fill(0x00000000);
262 m_overlayColor.setAlpha(0x88);
265 return m_rasterOverlay;
268 void QBlittablePixmapData::markRasterOverlayImpl(
const QRectF &rect)
270 if (!showRasterOverlay)
272 QRectF transformationRect = clipAndTransformRect(rect);
273 if(!transformationRect.
isEmpty()) {
281 void QBlittablePixmapData::unmarkRasterOverlayImpl(
const QRectF &rect)
283 if (!showRasterOverlay)
285 QRectF transformationRect = clipAndTransformRect(rect);
286 if (!transformationRect.
isEmpty()) {
288 QColor color(0x00,0x00,0x00,0x00);
295 QRectF QBlittablePixmapData::clipAndTransformRect(
const QRectF &rect)
const 297 QRectF transformationRect = rect;
304 transformationRect &= clipData->
clipRect;
307 for (
int i = 0; i < rects.
size(); i++) {
308 transformationRect &= rects.
at(i);
313 return transformationRect;
316 #endif //QT_BLITTER_RASTEROVERLAY 320 #endif //QT_NO_BLITTABLE virtual void fillRect(const QRectF &rect, const QColor &color)=0
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
void fill(const QColor &color)
void fromImage(const QImage &image, Qt::ImageConversionFlags flags)
#define QT_END_NAMESPACE
This macro expands to.
QRasterPaintEngineState * state()
T * data() const
Returns the value of the pointer referenced by this object.
Q_GUI_EXPORT int qt_defaultDpiY()
void fill(uint pixel)
Fills the entire image with the given pixelValue.
Q_GUI_EXPORT int qt_defaultDpiX()
int byteCount() const
Returns the number of bytes occupied by the image data.
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.
void setBlittable(QBlittable *blittable)
Q_CORE_EXPORT int qrand()
Format format() const
Returns the format of the image.
void markRasterOverlay(const QRectF &)
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
bool hasAlphaChannel() const
Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x)
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
void clip(const QVectorPath &path, Qt::ClipOperation op)
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
QScopedPointer< QBlitterPaintEngine > m_engine
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
const T & at(int i) const
Returns the item at index position i in the vector.
Capabilities capabilities() const
The QBrush class defines the fill pattern of shapes drawn by QPainter.
uchar * bits()
Returns a pointer to the first pixel data.
int width() const
Returns the width of the image.
QPaintEngine * paintEngine() const
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
virtual void alphaFillRect(const QRectF &rect, const QColor &color, QPainter::CompositionMode cmode)
ushort alpha
Returns the alpha color component of this color.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
static QReadWriteLock lock
virtual void copy(const QPixmapData *data, const QRect &rect)
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the image.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
void resize(int width, int height)
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
virtual QBlittable * createBlittable(const QSize &size, bool alpha) const =0
QScopedPointer< QBlittable > m_blittable
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
QBlittable * blittable() const
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
int metric(QPaintDevice::PaintDeviceMetric metric) const
void setSerialNumber(int serNo)
int size() const
Returns the number of items in the vector.
Q_DECL_CONSTEXPR int qRound(qreal d)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.