|
resonance 1.0.1
|
Cursor over a run length encoded eight bit pixel stream. More...
#include <arle8reader.h>
Public Member Functions | |
| unsigned char * | UnpackRow (unsigned char *pDest) |
| Decode one row into a buffer. | |
| void | UnpackAll (unsigned char *pDest) |
| Decode rows into a buffer until the stream terminates. | |
| void | SkipRow (int nRows) |
| Advance past a number of rows without writing. | |
Public Attributes | |
| const unsigned char * | mSource |
| short | mWidth |
| short | mPad06 |
| int | mTransparentValue |
Cursor over a run length encoded eight bit pixel stream.
The record is not polymorphic and has no RTTI. Its name comes from the debugging symbols of the North American demo release.
The three routines sit at 0x0060da78, 0x0060dc10, and 0x0060dc98, well outside the canvas cluster. 13 of the 15 callers of the first two are ACanvas slots, and the third serves PsTex alone. Which source file they belong to is not settled.
The encoding is one control byte followed by data. The low seven bits are the run length. A set top bit introduces that many literal bytes, and a clear top bit introduces one byte repeated that many times.
A control byte of zero terminates the stream, and both routines examine it only at a row boundary. A row ends when its pixel count is exhausted rather than on a zero, and a zero control byte reached part way through a row is decoded as a run of length zero.
mTransparentValue changes what a run does to the destination rather than what it consumes. A value of zero or more skips a byte equal to it, and kARleReaderNoTransparentValue stores every byte.
| unsigned char * ARle8Reader::UnpackRow | ( | unsigned char * | pDest | ) |
Decode one row into a buffer.
| pDest | The row to write. |
| void ARle8Reader::UnpackAll | ( | unsigned char * | pDest | ) |
Decode rows into a buffer until the stream terminates.
Tests for the terminator before the first row, so an empty stream writes nothing. Each row starts where UnpackRow() ended the previous one, so the rows land contiguously at the width mWidth.
| pDest | The first row to write. |
| void ARle8Reader::SkipRow | ( | int | nRows | ) |
Advance past a number of rows without writing.
mWidth is read once before the first row. A width written between rows is not seen.
| nRows | The number of rows to consume. |
| const unsigned char* ARle8Reader::mSource |
The next control byte. +0x00
| short ARle8Reader::mWidth |
Pixels in one row. +0x04
| short ARle8Reader::mPad06 |
Padding no caller writes. +0x06
| int ARle8Reader::mTransparentValue |
The byte to skip, or kARleReaderNoTransparentValue. +0x08