LibVNCServer/LibVNCClient
Data Structures | Macros | Functions
tight.c File Reference
#include <rfb/rfb.h>
#include "private.h"
#include "turbojpeg.h"
+ Include dependency graph for tight.c:

Go to the source code of this file.

Data Structures

struct  TIGHT_CONF
 
struct  COLOR_LIST
 
struct  PALETTE_ENTRY
 
struct  PALETTE
 

Macros

#define TIGHT_MIN_TO_COMPRESS   12
 
#define MIN_SPLIT_RECT_SIZE   4096
 
#define MIN_SOLID_SUBRECT_SIZE   2048
 
#define MAX_SPLIT_TILE_SIZE   16
 
#define TLS
 
#define DEFINE_CHECK_SOLID_FUNCTION(bpp)
 
#define DEFINE_FILL_PALETTE_FUNCTION(bpp)
 
#define DEFINE_FAST_FILL_PALETTE_FUNCTION(bpp)
 
#define HASH_FUNC16(rgb)   ((int)((((rgb) >> 8) + (rgb)) & 0xFF))
 
#define HASH_FUNC32(rgb)   ((int)((((rgb) >> 16) + ((rgb) >> 8)) & 0xFF))
 
#define DEFINE_IDX_ENCODE_FUNCTION(bpp)
 
#define DEFINE_MONO_ENCODE_FUNCTION(bpp)
 
#define DEFINE_JPEG_GET_ROW_FUNCTION(bpp)
 

Functions

void rfbTightCleanup (rfbScreenInfoPtr screen)
 
int rfbNumCodedRectsTight (rfbClientPtr cl, int x, int y, int w, int h)
 
rfbBool rfbSendRectEncodingTight (rfbClientPtr cl, int x, int y, int w, int h)
 
rfbBool rfbSendRectEncodingTightPng (rfbClientPtr cl, int x, int y, int w, int h)
 
rfbBool rfbSendTightHeader (rfbClientPtr cl, int x, int y, int w, int h)
 
rfbBool rfbSendCompressedDataTight (rfbClientPtr cl, char *buf, int compressedLen)
 

Macro Definition Documentation

◆ DEFINE_CHECK_SOLID_FUNCTION

