int x, int y, int width, int height,
quint32 color);
-typedef void (*SrcOverBlendFunc)(uchar *destPixels, int dbpl,
- const uchar *src, int spbl,
- int w, int h,
- int const_alpha);
-
-typedef void (*SrcOverScaleFunc)(uchar *destPixels, int dbpl,
- const uchar *src, int spbl, int srch,
- const QRectF &targetRect,
- const QRectF &sourceRect,
- const QRect &clipRect,
- int const_alpha);
-
-typedef void (*SrcOverTransformFunc)(uchar *destPixels, int dbpl,
- const uchar *src, int spbl,
- const QRectF &targetRect,
- const QRectF &sourceRect,
- const QRect &clipRect,
- const QTransform &targetRectTransform,
- int const_alpha);
-
-typedef void (*MemRotateFunc)(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl);
-
struct DrawHelper {
ProcessSpans blendColor;
ProcessSpans blendGradient;
template <class T>
inline void qt_memfill(T *dest, const T value, int count)
{
- memset(dest, value, count);
+ ::memset(dest, value, count);
}
template <class DST, class SRC>
template <> \
inline void qt_memconvert(T *dest, const T *src, int count) \
{ \
- memcpy(dest, src, count * sizeof(T)); \
+ ::memcpy(dest, src, count * sizeof(T)); \
}
QT_TRIVIAL_MEMCONVERT_IMPL(quint32)
QT_TRIVIAL_MEMCONVERT_IMPL(qrgb888)
}
}
-void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
- const QImage &img,
- SrcOverBlendFunc func,
- const QRect &clip,
- int alpha,
- const QRect &sr)
-{
- if (alpha == 0 || !clip.isValid())
- return;
-
- Q_ASSERT(img.depth() >= 8);
-
- const int srcBPL = img.bytesPerLine();
- const uchar *srcBits = img.constBits();
- const int srcSize = img.depth() >> 3; // This is the part that is incompatible with lower than 8-bit..
- int iw = img.width();
- int ih = img.height();
-
- if (!sr.isEmpty()) {
- iw = sr.width();
- ih = sr.height();
- // Adjust the image according to the source offset...
- srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize);
- }
-
- // adapt the x parameters
- int x = qRound(pt.x());
- int cx1 = clip.x();
- int cx2 = clip.x() + clip.width();
- if (x < cx1) {
- int d = cx1 - x;
- srcBits += srcSize * d;
- iw -= d;
- x = cx1;
- }
- if (x + iw > cx2) {
- int d = x + iw - cx2;
- iw -= d;
- }
- if (iw <= 0)
- return;
-
- // adapt the y paremeters...
- int cy1 = clip.y();
- int cy2 = clip.y() + clip.height();
- int y = qRound(pt.y());
- if (y < cy1) {
- int d = cy1 - y;
- srcBits += srcBPL * d;
- ih -= d;
- y = cy1;
- }
- if (y + ih > cy2) {
- int d = y + ih - cy2;
- ih -= d;
- }
- if (ih <= 0)
- return;
-
- // call the blend function...
- int dstSize = rasterBuffer->bytesPerPixel();
- int dstBPL = rasterBuffer->bytesPerLine();
- func(rasterBuffer->buffer() + x * dstSize + y * dstBPL, dstBPL,
- srcBits, srcBPL,
- iw, ih,
- alpha);
-}
-
-
void QRasterPaintEnginePrivate::systemStateChanged()
{
deviceRectUnclipped = QRect(0, 0,
void systemStateChanged();
- void drawImage(const QPointF &pt, const QImage &img, SrcOverBlendFunc func,
- const QRect &clip, int alpha, const QRect &sr = QRect());
-
QTransform brushMatrix() const {
Q_Q(const QRasterPaintEngine);
const QRasterPaintEngineState *s = q->state();