#include <qdebug.h>
#include <qglobal.h>
#include <qlibrary.h>
#include <qt_windows.h>
#include <QtGui/qpaintdevice.h>
#include <QtGui/qwidget.h>
#include "private/qwindowsurface_raster_p.h"
#include "private/qnativeimage_p.h"
#include "private/qwidget_p.h"
#include "private/qpixmap_x11_p.h"
#include "private/qt_x11_p.h"
#include "qx11info_x11.h"
#include "private/qdrawhelper_p.h"
#include <private/qt_cocoa_helpers_mac_p.h>
#include <QMainWindow>
#include <private/qmainwindowlayout_p.h>
#include <QToolBar>
Go to the source code of this file.
◆ qt_scrollRectInImage()
void qt_scrollRectInImage |
( |
QImage & |
img, |
|
|
const QRect & |
rect, |
|
|
const QPoint & |
offset |
|
) |
| |
Definition at line 345 of file qwindowsurface.cpp.
Referenced by QRasterWindowSurface::scroll(), and QRasterWindowSurface::setGeometry().
351 int depth = img.
depth() >> 3;
363 if (r.top() < p.
y()) {
364 src = mem + r.bottom() * lineskip + r.left() * depth;
365 dest = mem + (p.
y() + r.height() - 1) * lineskip + p.
x() * depth;
366 lineskip = -lineskip;
368 src = mem + r.top() * lineskip + r.left() * depth;
369 dest = mem + p.
y() * lineskip + p.
x() * depth;
372 const int w = r.width();
374 const int bytes = w * depth;
377 if (offset.
y() == 0 &&
qAbs(offset.
x()) < w) {
379 ::memmove(dest, src, bytes);
385 ::memcpy(dest, src, bytes);
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
int bytesPerLine() const
Returns the number of bytes per image scanline.
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QImage class provides a hardware-independent image representation that allows direct access to th...
int depth() const
Returns the depth of the image.
int width() const
Returns the width of the image.
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the image.
int y() const
Returns the y coordinate of this point.
int x() const
Returns the x coordinate of this point.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.