#include <rfb/rfb.h>
#include "private.h"
#include "turbojpeg.h"
Go to the source code of this file.
Data Structures |
struct | TIGHT_CONF |
struct | COLOR_LIST |
struct | PALETTE_ENTRY |
struct | PALETTE |
Defines |
#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 | 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) |
Define Documentation
#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; \
}
Definition at line 579 of file tight.c.
#define DEFINE_FAST_FILL_PALETTE_FUNCTION |
( |
|
bpp |
) |
|
#define DEFINE_FILL_PALETTE_FUNCTION |
( |
|
bpp |
) |
|
#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; \
} \
} \
}
Definition at line 1460 of file tight.c.
#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); \
} \
}
Definition at line 1709 of file tight.c.
#define DEFINE_MONO_ENCODE_FUNCTION |
( |
|
bpp |
) |
|
#define HASH_FUNC16 |
( |
|
rgb |
) |
((int)((((rgb) >> 8) + (rgb)) & 0xFF)) |
#define HASH_FUNC32 |
( |
|
rgb |
) |
((int)((((rgb) >> 16) + ((rgb) >> 8)) & 0xFF)) |
#define MAX_SPLIT_TILE_SIZE 16 |
#define MIN_SOLID_SUBRECT_SIZE 2048 |
#define MIN_SPLIT_RECT_SIZE 4096 |
#define TIGHT_MIN_TO_COMPRESS 12 |
Function Documentation
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 | |
|
) |
| | |
void rfbTightCleanup |
( |
rfbScreenInfoPtr |
screen |
) |
|