GPELineParms (Compact 2013)

3/26/2014

This structure controls line drawing for GPE and display drivers. Some of the members of GPELineParms come from applications, while GPE calculates and sets the rest.

Syntax

struct GPELineParms {
  SCODE (GPE::* pLine)(GPELineParms* );
  long xStart;
  long yStart;
  int cPels;
  unsigned long dM;
  unsigned long dN;
  long llGamma;
  int iDir;
  unsigned long style;
  int styleState;
  GPESurf* pDst;
  COLOR solidColor;
  RECTL* prclClip;
  unsigned short mix;
};

Members

  • xStart
    Starting horizontal point of the line.
  • yStart
    Starting vertical point of the line.
  • cPels
    Length in pixels of the line in the major direction.
  • dM
    Length of the line in the horizontal and vertical directions, calculated in 1/16ths of a pixel. Set to the larger of the horizontal and vertical values.
  • dN
    Length of the line in the horizontal and vertical directions, calculated in 1/16ths of a pixel. Set to the smaller of the horizontal and vertical values.
  • llGamma
    Typically, the initial starting value for the slope iterations.
  • iDir
    Octant number for the line.
  • style
    Line attributes, such as solid or dashed.
  • styleState
    State of the line style in the current path, measured in pixels.
  • pDst
    Pointer to the line's destination surface.
  • solidColor
    Brush color.
  • prclClip
    Clipping rectangle.
  • mix
    Two-byte value consisting of two different ROP2 values, which are alternated between according to the bit pattern in the style member.

Remarks

The style, styleState, and mixmembers work together to define the pattern of pixels that are drawn along the line's length. The mix member specifies two ROP2 values, one in each byte. The first byte can be thought of as the ROP2 for pixels in the line that are "on," while the second is for pixels that are "off." The style member is treated as a 32-bit pattern of alternation between the ROP values in mix. The bits that are set in style correspond to the "on" ROP2, while the unset bits correspond to the "off" ROP2. For example, a style value of 0xF0F0F0F0 would alternate between the ROP2 values in four-pixel groups, because the bit pattern consists of alternating groups of four ones and four zeros (1111, 0000). Finally, the styleState member acts as an offset into style. That is, if styleState equals 12, then the pattern of alternating ROP2 values would start with whatever ROP2 is specified by the twelfth bit in style.

It can be useful to specify a nonzero value for styleState if you need to ensure that both ends of a line are drawn with the same ROP2 value. For example, if the "off" ROP2 corresponds to the window's background color, and the style member is 0xF0F0F0F0, then a visual error of as much as 4 pixels would be possible depending on the line's exact length. To avoid such errors, find a value x for styleState such that the xth and (x + cPels mod 32) bits in style are set. For example, if cPels were 48, and style was 0xF0F0F0F0, then a value of 2 would suffice. Often, many such styleState values suffice, and you can make the choice on other criteria, such as how many set bits are drawn on each end of the line. You can also use the styleState member to make a style pattern appear continuous while drawing several line segments that are connected end-to-end.

Requirements

Header

gpe.h

See Also

Reference

Display Driver Structures