|
|
|
|
DrawColorPattFatEllipseList
Draws a list of color patterned scanlines for a fat ellipse engine back end.
Declaration
void NAPI GA_2DRenderFuncs::DrawColorPattFatEllipseList(
N_int32 y,
N_int32 length,
N_int32 height,
N_int16 *scans)
Prototype In
snap/graphics.h
Parameters
y |
Y coordinate for scanline |
length |
Number of scanlines in the list |
height |
Height of the ellipse minor axis + pen height adjustment |
scans |
Pointer to an array of scanline data |
Description
This function renders a list of color patterned scanlines starting at the specified location in the currently active mix and color pattern. This function forms the back end of a fast fat pen ellipse rendering engine, but does not actually compute the scanlines in the list itself since the the pixelisation rules are usually different for different device driver environments.
The scanline coordinates are passed as an array of 16-bit integer coordinates, packed in mutiples of 4 coordinates for a single scanline list. The first coordinate is the LEFTL coordinate, the second is the LEFTR, the third is the RIGHTL and the fourth is the RIGHTR coordinate. For each scanline in the list (each list defines two scanlines at the same Y coordinate), this routine will render a scanline from LEFT to RIGHT (exclusive) at increasing Y coordinates. The calling code must always guarantee that the LEFT coordinates will be less than the RIGHT coordinates, and that they will never be equal for each scanline.
The algorithm used internally in the drivers to render the list of scanlines is similar to the following:
for (i = 0,j = height; i < length; i++,j--,scans += 4) {
if (scans[LEFTR] < scans[RIGHTL]) {
ColorPattScan(i,scans[LEFTL],scans[LEFTR]);
ColorPattScan(i,scans[RIGHTL],scans[RIGHTR]);
ColorPattScan(j,scans[LEFTL],scans[LEFTR]);
ColorPattScan(j,scans[RIGHTL],scans[RIGHTR]);
}
else {
ColorPattScan(i,scans[LEFTL],scans[RIGHTR]);
ColorPattScan(j,scans[LEFTL],scans[RIGHTR]);
}
}
if ((height+1) & 1) {
if (scans[LEFTR] < scans[RIGHTL]) {
ColorPattScan(i,scans[LEFTL],scans[LEFTR]);
ColorPattScan(i,scans[RIGHTL],scans[RIGHTR]);
}
else {
ColorPattScan(i,scans[LEFTL],scans[RIGHTR]);
}
}
See Also
DrawEllipseList, DrawPattEllipseList, GA_2DRenderFuncs_DrawColorPattEllipseList, DrawFatEllipseList, DrawPattFatEllipseList
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com