1910 for (
int y = 0; y < map->
mapHeight; ++y) {
1911 for (
int x = 0; x < map->
mapWidth; ++x) {
1912 if (!map->
dirty(x, y))
1915 MAP_TILE_SIZE, MAP_TILE_SIZE);
1926 const char tmp[2] = { 0, 0 };
1927 socket->
write(tmp,
sizeof(tmp));
1931 const quint16 count = htons(rects.size());
1932 socket->
write((
char *)&count,
sizeof(count));
1935 if (rects.size() <= 0) {
1942 for (
int i = 0; i < rects.size(); ++i) {
1943 const QRect tileRect = rects.at(i);
1944 const QRfbRect rect(tileRect.
x(), tileRect.
y(),
1948 const quint32 encoding = htonl(0);
1949 socket->
write((
char *)&encoding,
sizeof(encoding));
1953 + rect.x * screenImage.
depth() / 8;
1955 #ifndef QT_NO_QWS_CURSOR 1961 if (doBlendCursor) {
1965 tileImage = screenImage.
copy(tileRect);
1968 screendata = tileImage.
bits();
1972 #endif // QT_NO_QWS_CURSOR 1982 for (
int i = 0; i < rect.h; ++i) {
1984 screendata += linestep;
1989 for (
int i = 0; i < rect.h; ++i) {
1990 socket->
write((
const char*)screendata, rect.w * bytesPerPixel);
1991 screendata += linestep;
void convertPixels(char *dst, const char *src, int count) const
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
bool dirty(int x, int y) const
char * data()
Returns a pointer to the data stored in the byte array.
bool flush()
This function writes as much as possible from the internal write buffer to the underlying network soc...
bool hasClientCursor() const
static int bytesPerPixel(QImage::Format format)
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 width() const
Returns the width of the rectangle.
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
int bytesPerLine() const
Returns the number of bytes per image scanline.
int height() const
Returns the height of the rectangle.
bool doPixelConversion() const
QVNCScreen * screen() const
bool isAccelerated() const
Returns true if the cursor is accelerated; otherwise false.
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QTcpSocket class provides a TCP socket.
The QRegion class specifies a clip region for a painter.
int depth() const
Returns the depth of the image.
const char * constData() const
Returns a pointer to the data stored in the byte array.
void write(QTcpSocket *s) const
uchar * bits()
Returns a pointer to the first pixel data.
QTcpSocket * clientSocket() const
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
int y() const
Returns the y-coordinate of the rectangle's top edge.
QVNCDirtyMap * dirtyMap() const
int x() const
Returns the x-coordinate of the rectangle's left edge.
QRect boundingRect() const
Returns the cursor's bounding rectangle.
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
void resize(int size)
Sets the size of the byte array to size bytes.
The QRect class defines a rectangle in the plane using integer precision.
int size() const
Returns the number of bytes in this byte array.
static void blendCursor(QImage &image, const QRect &imageRect)
QImage screenImage() const
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Q_GUI_EXPORT QScreenCursor * qt_screencursor
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
void setClean(int x, int y)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
SocketState state() const
Returns the state of the socket.
QPoint offset() const
Returns the logical offset of the screen, i.
int clientBytesPerPixel() const