本文整理汇总了C++中Swap16IfLE函数的典型用法代码示例。如果您正苦于以下问题:C++ Swap16IfLE函数的具体用法?C++ Swap16IfLE怎么用?C++ Swap16IfLE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Swap16IfLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateFileListErrMsg
FileTransferMsg
CreateFileListErrMsg(char flags)
{
FileTransferMsg fileListMsg;
rfbFileListDataMsg* pFLD = NULL;
char* data = NULL;
unsigned int length = 0;
memset(&fileListMsg, 0, sizeof(FileTransferMsg));
data = (char*) calloc(sizeof(rfbFileListDataMsg), sizeof(char));
if(data == NULL) {
return fileListMsg;
}
length = sizeof(rfbFileListDataMsg) * sizeof(char);
pFLD = (rfbFileListDataMsg*) data;
pFLD->type = rfbFileListData;
pFLD->numFiles = Swap16IfLE(0);
pFLD->dataSize = Swap16IfLE(0);
pFLD->compressedSize = Swap16IfLE(0);
pFLD->flags = flags | 0x80;
fileListMsg.data = data;
fileListMsg.length = length;
return fileListMsg;
}
示例2: rfbSendCursorPos
Bool rfbSendCursorPos(rfbClientPtr cl) {
rfbFramebufferUpdateRectHeader rect;
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
cl->clientCursorLocation = currentCursorLoc();
rect.encoding = Swap32IfLE(rfbEncodingPointerPos);
rect.r.x = Swap16IfLE((CARD16)cl->clientCursorLocation.x);
rect.r.y = Swap16IfLE((CARD16)cl->clientCursorLocation.y);
rect.r.w = 0;
rect.r.h = 0;
memcpy(&cl->updateBuf[cl->ublen], (char *)&rect, sz_rfbFramebufferUpdateRectHeader);
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbRectanglesSent[rfbStatsCursorPosition]++;
cl->rfbBytesSent[rfbStatsCursorPosition] += sz_rfbFramebufferUpdateRectHeader;
if (!rfbSendUpdateBuf(cl))
return FALSE;
return TRUE;
}
示例3: HandleRREBPP
static bool
HandleRREBPP (uint32_t rx, uint32_t ry, uint32_t rw, uint32_t rh)
{
rfbRREHeader hdr;
CARDBPP pix;
rfbRectangle subrect;
if (!ReadFromRFBServer((uint8_t *)&hdr, sz_rfbRREHeader))
return false;
hdr.nSubrects = Swap32IfLE(hdr.nSubrects);
if (!ReadFromRFBServer((uint8_t *)&pix, sizeof(pix)))
return false;
FillBufferRectangle(rx, ry, rw, rh, pix);
for (uint32_t i = 0; i < hdr.nSubrects; i++) {
if (!ReadFromRFBServer((uint8_t *)&pix, sizeof(pix)))
return false;
if (!ReadFromRFBServer((uint8_t *)&subrect, sz_rfbRectangle))
return false;
subrect.x = Swap16IfLE(subrect.x);
subrect.y = Swap16IfLE(subrect.y);
subrect.w = Swap16IfLE(subrect.w);
subrect.h = Swap16IfLE(subrect.h);
FillBufferRectangle(rx + subrect.x, ry + subrect.y,
subrect.w, subrect.h, pix);
}
return true;
}
示例4: CreateFileDownloadBlockSizeDataMsg
FileTransferMsg
CreateFileDownloadBlockSizeDataMsg(unsigned short sizeFile, char *pFile)
{
FileTransferMsg fileDownloadBlockSizeDataMsg;
int length = sz_rfbFileDownloadDataMsg + sizeFile;
rfbFileDownloadDataMsg *pFDD = NULL;
char *pFollow = NULL;
char *pData = (char*) calloc(length, sizeof(char));
memset(&fileDownloadBlockSizeDataMsg, 0, sizeof(FileTransferMsg));
if(NULL == pData) {
rfbLog("File [%s]: Method [%s]: pData is NULL\n",
__FILE__, __FUNCTION__);
return fileDownloadBlockSizeDataMsg;
}
pFDD = (rfbFileDownloadDataMsg *) pData;
pFollow = &pData[sz_rfbFileDownloadDataMsg];
pFDD->type = rfbFileDownloadData;
pFDD->compressLevel = 0;
pFDD->compressedSize = Swap16IfLE(sizeFile);
pFDD->realSize = Swap16IfLE(sizeFile);
memcpy(pFollow, pFile, sizeFile);
fileDownloadBlockSizeDataMsg.data = pData;
fileDownloadBlockSizeDataMsg.length = length;
return fileDownloadBlockSizeDataMsg;
}
示例5: rfbSendRectEncodingHextile
Bool
rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w, int h)
{
rfbFramebufferUpdateRectHeader rect;
if (ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
rect.r.x = Swap16IfLE(x);
rect.r.y = Swap16IfLE(y);
rect.r.w = Swap16IfLE(w);
rect.r.h = Swap16IfLE(h);
rect.encoding = Swap32IfLE(rfbEncodingHextile);
memcpy(&updateBuf[ublen], (char *)&rect,
sz_rfbFramebufferUpdateRectHeader);
ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbRectanglesSent[rfbEncodingHextile]++;
cl->rfbBytesSent[rfbEncodingHextile] += sz_rfbFramebufferUpdateRectHeader;
switch (cl->format.bitsPerPixel) {
case 8:
return sendHextiles8(cl, x, y, w, h);
case 16:
return sendHextiles16(cl, x, y, w, h);
case 32:
return sendHextiles32(cl, x, y, w, h);
}
rfbLog("rfbSendRectEncodingHextile: bpp %d?\n", cl->format.bitsPerPixel);
return FALSE;
}
示例6: Swap16IfLE
// Encode a rectangle
inline UINT
vncEncoder::EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offsetx, int offsety)
{
const int rectW = rect.right - rect.left;
const int rectH = rect.bottom - rect.top;
// Create the header for the update in the destination area
rfbFramebufferUpdateRectHeader *surh = (rfbFramebufferUpdateRectHeader *)dest;
surh->r.x = (CARD16) (rect.left - offsetx);
surh->r.y = (CARD16) (rect.top - offsety);
surh->r.w = (CARD16) (rectW);
surh->r.h = (CARD16) (rectH);
surh->r.x = Swap16IfLE(surh->r.x);
surh->r.y = Swap16IfLE(surh->r.y);
surh->r.w = Swap16IfLE(surh->r.w);
surh->r.h = Swap16IfLE(surh->r.h);
surh->encoding = Swap32IfLE(rfbEncodingRaw);
// Update raw encoding statistics
rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
encodedSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
transmittedSize += sz_rfbFramebufferUpdateRectHeader + ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
// Translate the data in place in the output buffer
Translate(source, dest + sz_rfbFramebufferUpdateRectHeader, rect);
// Return the buffer size
return sz_rfbFramebufferUpdateRectHeader +
(rectW*rectH*m_remoteformat.bitsPerPixel) / 8;
}
示例7: ReadExact
void ClientConnection::ReadCopyRect(rfbFramebufferUpdateRectHeader *pfburh)
{
rfbCopyRect cr;
double tBlitStart;
ReadExact((char *) &cr, sz_rfbCopyRect);
cr.srcX = Swap16IfLE(cr.srcX);
cr.srcY = Swap16IfLE(cr.srcY);
// If *Cursor encoding is used, we should extend our "cursor lock area"
// (previously set to destination rectangle) to the source rect as well.
SoftCursorLockArea(cr.srcX, cr.srcY, pfburh->r.w, pfburh->r.h);
omni_mutex_lock l(m_bitmapdcMutex);
ObjectSelector b(m_hBitmapDC, m_hBitmap);
PaletteSelector p(m_hBitmapDC, m_hPalette);
if (m_opts.m_benchFile) tBlitStart = getTime();
if (!BitBlt(m_hBitmapDC, pfburh->r.x, pfburh->r.y, pfburh->r.w, pfburh->r.h,
m_hBitmapDC, cr.srcX, cr.srcY, SRCCOPY))
vnclog.Print(0, "Error in blit in ClientConnection::CopyRect\n");
if (m_opts.m_benchFile) tBlit += getTime() - tBlitStart;
}
示例8: compress
void
vncEncodeZlib::SendZlibrects(VSocket *outConn)
{
int NRects=m_nNbRects;
const int rawDataSize = (m_Queuelen);
const int maxCompSize = (m_Queuelen + (m_Queuelen/100) + 8);
if (NRects==0) return; // NO update
if (m_nNbRects<3 && !must_be_zipped)
{
outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
m_nNbRects=0;
m_Queuelen=0;
encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
return;
}
m_nNbRects=0;
m_Queuelen=0;
must_be_zipped=false;
int nRet = compress((unsigned char*)(m_QueueCompressedbuffer),
(unsigned long*)&maxCompSize,
(unsigned char*)m_Queuebuffer,
rawDataSize
);
if (nRet != 0)
{
vnclog.Print(LL_INTINFO, VNCLOG("compression error"));
return ;
}
int rawDataSize1=rawDataSize/65535;
int rawDataSize2=rawDataSize%65535;
rfbFramebufferUpdateRectHeader CacheRectsHeader;
CacheRectsHeader.r.x = (CARD16)(NRects);
CacheRectsHeader.r.y = (CARD16)(rawDataSize2);
CacheRectsHeader.r.w = (CARD16)(rawDataSize1);
CacheRectsHeader.r.x = Swap16IfLE(CacheRectsHeader.r.x);
CacheRectsHeader.r.y = Swap16IfLE(CacheRectsHeader.r.y);
CacheRectsHeader.r.w = Swap16IfLE(CacheRectsHeader.r.w);
CacheRectsHeader.r.h = 0;
CacheRectsHeader.encoding = Swap32IfLE(rfbEncodingSolMonoZip);
// Format the ZlibHeader
rfbZlibHeader CacheZipHeader;
CacheZipHeader.nBytes = Swap32IfLE(maxCompSize);
vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),maxCompSize,rawDataSize,NRects);
outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader));
outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader));
outConn->SendExactQueue((char *)m_QueueCompressedbuffer, maxCompSize);
// Update statistics
encodedSize += sz_rfbZlibHeader + maxCompSize;
rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
transmittedSize += maxCompSize+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader;
}
示例9: lzo1x_1_compress
void
vncEncodeUltra::SendUltrarects(VSocket *outConn)
{
int NRects=m_nNbRects;
const lzo_uint rawDataSize = (m_Queuelen);
if (NRects==0) return; // NO update
if (m_nNbRects<3 && !must_be_zipped)
{
outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
m_nNbRects=0;
m_Queuelen=0;
encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
return;
}
m_nNbRects=0;
m_Queuelen=0;
must_be_zipped=false;
lzo1x_1_compress(m_Queuebuffer,rawDataSize,m_QueueCompressedbuffer,&out_len,wrkmem);
if (out_len>rawDataSize)
{
outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
m_nNbRects=0;
m_Queuelen=0;
encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
return;
}
int rawDataSize1=rawDataSize/65535;
int rawDataSize2=rawDataSize%65535;
rfbFramebufferUpdateRectHeader CacheRectsHeader;
CacheRectsHeader.r.x = (CARD16)(NRects);
CacheRectsHeader.r.y = (CARD16)(rawDataSize2);
CacheRectsHeader.r.w = (CARD16)(rawDataSize1);
CacheRectsHeader.r.x = Swap16IfLE(CacheRectsHeader.r.x);
CacheRectsHeader.r.y = Swap16IfLE(CacheRectsHeader.r.y);
CacheRectsHeader.r.w = Swap16IfLE(CacheRectsHeader.r.w);
CacheRectsHeader.r.h = 0;
CacheRectsHeader.encoding = Swap32IfLE(rfbEncodingUltraZip);
// Format the UltraHeader
rfbZlibHeader CacheZipHeader;
CacheZipHeader.nBytes = Swap32IfLE(out_len);
vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),out_len,rawDataSize,NRects);
outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader));
outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader));
outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len);
// Update statistics
encodedSize += sz_rfbZlibHeader + out_len;
rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
transmittedSize += out_len+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader;
}
示例10: HandleRREBPP
static Bool
HandleRREBPP (int rx, int ry, int rw, int rh)
{
rfbRREHeader hdr;
XGCValues gcv;
int i;
CARDBPP pix;
rfbRectangle subrect;
if (!ReadFromRFBServer((char *)&hdr, sz_rfbRREHeader))
return False;
hdr.nSubrects = Swap32IfLE(hdr.nSubrects);
if (!ReadFromRFBServer((char *)&pix, sizeof(pix)))
return False;
#if (BPP == 8)
gcv.foreground = (appData.useBGR233 ? BGR233ToPixel[pix] : pix);
#else
gcv.foreground = pix;
#endif
XChangeGC(dpy, gc, GCForeground, &gcv);
XFillRectangle(dpy, desktopWin, gc, rx, ry, rw, rh);
#if VNC_CAPTURE
myxfillrec(dpy, gc, rx, ry, rw, rh);
#endif
for (i = 0; i < hdr.nSubrects; i++) {
if (!ReadFromRFBServer((char *)&pix, sizeof(pix)))
return False;
if (!ReadFromRFBServer((char *)&subrect, sz_rfbRectangle))
return False;
subrect.x = Swap16IfLE(subrect.x);
subrect.y = Swap16IfLE(subrect.y);
subrect.w = Swap16IfLE(subrect.w);
subrect.h = Swap16IfLE(subrect.h);
#if (BPP == 8)
gcv.foreground = (appData.useBGR233 ? BGR233ToPixel[pix] : pix);
#else
gcv.foreground = pix;
#endif
XChangeGC(dpy, gc, GCForeground, &gcv);
XFillRectangle(dpy, desktopWin, gc, rx + subrect.x, ry + subrect.y,
subrect.w, subrect.h);
#if VNC_CAPTURE
myxfillrec(dpy, gc, rx+ subrect.x, ry+ subrect.y, subrect.w, subrect.h);
#endif
}
return True;
}
示例11: SetFormatAndEncodings
Bool
SetFormatAndEncodings()
{
printf("--- SetFormatAndEncodings\n");
rfbSetPixelFormatMsg spf;
char buf[sz_rfbSetEncodingsMsg + MAX_ENCODINGS * 4];
rfbSetEncodingsMsg *se = (rfbSetEncodingsMsg *)buf;
CARD32 *encs = (CARD32 *)(&buf[sz_rfbSetEncodingsMsg]);
int len = 0;
int i;
spf.type = rfbSetPixelFormat;
spf.format = myFormat;
spf.format.redMax = Swap16IfLE(spf.format.redMax);
spf.format.greenMax = Swap16IfLE(spf.format.greenMax);
spf.format.blueMax = Swap16IfLE(spf.format.blueMax);
spf.format.bigEndian = (*(char *)&endianTest ? 0 : 1);
if(!WriteExact(rfbsock, (char *)&spf, sz_rfbSetPixelFormatMsg))
return False;
se->type = rfbSetEncodings;
se->nEncodings = 0;
for(i = 0; i < nExplicitEncodings; i++)
{
encs[se->nEncodings++] = Swap32IfLE(explicitEncodings[i]);
}
if(SameMachine(rfbsock))
{
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRaw);
}
if(addCopyRect)
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCopyRect);
// if(addHextile)
// encs[se->nEncodings++] = Swap32IfLE(rfbEncodingHextile);
// if(addCoRRE)
// encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCoRRE);
if(addRRE)
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRRE);
if(addUseAlpha)
{
encs[se->nEncodings++] = Swap32IfLE(rfbEncSpecialUseAlpha);
printf("--- Set: rfbEncSpecialUseAlpha\n");
}
len = sz_rfbSetEncodingsMsg + se->nEncodings * 4;
se->nEncodings = Swap16IfLE(se->nEncodings);
if(!WriteExact(rfbsock, buf, len)) return False;
return True;
}
示例12: ReadExact
void ClientConnection::ReadCopyRect(rfbFramebufferUpdateRectHeader *pfburh) {
rfbCopyRect cr;
ReadExact((char *) &cr, sz_rfbCopyRect);
cr.srcX = Swap16IfLE(cr.srcX);
cr.srcY = Swap16IfLE(cr.srcY);
// By sure the rect is insite the border memcopy does not like it
if (!Check_Rectangle_borders(pfburh->r.x, pfburh->r.y, pfburh->r.w, pfburh->r.h)) return;
if (!Check_Rectangle_borders(cr.srcX, cr.srcY, pfburh->r.w, pfburh->r.h)) return;
// tight If *Cursor encoding is used, we should extend our "cursor lock area"
// (previously set to destination rectangle) to the source rect as well.
SoftCursorLockArea(cr.srcX, cr.srcY, pfburh->r.w, pfburh->r.h);
if (m_DIBbits)
{
omni_mutex_lock l(m_bitmapdcMutex);
int bytesPerInputRow = m_si.framebufferWidth * m_myFormat.bitsPerPixel/8;
int bytesPerOutputRow = pfburh->r.w * m_myFormat.bitsPerPixel/8;
int OutputHeight=pfburh->r.h;
BYTE *sourcepos,*iptr,*destpos,*optr;
if (cr.srcY<=pfburh->r.y)
{
{
destpos = (BYTE*)m_DIBbits + (bytesPerInputRow * (pfburh->r.y+pfburh->r.h-1))+(pfburh->r.x * m_myFormat.bitsPerPixel/8);
sourcepos = (BYTE*)m_DIBbits + (bytesPerInputRow * (cr.srcY+pfburh->r.h-1))+((cr.srcX) * m_myFormat.bitsPerPixel/8);
iptr=sourcepos;
optr=destpos;
while (OutputHeight > 0) {
memcpy(optr, iptr, bytesPerOutputRow);
iptr -= bytesPerInputRow;
optr -= bytesPerInputRow;
OutputHeight--;
}
}
}
else if (cr.srcY>pfburh->r.y)
{
{
destpos = (BYTE*)m_DIBbits + (bytesPerInputRow * pfburh->r.y)+(pfburh->r.x * m_myFormat.bitsPerPixel/8);
sourcepos = (BYTE*)m_DIBbits + (bytesPerInputRow * (cr.srcY))+((cr.srcX) * m_myFormat.bitsPerPixel/8);
iptr=sourcepos;
optr=destpos;
while (OutputHeight > 0) {
memcpy(optr, iptr, bytesPerOutputRow);
iptr += bytesPerInputRow;
optr += bytesPerInputRow;
OutputHeight--;
}
}
}
}
}
示例13: Swap16IfLE
// Send the encoder-generated palette to the client
// This function only returns FALSE if the SendExact fails - any other
// error is coped with internally...
BOOL
vncClient::SendPalette()
{
rfbSetColourMapEntriesMsg setcmap;
RGBQUAD *rgbquad;
UINT ncolours = 256;
// Reserve space for the colour data
rgbquad = new RGBQUAD[ncolours];
if (rgbquad == NULL)
return TRUE;
// Get the data
if (!m_encodemgr.GetPalette(rgbquad, ncolours))
{
delete [] rgbquad;
return TRUE;
}
// Compose the message
setcmap.type = rfbSetColourMapEntries;
setcmap.firstColour = Swap16IfLE(0);
setcmap.nColours = Swap16IfLE(ncolours);
if (!m_socket->SendExact((char *) &setcmap, sz_rfbSetColourMapEntriesMsg))
{
delete [] rgbquad;
return FALSE;
}
// Now send the actual colour data...
for (int i=0; i<ncolours; i++)
{
struct _PIXELDATA {
CARD16 r, g, b;
} pixeldata;
pixeldata.r = Swap16IfLE(((CARD16)rgbquad[i].rgbRed) << 8);
pixeldata.g = Swap16IfLE(((CARD16)rgbquad[i].rgbGreen) << 8);
pixeldata.b = Swap16IfLE(((CARD16)rgbquad[i].rgbBlue) << 8);
if (!m_socket->SendExact((char *) &pixeldata, sizeof(pixeldata)))
{
delete [] rgbquad;
return FALSE;
}
}
// Delete the rgbquad data
delete [] rgbquad;
return TRUE;
}
示例14: l
void ClientConnection::ReadUltraZip(rfbFramebufferUpdateRectHeader *pfburh,HRGN *prgn)
{
UINT nNbCacheRects = pfburh->r.x;
UINT numRawBytes = pfburh->r.y+pfburh->r.w*65535;
UINT numCompBytes;
lzo_uint new_len;
rfbZlibHeader hdr;
// Read in the rfbZlibHeader
omni_mutex_lock l(m_bitmapdcMutex);
ReadExact((char *)&hdr, sz_rfbZlibHeader);
numCompBytes = Swap32IfLE(hdr.nBytes);
// Check the net buffer
CheckBufferSize(numCompBytes);
// Read the compressed data
ReadExact((char *)m_netbuf, numCompBytes);
// Verify buffer space for cache rects list
CheckZlibBufferSize(numRawBytes+500);
lzo1x_decompress((BYTE*)m_netbuf,numCompBytes,(BYTE*)m_zlibbuf,&new_len,NULL);
BYTE* pzipbuf = m_zlibbuf;
for (UINT i = 0 ; i < nNbCacheRects; i++)
{
rfbFramebufferUpdateRectHeader surh;
memcpy((char *) &surh,pzipbuf, sz_rfbFramebufferUpdateRectHeader);
surh.r.x = Swap16IfLE(surh.r.x);
surh.r.y = Swap16IfLE(surh.r.y);
surh.r.w = Swap16IfLE(surh.r.w);
surh.r.h = Swap16IfLE(surh.r.h);
surh.encoding = Swap32IfLE(surh.encoding);
pzipbuf += sz_rfbFramebufferUpdateRectHeader;
RECT rect;
rect.left = surh.r.x;
rect.right = surh.r.x + surh.r.w;
rect.top = surh.r.y;
rect.bottom = surh.r.y + surh.r.h;
//border check
if (!Check_Rectangle_borders(rect.left,rect.top,surh.r.w,surh.r.h)) return;
SoftCursorLockArea(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
if ( surh.encoding==rfbEncodingRaw)
{
UINT numpixels = surh.r.w * surh.r.h;
if (m_DIBbits) ConvertAll(surh.r.w,surh.r.h,surh.r.x, surh.r.y,m_myFormat.bitsPerPixel/8,(BYTE *)pzipbuf,(BYTE *)m_DIBbits,m_si.framebufferWidth);
pzipbuf +=numpixels*m_myFormat.bitsPerPixel/8;
if (!m_opts.m_Directx)InvalidateRegion(&rect,prgn);
}
}
}
示例15: SendPointerEvent
Bool
SendPointerEvent(int x, int y, int buttonMask)
{
rfbPointerEventMsg pe;
pe.type = rfbPointerEvent;
pe.buttonMask = buttonMask;
if(x < 0) x = 0;
if(y < 0) y = 0;
pe.x = Swap16IfLE(x);
pe.y = Swap16IfLE(y);
return WriteExact(rfbsock, (char *)&pe, sz_rfbPointerEventMsg);
}