Development: Difference between revisions
imported>Zekiah m Spelling fixes |
imported>Zekiah More info about pixel packet |
||
| Line 9: | Line 9: | ||
=== Pixel packet: === | === Pixel packet: === | ||
The pixel packet is one of the simplest. It is a six byte packet, the first byte being the '''code,''' the '''position (board index)''' of the pixel, represented by a 4 byte unsigned 32 bit integer, and finally a byte representing the index of the '''colour''' in the palette that the pixel represents. | The pixel packet is one of the simplest. It is a six byte packet, the first byte being the '''code,''' the '''position (board index)''' of the pixel, represented by a 4 byte unsigned 32 bit integer, and finally a byte representing the index of the '''colour''' in the palette that the pixel represents. | ||
One can retrieve the X and Y from an given pixel index with some basic maths. To get the X position, we do '''index % CanvasWidth''', and to get the Y position '''Maht.Floor(index / CanvasHeight)'''. | |||