11#ifndef PROTOCOL_EXTENSIONS_H
12#define PROTOCOL_EXTENSIONS_H
36 rfbMsg(uint8_t type): type(type), modificationCount(0) {}
49 memset(model,
'\0',
sizeof(model));
50 memset(view,
'\0',
sizeof(view));
51 memset(proj,
'\0',
sizeof(proj));
52 memset(head,
'\0',
sizeof(head));
72 if (width != other.
width)
74 if (height != other.
height)
77 for (
int i = 0; i < 16; ++i) {
78 if (model[i] != other.
model[i])
80 if (view[i] != other.
view[i])
82 if (proj[i] != other.
proj[i])
84 if (head[i] != other.
head[i])
91static_assert(
sizeof(matricesMsg) <
RhrMessageSize,
"RHR message too large");
97 memset(pad,
'\0',
sizeof(pad));
99 lights[0].diffuse[0] = lights[0].diffuse[1] = lights[0].diffuse[2] = lights[0].diffuse[3] = 1;
100 lights[0].specular[0] = lights[0].specular[1] = lights[0].specular[2] = lights[0].specular[3] = 1;
104 static const int NumLights = 4;
119 double spot_direction[3];
123 double attenuation[3];
127 memset(
this,
'\0',
sizeof(*
this));
133 spot_direction[2] = -1;
144 for (
int i = 0; i < 4; ++i) {
147 if (ambient[i] != o.
ambient[i])
149 if (diffuse[i] != o.
diffuse[i])
155 for (
int i = 0; i < 3; ++i) {
181 for (
int i = 0; i < NumLights; ++i) {
182 if (lights[i] != o.
lights[i])
188static_assert(
sizeof(lightsMsg) <
RhrMessageSize,
"RHR message too large");
194 memset(pad,
'\0',
sizeof(pad));
195 memset(center,
'\0',
sizeof(center));
249 memset(model,
'\0',
sizeof(model));
250 memset(view,
'\0',
sizeof(view));
251 memset(proj,
'\0',
sizeof(proj));
252 memset(proj,
'\0',
sizeof(head));
292 memset(name,
'\0',
sizeof(name));
314 std::array<char, RhrMessageSize> m_rhr;
Depth quantization for remote hybrid rendering.
#define V_RHREXPORT
Definition: export.h:9
@ rfbTile
send image tile from server to client
Definition: rfbext.h:28
@ rfbAnimation
current/total animation time steps
Definition: rfbext.h:30
@ rfbMatrices
send matrices from client to server
Definition: rfbext.h:26
@ rfbVariant
control visibility of variants
Definition: rfbext.h:31
@ rfbBounds
send scene bounds from server to client
Definition: rfbext.h:29
@ rfbLights
send lighting parameters from client to server
Definition: rfbext.h:27
rfbTileCompressions
Definition: rfbext.h:214
@ rfbTileRaw
Definition: rfbext.h:215
@ rfbTilePredictRGBA
Definition: rfbext.h:223
@ rfbTileDepthZfp
Definition: rfbext.h:220
@ rfbTileJpeg
Definition: rfbext.h:221
@ rfbTileDepthPredictPlanar
Definition: rfbext.h:217
@ rfbTilePredictRGB
Definition: rfbext.h:222
@ rfbTileDepthQuantize
Definition: rfbext.h:218
@ rfbTileClear
Definition: rfbext.h:224
@ rfbTileDepthPredict
Definition: rfbext.h:216
@ rfbTileDepthQuantizePlanar
Definition: rfbext.h:219
rfbMsg RhrSubMessage
header for remote hybrid rendering message
Definition: rfbext.h:300
rfbTileFormats
Definition: rfbext.h:212
@ rfbDepth8Bit
Definition: rfbext.h:212
@ rfbDepth16Bit
Definition: rfbext.h:212
@ rfbColorRGBA
Definition: rfbext.h:212
@ rfbDepth32Bit
Definition: rfbext.h:212
@ rfbDepth24Bit
Definition: rfbext.h:212
@ rfbDepthFloat
Definition: rfbext.h:212
rfbTileFlags
Definition: rfbext.h:205
@ rfbTileRequest
Definition: rfbext.h:209
@ rfbTileFirst
Definition: rfbext.h:207
@ rfbTileNone
Definition: rfbext.h:206
@ rfbTileLast
Definition: rfbext.h:208
@ rfbEyeRight
Definition: rfbext.h:42
@ rfbEyeLeft
Definition: rfbext.h:42
@ rfbEyeMiddle
Definition: rfbext.h:42
const size_t RhrMessageSize
Definition: rfbext.h:22
animation time step on client or no. of animation steps on server changed
Definition: rfbext.h:280
animationMsg()
Definition: rfbext.h:281
double time
time of request - for latency measurement
Definition: rfbext.h:285
int32_t current
timestep currently displayed
Definition: rfbext.h:284
int32_t total
total number of animation timesteps
Definition: rfbext.h:283
send scene bounding sphere from server to client
Definition: rfbext.h:191
double radius
radius of bounding sphere
Definition: rfbext.h:201
boundsMsg()
Definition: rfbext.h:192
uint8_t sendreply
request reply with scene bounding sphere
Definition: rfbext.h:198
store parameters for one OpenGL light source
Definition: rfbext.h:107
double ambient[4]
contribution to ambient lighting (RGBA)
Definition: rfbext.h:115
bool operator!=(const Light &o) const
Definition: rfbext.h:139
Light()
attunuation: 0: constant, 1: linear, 2: quadratic
Definition: rfbext.h:125
double spot_direction[3]
direction of spot light
Definition: rfbext.h:119
uint8_t enabled
whether the light source is enabled
Definition: rfbext.h:109
double position[4]
position
Definition: rfbext.h:113
double spot_cutoff
cut-off coefficient for spot light
Definition: rfbext.h:120
double diffuse[4]
contribution to diffuse lighting (RGBA)
Definition: rfbext.h:116
double specular[4]
contribution to specular highlights (RGBA)
Definition: rfbext.h:117
double attenuation[3]
Definition: rfbext.h:123
double spot_exponent
cut-off exponenent for spot light
Definition: rfbext.h:121
send lighting parameters from client to server
Definition: rfbext.h:94
lightsMsg()
Definition: rfbext.h:95
Light lights[NumLights]
all light sources
Definition: rfbext.h:175
int16_t viewNum
number of window that these lights apply to
Definition: rfbext.h:171
bool operator!=(const lightsMsg &o) const
Definition: rfbext.h:177
send matrices from client to server
Definition: rfbext.h:45
uint8_t eye
0: middle, 1: left, 2: right
Definition: rfbext.h:56
bool operator==(const matricesMsg &other) const
Definition: rfbext.h:66
double model[16]
model matrix
Definition: rfbext.h:61
uint8_t last
1 if this is the last view requested for this frame
Definition: rfbext.h:55
uint16_t width
Definition: rfbext.h:58
double proj[16]
projection matrix
Definition: rfbext.h:63
double head[16]
head matrix
Definition: rfbext.h:64
int16_t viewNum
number of window/view that these matrices apply to
Definition: rfbext.h:57
double view[16]
view matrix
Definition: rfbext.h:62
uint32_t requestNumber
number of render request
Definition: rfbext.h:59
matricesMsg()
Definition: rfbext.h:46
double time
time of request - for latency measurement
Definition: rfbext.h:60
uint16_t height
dimensions of requested viewport
Definition: rfbext.h:58
basic RFB message header
Definition: rfbext.h:35
rfbMsg(uint8_t type)
Definition: rfbext.h:36
uint8_t type
type of RFB message
Definition: rfbext.h:38
uint32_t modificationCount
number of remote scenegraph modifications
Definition: rfbext.h:39
send image tile from server to client
Definition: rfbext.h:228
uint32_t requestNumber
number of request this tile is in response to, copied from matrices request
Definition: rfbext.h:260
tileMsg()
Definition: rfbext.h:229
uint32_t frameNumber
number of frame this tile belongs to
Definition: rfbext.h:259
uint8_t compression
compression,
Definition: rfbext.h:257
uint16_t y
y coordinate of depth sub-image
Definition: rfbext.h:263
uint8_t format
depth format,
Definition: rfbext.h:256
uint8_t eye
0: middle, 1: left, 2: right
Definition: rfbext.h:258
uint32_t size
size of payload,
Definition: rfbext.h:261
uint16_t totalheight
total height of image
Definition: rfbext.h:268
uint16_t height
height of depth sub-image
Definition: rfbext.h:266
double requestTime
time copied from matrices request
Definition: rfbext.h:275
uint16_t totalwidth
total width of image
Definition: rfbext.h:267
uint8_t flags
request depth buffer update
Definition: rfbext.h:255
int32_t unzippedsize
number of rendered timestep
Definition: rfbext.h:270
int16_t viewNum
viewNum this tile belongs to
Definition: rfbext.h:264
uint16_t x
x coordinate of depth sub-image
Definition: rfbext.h:262
uint16_t width
width of depth sub-image
Definition: rfbext.h:265
int32_t timestep
Definition: rfbext.h:269
uint32_t configureVisibility
Definition: rfbext.h:295
uint32_t visible
Definition: rfbext.h:296
variantMsg()
Definition: rfbext.h:290
uint32_t remove
Definition: rfbext.h:297