#define DEFINE_CHECK_SOLID_FUNCTION (   bpp)
Value:
\
static rfbBool \
CheckSolidTile##bpp(rfbClientPtr cl, int x, int y, int w, int h, \
uint32_t* colorPtr, rfbBool needSameColor) \
{ \
uint##bpp##_t *fbptr; \
uint##bpp##_t colorValue; \
int dx, dy; \
\
fbptr = (uint##bpp##_t *)&cl->scaledScreen->frameBuffer \
[y * cl->scaledScreen->paddedWidthInBytes + x * (bpp/8)]; \
\
colorValue = *fbptr; \
if (needSameColor && (uint32_t)colorValue != *colorPtr) \
return FALSE; \
\
for (dy = 0; dy < h; dy++) { \
for (dx = 0; dx < w; dx++) { \
if (colorValue != fbptr[dx]) \
return FALSE; \
} \
fbptr = (uint##bpp##_t *)((uint8_t *)fbptr \
+ cl->scaledScreen->paddedWidthInBytes); \
} \
\
*colorPtr = (uint32_t)colorValue; \
return TRUE; \
}
int x
Definition: SDLvncviewer.c:34
#define TRUE
Definition: rfbproto.h:112
int8_t rfbBool
Definition: rfbproto.h:108
int y
Definition: SDLvncviewer.c:34
#define FALSE
Definition: rfbproto.h:110

Definition at line 588 of file tight.c.

◆ DEFINE_FAST_FILL_PALETTE_FUNCTION

#define DEFINE_FAST_FILL_PALETTE_FUNCTION (   bpp)

Definition at line 1255 of file tight.c.

◆ DEFINE_FILL_PALETTE_FUNCTION

#define DEFINE_FILL_PALETTE_FUNCTION (   bpp)

Definition at line 1190 of file tight.c.

◆ DEFINE_IDX_ENCODE_FUNCTION

#define DEFINE_IDX_ENCODE_FUNCTION (   bpp)
Value:
\
static void \
EncodeIndexedRect##bpp(uint8_t *buf, int count) { \
COLOR_LIST *pnode; \
uint##bpp##_t *src; \
uint##bpp##_t rgb; \
int rep = 0; \
\
src = (uint##bpp##_t *) buf; \
\
while (count--) { \
rgb = *src++; \
while (count && *src == rgb) { \
rep++, src++, count--; \
} \
pnode = palette.hash[HASH_FUNC##bpp(rgb)]; \
while (pnode != NULL) { \
if ((uint##bpp##_t)pnode->rgb == rgb) { \
*buf++ = (uint8_t)pnode->idx; \
while (rep) { \
*buf++ = (uint8_t)pnode->idx; \
rep--; \
} \
break; \
} \
pnode = pnode->next; \
} \
} \
}
COLOR_LIST * hash[256]
Definition: tight.c:134
int idx
Definition: tight.c:123

Definition at line 1481 of file tight.c.

◆ DEFINE_JPEG_GET_ROW_FUNCTION

#define DEFINE_JPEG_GET_ROW_FUNCTION (   bpp)
Value:
\
static void \
PrepareRowForImg##bpp(rfbClientPtr cl, uint8_t *dst, int x, int y, int count) { \
uint##bpp##_t *fbptr; \
uint##bpp##_t pix; \
int inRed, inGreen, inBlue; \
\
fbptr = (uint##bpp##_t *) \
&cl->scaledScreen->frameBuffer[y * cl->scaledScreen->paddedWidthInBytes + \
x * (bpp / 8)]; \
\
while (count--) { \
pix = *fbptr++; \
\
inRed = (int) \
(pix >> cl->screen->serverFormat.redShift & cl->screen->serverFormat.redMax); \
inGreen = (int) \
(pix >> cl->screen->serverFormat.greenShift & cl->screen->serverFormat.greenMax); \
inBlue = (int) \
(pix >> cl->screen->serverFormat.blueShift & cl->screen->serverFormat.blueMax); \
\
*dst++ = (uint8_t)((inRed * 255 + cl->screen->serverFormat.redMax / 2) / \
cl->screen->serverFormat.redMax); \
*dst++ = (uint8_t)((inGreen * 255 + cl->screen->serverFormat.greenMax / 2) / \
cl->screen->serverFormat.greenMax); \
*dst++ = (uint8_t)((inBlue * 255 + cl->screen->serverFormat.blueMax / 2) / \
cl->screen->serverFormat.blueMax); \
} \
}
int x
Definition: SDLvncviewer.c:34
int y
Definition: SDLvncviewer.c:34

Definition at line 1733 of file tight.c.

◆ DEFINE_MONO_ENCODE_FUNCTION

#define DEFINE_MONO_ENCODE_FUNCTION (   bpp)

Definition at line 1516 of file tight.c.

◆ HASH_FUNC16

#define HASH_FUNC16 (   rgb)    ((int)((((rgb) >> 8) + (rgb)) & 0xFF))

Definition at line 1363 of file tight.c.

◆ HASH_FUNC32

#define HASH_FUNC32 (   rgb)    ((int)((((rgb) >> 16) + ((rgb) >> 8)) & 0xFF))

Definition at line 1364 of file tight.c.

◆ MAX_SPLIT_TILE_SIZE

#define MAX_SPLIT_TILE_SIZE   16

Definition at line 53 of file tight.c.

◆ MIN_SOLID_SUBRECT_SIZE

#define MIN_SOLID_SUBRECT_SIZE   2048

Definition at line 52 of file tight.c.

◆ MIN_SPLIT_RECT_SIZE

#define MIN_SPLIT_RECT_SIZE   4096

Definition at line 51 of file tight.c.

◆ TIGHT_MIN_TO_COMPRESS

#define TIGHT_MIN_TO_COMPRESS   12

Definition at line 48 of file tight.c.

◆ TLS

#define TLS

Definition at line 65 of file tight.c.

Function Documentation

◆ rfbNumCodedRectsTight()

int rfbNumCodedRectsTight ( rfbClientPtr  cl,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 242 of file tight.c.

◆ rfbSendCompressedDataTight()

rfbBool rfbSendCompressedDataTight ( rfbClientPtr  cl,
char *  buf,
int  compressedLen 
)

Definition at line 1107 of file tight.c.

◆ rfbSendRectEncodingTight()

rfbBool rfbSendRectEncodingTight ( rfbClientPtr  cl,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 270 of file tight.c.

◆ rfbSendRectEncodingTightPng()

rfbBool rfbSendRectEncodingTightPng ( rfbClientPtr  cl,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 281 of file tight.c.

◆ rfbSendTightHeader()

rfbBool rfbSendTightHeader ( rfbClientPtr  cl,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 788 of file tight.c.

◆ rfbTightCleanup()

void rfbTightCleanup ( rfbScreenInfoPtr  screen)

Definition at line 155 of file tight.c.