Supported Browsers Home   
DrawEllipseList Previous   
DrawLineInt Next   
GA_2DRenderFuncs Up   

DrawFatEllipseList

Draws a list of solid scanlines for a fat ellipse engine back end.

Declaration

void NAPI GA_2DRenderFuncs::DrawFatEllipseList(
    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 solid scanlines starting at the specified location in the currently active color and mix. 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.

This function will always be provided by accelerated drivers, and will be implemented with whatever hardware rendering function provides the fastest possible method of rendering scanlines with the installed hardware.

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]) {
        SolidScan(i,scans[LEFTL],scans[LEFTR]);
        SolidScan(i,scans[RIGHTL],scans[RIGHTR]);
        SolidScan(j,scans[LEFTL],scans[LEFTR]);
        SolidScan(j,scans[RIGHTL],scans[RIGHTR]);
        }
    else {
        SolidScan(i,scans[LEFTL],scans[RIGHTR]);
        SolidScan(j,scans[LEFTL],scans[RIGHTR]);
        }
    }
if ((height+1) & 1) {
    if (scans[LEFTR] < scans[RIGHTL]) {
        SolidScan(i,scans[LEFTL],scans[LEFTR]);
        SolidScan(i,scans[RIGHTL],scans[RIGHTR]);
        }
    else {
        SolidScan(i,scans[LEFTL],scans[RIGHTR]);
        }
    }

See Also

DrawEllipseList, DrawPattEllipseList, GA_2DRenderFuncs_DrawColorPattEllipseList, DrawPattFatEllipseList, GA_2DRenderFuncs_DrawColorPattFatEllipseList

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com