## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### GreDrawRLE Parameter - pRLEHDR

pRLEHDR (PRLEHDR) - input Pointer to run-length-encoding data header.

Pointer an RLEHDR structure:

    typedef struct {

                     LONG       lType;

                     BRECTL     brectlBounds;

                     PVOID      pRLE;

                   } RLEHDR;

GreDrawRLE always supports lType=0. In this format, the pRLE field in the RLE header points to an array of POINTL structures (see below). The brectlBounds rectangle contains the tightest rectangle that fits around the shape.

The RLE array starts with an (X,Y) pair, where Y is the Y-coordinate, and X is the number of runs on the line. The number of (X,Y) pairs follow, where X is the left side of the run and Y is the right side, exclusive. The next (X,Y) pair holds the header of the next line. The Y-coordinate must increase. If the number of points is 0, the end of the data has been reached. For example, the following array of eight POINTL structures defines two scan lines of run-length-encoded data:

    (3,45), (20,25), (42,56), (100,350),  (Three pairs of runs at Scan Line 45)

    (2,46), (19,26), (43,56),             (Two pairs of runs at Scan Line 46)

    (0,47)                                (End of RLE data indicator)

The presentation driver draws lines between the following device-coordinate -space pairs, inclusive, given the data in the above example:

    (20 ,45) to (24 ,45)

    (42 ,45) to (55 ,45)

    (100,45) to (349,45)

    (19 ,46) to (25 ,46)

    (43 ,46) to (55 ,46)

Notice that pels are drawn up to, but not including, the right coordinate of the run. That is, runs are filled inclusive or exclusive.