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

#include <qscreenvnc_p.h>

Public Functions

void read (QTcpSocket *s)
 
void read (QTcpSocket *s)
 
void write (QTcpSocket *s)
 
void write (QTcpSocket *s)
 

Static Public Functions

static int size ()
 
static int size ()
 

Public Variables

bool bigEndian
 
int bitsPerPixel
 
int blueBits
 
int blueShift
 
int depth
 
int greenBits
 
int greenShift
 
int redBits
 
int redShift
 
bool trueColor
 

Detailed Description

Definition at line 158 of file qscreenvnc_p.h.

Functions

◆ read() [1/2]

void QRfbPixelFormat::read ( QTcpSocket s)

Definition at line 381 of file qscreenvnc_qws.cpp.

Referenced by QVNCServer::setPixelFormat().

382 {
383  char buf[16];
384  s->read(buf, 16);
385  bitsPerPixel = buf[0];
386  depth = buf[1];
387  bigEndian = buf[2];
388  trueColor = buf[3];
389 
390  quint16 a = ntohs(*(quint16 *)(buf + 4));
391  redBits = 0;
392  while (a) { a >>= 1; redBits++; }
393 
394  a = ntohs(*(quint16 *)(buf + 6));
395  greenBits = 0;
396  while (a) { a >>= 1; greenBits++; }
397 
398  a = ntohs(*(quint16 *)(buf + 8));
399  blueBits = 0;
400  while (a) { a >>= 1; blueBits++; }
401 
402  redShift = buf[10];
403  greenShift = buf[11];
404  blueShift = buf[12];
405 }
long ASN1_INTEGER_get ASN1_INTEGER * a
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
Definition: qiodevice.cpp:791
unsigned short quint16
Definition: qglobal.h:936

◆ read() [2/2]

void QRfbPixelFormat::read ( QTcpSocket s)

◆ size() [1/2]

static int QRfbPixelFormat::size ( )
inlinestatic

Definition at line 161 of file qscreenvnc_p.h.

Referenced by QRfbServerInit::size().

161 { return 16; }

◆ size() [2/2]

static int QRfbPixelFormat::size ( )
inlinestatic

Definition at line 163 of file qvncserver.h.

163 { return 16; }

◆ write() [1/2]

void QRfbPixelFormat::write ( QTcpSocket s)

Definition at line 407 of file qscreenvnc_qws.cpp.

408 {
409  char buf[16];
410  buf[0] = bitsPerPixel;
411  buf[1] = depth;
412  buf[2] = bigEndian;
413  buf[3] = trueColor;
414 
415  quint16 a = 0;
416  for (int i = 0; i < redBits; i++) a = (a << 1) | 1;
417  *(quint16 *)(buf + 4) = htons(a);
418 
419  a = 0;
420  for (int i = 0; i < greenBits; i++) a = (a << 1) | 1;
421  *(quint16 *)(buf + 6) = htons(a);
422 
423  a = 0;
424  for (int i = 0; i < blueBits; i++) a = (a << 1) | 1;
425  *(quint16 *)(buf + 8) = htons(a);
426 
427  buf[10] = redShift;
428  buf[11] = greenShift;
429  buf[12] = blueShift;
430  s->write(buf, 16);
431 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned short quint16
Definition: qglobal.h:936
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
Definition: qiodevice.cpp:1342

◆ write() [2/2]

void QRfbPixelFormat::write ( QTcpSocket s)

Properties

◆ bigEndian

bool QRfbPixelFormat::bigEndian

Definition at line 168 of file qscreenvnc_p.h.

Referenced by QVNCServer::readClient(), and QVNCServer::setPixelFormat().

◆ bitsPerPixel

int QRfbPixelFormat::bitsPerPixel

◆ blueBits

int QRfbPixelFormat::blueBits

◆ blueShift

int QRfbPixelFormat::blueShift

◆ depth

int QRfbPixelFormat::depth

Definition at line 167 of file qscreenvnc_p.h.

Referenced by QVNCServer::readClient(), and QVNCServer::setPixelFormat().

◆ greenBits

int QRfbPixelFormat::greenBits

◆ greenShift

int QRfbPixelFormat::greenShift

◆ redBits

int QRfbPixelFormat::redBits

◆ redShift

int QRfbPixelFormat::redShift

◆ trueColor

bool QRfbPixelFormat::trueColor

Definition at line 169 of file qscreenvnc_p.h.

Referenced by QVNCServer::readClient(), and QVNCServer::setPixelFormat().


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