Format Markdown for better GitHub rendering
This includes: - Spacing after headers (on line, after line) - Dashes before bullet lists - Code examples surrounded by triple-backticks
This commit is contained in:
parent
07cd3eb9ed
commit
a932a1210a
1 changed files with 50 additions and 28 deletions
50
protocol.md
50
protocol.md
|
|
@ -11,9 +11,11 @@ The header of a pixelvloed packet consists of two bytes. The first byte defines
|
||||||
The data of a pixelvloed packet contains information on which pixels should get what color. The representation of this information is heavily dependent on the protocol used and is explained below.
|
The data of a pixelvloed packet contains information on which pixels should get what color. The representation of this information is heavily dependent on the protocol used and is explained below.
|
||||||
|
|
||||||
## Protocol: 0 (0x00)
|
## Protocol: 0 (0x00)
|
||||||
|
|
||||||
Protocol 0 is the simplest and easiest to use. Full 24 bit colors can be used with optional alpha.
|
Protocol 0 is the simplest and easiest to use. Full 24 bit colors can be used with optional alpha.
|
||||||
|
|
||||||
### Header
|
### Header
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x00.) |
|
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x00.) |
|
||||||
|
|
@ -21,11 +23,13 @@ Protocol 0 is the simplest and easiest to use. Full 24 bit colors can be used wi
|
||||||
| | bit 0 | Alpha enable bit. (0: alpha is disabled. 1: alpha is enabled.) |
|
| | bit 0 | Alpha enable bit. (0: alpha is disabled. 1: alpha is enabled.) |
|
||||||
|
|
||||||
### Data
|
### Data
|
||||||
|
|
||||||
The data describes the X and Y coordinates and the R, G, B and optional alpha color values. Multiple pixels can be send in one message.
|
The data describes the X and Y coordinates and the R, G, B and optional alpha color values. Multiple pixels can be send in one message.
|
||||||
|
|
||||||
#### Alpha disabled
|
#### Alpha disabled
|
||||||
Bytes/pixel: 7
|
|
||||||
Pixels/message: 160
|
- Bytes/pixel: 7
|
||||||
|
- Pixels/message: 160
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -38,8 +42,9 @@ Pixels/message: 160
|
||||||
| byte 6 | bit 7-0 | B color value. |
|
| byte 6 | bit 7-0 | B color value. |
|
||||||
|
|
||||||
#### Alpha enabled
|
#### Alpha enabled
|
||||||
Bytes/pixel: 8
|
|
||||||
Pixels/message: 140
|
- Bytes/pixel: 8
|
||||||
|
- Pixels/message: 140
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -53,9 +58,11 @@ Pixels/message: 140
|
||||||
| byte 7 | bit 7-0 | Alpha color value. |
|
| byte 7 | bit 7-0 | Alpha color value. |
|
||||||
|
|
||||||
## Protocol: 1 (0x01) Only supported on the C server
|
## Protocol: 1 (0x01) Only supported on the C server
|
||||||
|
|
||||||
Protocol 1 compresses the coordinates so more pixels may be send in one message. Full 24 bit colors can be used with optinal alpha.
|
Protocol 1 compresses the coordinates so more pixels may be send in one message. Full 24 bit colors can be used with optinal alpha.
|
||||||
|
|
||||||
### Header
|
### Header
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x01.) |
|
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x01.) |
|
||||||
|
|
@ -63,11 +70,13 @@ Protocol 1 compresses the coordinates so more pixels may be send in one message.
|
||||||
| | bit 0 | Alpha enable bit. (0: alpha is disabled. 1: alpha is enabled.) |
|
| | bit 0 | Alpha enable bit. (0: alpha is disabled. 1: alpha is enabled.) |
|
||||||
|
|
||||||
### Data
|
### Data
|
||||||
|
|
||||||
The data describes the X and Y coordinates and the R, G, B and optional alpha color values. Multiple pixels can be send in one message.
|
The data describes the X and Y coordinates and the R, G, B and optional alpha color values. Multiple pixels can be send in one message.
|
||||||
|
|
||||||
#### Alpha disabled
|
#### Alpha disabled
|
||||||
Bytes/pixel: 6
|
|
||||||
Pixels/message: 186
|
- Bytes/pixel: 6
|
||||||
|
- Pixels/message: 186
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -80,8 +89,9 @@ Pixels/message: 186
|
||||||
| byte 5 | bit 7-0 | B color value. |
|
| byte 5 | bit 7-0 | B color value. |
|
||||||
|
|
||||||
#### Alpha enabled
|
#### Alpha enabled
|
||||||
Bytes/pixel: 7
|
|
||||||
Pixels/message: 160
|
- Bytes/pixel: 7
|
||||||
|
- Pixels/message: 160
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -95,9 +105,11 @@ Pixels/message: 160
|
||||||
| byte 6 | bit 7-0 | Alpha color value. |
|
| byte 6 | bit 7-0 | Alpha color value. |
|
||||||
|
|
||||||
## Protocol: 2 (0x02) Only supported on the C server
|
## Protocol: 2 (0x02) Only supported on the C server
|
||||||
|
|
||||||
Protocol 2 compresses the coordinates and colors so more pixels may be send in one message. Only 8 bit colors can be used with optinal alpha.
|
Protocol 2 compresses the coordinates and colors so more pixels may be send in one message. Only 8 bit colors can be used with optinal alpha.
|
||||||
|
|
||||||
### Header
|
### Header
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x02.) |
|
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x02.) |
|
||||||
|
|
@ -105,11 +117,13 @@ Protocol 2 compresses the coordinates and colors so more pixels may be send in o
|
||||||
| | bit 0 | Alpha enable bit. (0: alpha is disabled. 1: alpha is enabled.) |
|
| | bit 0 | Alpha enable bit. (0: alpha is disabled. 1: alpha is enabled.) |
|
||||||
|
|
||||||
### Data
|
### Data
|
||||||
|
|
||||||
The data describes the X and Y coordinates and the R, G, B and optional alpha color values. Multiple pixels can be send in one message.
|
The data describes the X and Y coordinates and the R, G, B and optional alpha color values. Multiple pixels can be send in one message.
|
||||||
|
|
||||||
#### Alpha disabled
|
#### Alpha disabled
|
||||||
Bytes/pixel: 4
|
|
||||||
Pixels/message: 280
|
- Bytes/pixel: 4
|
||||||
|
- Pixels/message: 280
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -122,8 +136,9 @@ Pixels/message: 280
|
||||||
| byte 3 | bit 1-0 | 2 bit B color value. |
|
| byte 3 | bit 1-0 | 2 bit B color value. |
|
||||||
|
|
||||||
#### Alpha enabled
|
#### Alpha enabled
|
||||||
Bytes/pixel: 4
|
|
||||||
Pixels/message: 280
|
- Bytes/pixel: 4
|
||||||
|
- Pixels/message: 280
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -137,9 +152,11 @@ Pixels/message: 280
|
||||||
| byte 3 | bit 1-0 | 2 bit alpha color value. |
|
| byte 3 | bit 1-0 | 2 bit alpha color value. |
|
||||||
|
|
||||||
## Protocol: 3 (0x03) Only supported on the C server
|
## Protocol: 3 (0x03) Only supported on the C server
|
||||||
|
|
||||||
Protocol 3 compresses the coordinates and colors so more pixels may be send in one message. Only 8 bit colors can be used with optinal alpha.
|
Protocol 3 compresses the coordinates and colors so more pixels may be send in one message. Only 8 bit colors can be used with optinal alpha.
|
||||||
|
|
||||||
### Header
|
### Header
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x03.) |
|
| byte 0 | bit 7-0 | Protocol version. (For this protocol always 0x03.) |
|
||||||
|
|
@ -148,10 +165,11 @@ Protocol 3 compresses the coordinates and colors so more pixels may be send in o
|
||||||
| | bit 1-0 | 2 bit B color value for all pixels in this message. |
|
| | bit 1-0 | 2 bit B color value for all pixels in this message. |
|
||||||
|
|
||||||
### Data
|
### Data
|
||||||
|
|
||||||
The data describes the X and Y coordinates. Multiple pixels can be send in one message.
|
The data describes the X and Y coordinates. Multiple pixels can be send in one message.
|
||||||
|
|
||||||
Bytes/pixel: 3
|
- Bytes/pixel: 3
|
||||||
Pixels/message: 373
|
- Pixels/message: 373
|
||||||
|
|
||||||
| Byte | Bit | Contents |
|
| Byte | Bit | Contents |
|
||||||
|--------|---------|-------------------------------------------------------------------------------|
|
|--------|---------|-------------------------------------------------------------------------------|
|
||||||
|
|
@ -164,10 +182,14 @@ Pixels/message: 373
|
||||||
|
|
||||||
A pixelvloed server should broadcast a package advertising its settings with the following string content
|
A pixelvloed server should broadcast a package advertising its settings with the following string content
|
||||||
|
|
||||||
|
```
|
||||||
"%s:%f %s:%d %d*%d" % (PROTOCOL_PREAMBLE, PROTOCOL_VERSION, UDP_IP, UDP_PORT, width, height)
|
"%s:%f %s:%d %d*%d" % (PROTOCOL_PREAMBLE, PROTOCOL_VERSION, UDP_IP, UDP_PORT, width, height)
|
||||||
|
```
|
||||||
|
|
||||||
A client should listen for these packages, split it on spaces and check the preample and protocol_version to see if it is capable of speaking the requested protocol.
|
A client should listen for these packages, split it on spaces and check the preample and protocol_version to see if it is capable of speaking the requested protocol.
|
||||||
|
|
||||||
An example of a broadcasted packet would be:
|
An example of a broadcasted packet would be:
|
||||||
|
|
||||||
|
```
|
||||||
pixelvloed:1.00 192.168.0.1:5005 1920*1080
|
pixelvloed:1.00 192.168.0.1:5005 1920*1080
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue