Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcPrimitiveDraw Class Reference

XFcPrimitiveDraw is a class that handles drawing of 2D vector graphic primitives. More...

Collaboration diagram for XFcPrimitiveDraw:

[legend]
List of all members.

## Public Member Functions
virtual XFCIMPORT | ~XFcPrimitiveDraw ()
| Destructor.
XFCIMPORT void | setColor (UINT32 aColor)
| Sets the color for the rendering (doesn't contain alpha).
XFCIMPORT void | setOpacity (UINT8 aOpacity)
| Sets the opacity for the rendering.
XFCIMPORT void | setFiller (XFcPrimitiveDrawFiller *aFiller)
| Sets the filler for rendering.
XFCIMPORT void | setClippingRect (INT32 aClipMinX, INT32 aClipMinY, INT32 aClipMaxX, INT32 aClipMaxY)
| Sets the clipping rectangle for rendering.
XFCIMPORT void | addPolygon (XFcPrimitiveDrawPointSet *aPointSet, XFcPrimitiveDrawLineSet *aLineSet)
| Adds a polygon for rendering.
XFCIMPORT void | addIndexedSet (XFcPrimitiveDrawIndexedPrimitiveSet *aIndexedSet)
| Adds an indexed edge set (e.g. a circle) for rendering.
XFCIMPORT void | renderEvenOddAA (UINT8 *aData, INT32 aWidth, INT32 aHeight, INT32 aPitch, INT32 aBufferFormat)
| Renders the edges to the surface with antialiasing using even-odd fillrule.
XFCIMPORT void | renderNonZeroAA (UINT8 *aData, INT32 aWidth, INT32 aHeight, INT32 aPitch, INT32 aBufferFormat)
| Renders the edges to the surface with antialiasing using non-zero fillrule.
XFCIMPORT void | renderEvenOdd (UINT8 *aData, INT32 aWidth, INT32 aHeight, INT32 aPitch, INT32 aBufferFormat)
| Renders the edges to the surface without antialiasing using even-odd fillrule.
XFCIMPORT void | renderNonZero (UINT8 *aData, INT32 aWidth, INT32 aHeight, INT32 aPitch, INT32 aBufferFormat)
| Renders the edges to the surface without antialiasing using non-zero fillrule.
## Static Public Member Functions
XFCIMPORT XFcPrimitiveDraw * | create (INT32 aWidth, INT32 aHeight, INT32 aMaxLineCount, INT32 aMaxIndexedEdgeCount)
| Static constructor.
## Protected Member Functions
XFCIMPORT | XFcPrimitiveDraw ()
| Protected constructor.
XFCIMPORT INT | resize (INT32 aWidth, INT32 aHeight)
| Reallocates the tables for new size requirements of the primitivedraw.
XFCIMPORT void | initBitCounter ()
| Init the bit counter that is used for calculating coverages from bit masks.
XFCIMPORT void | clearHiResSpan ()
| Clears the high-resolution 1-bit representation of the scanline.
XFCIMPORT void | clearLoResSpan ()
| Clears the actual color data of the scanline.
XFCIMPORT void | clearScanlines ()
| Clears scanlines in scanline table.
XFCIMPORT void | addScanlines (INT32 aClipTop, INT32 aClipBot)
| Adds edges from member edge set to scanline table.
XFCIMPORT void | insertToAET (XFcPrimitiveDrawEdge *aEdge, XFcPrimitiveDrawEdge *aAETEdge)
| Inserts edge to AET (active edge table).
XFCIMPORT void | insertToSpan (XFcPrimitiveDrawEdge *aEdge, INT32 aMinX, INT32 aMaxX, XFcPrimitiveDrawEdge *aSpanEdge)
| Insets span to span table.
XFCIMPORT void | scanlineToAETandSpanlist (INT32 aYPos, INT32 aMinX, INT32 aMaxX)
| Processes the scanline table at given Y position and add to AET and span list.
XFCIMPORT void | scanlineToAET (INT32 aYPos)
| Processes the scanline table at given Y position and add to AET.
XFCIMPORT void | sortAET ()
| Sorts the AET with bubble sort.
XFCIMPORT void | resetAET ()
| Resets AET.
XFCIMPORT void | spansFromAET (INT32 aMinX, INT32 aMaxX)
| Resets the span information in lines using AET.
XFCIMPORT void | downScaleSpans ()
| Downscales the span coordinates by 8.
XFCIMPORT void | compressSpans ()
| Compresses the spans for conversion & blitting.
XFCIMPORT void | convertSpan ()
| Converts the span from high-res representation to low-res representation.
XFCIMPORT xfcPrimitiveBlitFunction | getBlitFunction (INT32 aBufferFormat)
| Returns the blit function used for the buffer format.
XFCIMPORT void | blitSpan16 (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 16 bit mode, no alpha.
XFCIMPORT void | blitSpan16Alpha (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 16 bit mode with alpha.
XFCIMPORT void | blitSpan16Filled (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 16 bit mode using a filler.
XFCIMPORT void | blitSpan32Alpha (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 32 bit XRGB mode with alpha.
XFCIMPORT void | blitSpan32Filled (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 32 bit XRGB mode using a filler.
XFCIMPORT void | blitSpan32ARGBAlpha (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 32 bit ARGB mode with alpha.
XFCIMPORT void | blitSpan32ARGBFilled (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in 32 bit ARGB mode using a filler.
XFCIMPORT void | blitSpanGenericAlpha (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in generic mode with alpha.
XFCIMPORT void | blitSpanGenericFilled (UINT8 *aData, INT32 aBufferFormat)
| Blits the span to a buffer in generic mode using a filler.
XFCIMPORT void | fillSpan (INT32 aY)
| Fills the span to a temporary scanline buffer using current XFcPrimitiveDrawFiller.
## Protected Attributes
UINT8 * | mHiResSpan
| Pointer to the high res scanline.
UINT8 * | mLoResSpan
| Pointer to the low res scanline.
UINT8 * | mBitCounter
| Pointer to the bit counter table.
UINT32 * | mFillerSpan
| Pointer to the temporary filler scanline.
XFcPrimitiveDrawEdge ** | mScanlineBegin
| Table of pointers to first edges of scanlines.
XFcPrimitiveDrawEdge ** | mScanlineEnd
| Table of pointers to last edges of scanlines.
XFcPrimitiveDrawEdge * | mAETBegin
| Pointer to the first edge in AET.
XFcPrimitiveDrawEdge * | mAETEnd
| Pointer to the last edge in AET.
XFcPrimitiveDrawEdge * | mSpanBegin
| Pointer to the first edge of current span.
XFcPrimitiveDrawEdge * | mSpanEnd
| Pointer to the last edge of current span.
UINT32 | mColorTable [33]
| Pre-computed color values in X6X5X5 format.
INT32 | mWidth
| Width of the maximum rendering area.
INT32 | mHeight
| Height of the maximum rendering ares.
XFcPrimitiveDrawEdgeSet * | mEdgeSet
| Pointer to the edge set containing the primitives.
XFcPrimitiveDrawFiller * | mFiller
| Pointer to a filler that is used for more complex fills.
INT32 | mClipMinX
| Clipping rectangle boundaries.
INT32 | mClipMinY
INT32 | mClipMaxX
INT32 | mClipMaxY
UINT32 | mColor32
| Stored color and alpha values.
UINT16 | mColor16
UINT32 | mAlpha32
UINT32 | mAlpha16

## Detailed Description

XFcPrimitiveDraw is a class that handles drawing of 2D vector graphic primitives.

2D vector graphic primitives can be polygons (defined with XFcPrimitiveDrawLineSet and XFcPrimitiveDrawPointSet) or indexed edge sets (that can be used for describing circles for instance). Primitives are added to an instance of XFDcPrimitiveDraw, after which render() (or some variant of it) is called. Rendering can be performed with XOR-fill (where crossing lines toggle fill on/off - this is the default) or with constant fill (where edge direction defines if fill is toggled off or not). Rendering can be done also with or without antialiasing.

## Constructor & Destructor Documentation

virtual XFCIMPORT XFcPrimitiveDraw::~XFcPrimitiveDraw | ( |  | ) | `[virtual]`

| Destructor.

XFCIMPORT XFcPrimitiveDraw::XFcPrimitiveDraw | ( |  | ) | `[protected]`

| Protected constructor.

## Member Function Documentation

XFCIMPORT void XFcPrimitiveDraw::addIndexedSet | ( | XFcPrimitiveDrawIndexedPrimitiveSet * | aIndexedSet | ) |

| Adds an indexed edge set (e.g. a circle) for rendering. If the edge set is to be rendered with anti-aliasing, the coordinates should be multiplied with 8.

XFCIMPORT void XFcPrimitiveDraw::addPolygon | ( | XFcPrimitiveDrawPointSet * | aPointSet,
|  | XFcPrimitiveDrawLineSet * | aLineSet
| ) |

| Adds a polygon for rendering. If polygon is to be rendered with render anti-aliasing, the coordinates should be multiplied with 8.

XFCIMPORT void XFcPrimitiveDraw::addScanlines | ( | INT32 | aClipTop,
|  | INT32 | aClipBot
| ) | `[protected]`

| Adds edges from member edge set to scanline table.

XFCIMPORT void XFcPrimitiveDraw::blitSpan16 | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 16 bit mode, no alpha.

XFCIMPORT void XFcPrimitiveDraw::blitSpan16Alpha | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 16 bit mode with alpha.

XFCIMPORT void XFcPrimitiveDraw::blitSpan16Filled | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 16 bit mode using a filler.

XFCIMPORT void XFcPrimitiveDraw::blitSpan32Alpha | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 32 bit XRGB mode with alpha.

XFCIMPORT void XFcPrimitiveDraw::blitSpan32ARGBAlpha | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 32 bit ARGB mode with alpha.

XFCIMPORT void XFcPrimitiveDraw::blitSpan32ARGBFilled | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 32 bit ARGB mode using a filler.

XFCIMPORT void XFcPrimitiveDraw::blitSpan32Filled | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in 32 bit XRGB mode using a filler.

XFCIMPORT void XFcPrimitiveDraw::blitSpanGenericAlpha | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in generic mode with alpha.

XFCIMPORT void XFcPrimitiveDraw::blitSpanGenericFilled | ( | UINT8 * | aData,
|  | INT32 | aBufferFormat
| ) | `[protected]`

| Blits the span to a buffer in generic mode using a filler.

XFCIMPORT void XFcPrimitiveDraw::clearHiResSpan | ( |  | ) | `[protected]`

| Clears the high-resolution 1-bit representation of the scanline.

XFCIMPORT void XFcPrimitiveDraw::clearLoResSpan | ( |  | ) | `[protected]`

| Clears the actual color data of the scanline.

XFCIMPORT void XFcPrimitiveDraw::clearScanlines | ( |  | ) | `[protected]`

| Clears scanlines in scanline table.

XFCIMPORT void XFcPrimitiveDraw::compressSpans | ( |  | ) | `[protected]`

| Compresses the spans for conversion & blitting.

XFCIMPORT void XFcPrimitiveDraw::convertSpan | ( |  | ) | `[protected]`

| Converts the span from high-res representation to low-res representation.

XFCIMPORT XFcPrimitiveDraw* XFcPrimitiveDraw::create | ( | INT32 | aWidth,
|  | INT32 | aHeight,
|  | INT32 | aMaxLineCount,
|  | INT32 | aMaxIndexedEdgeCount
| ) | `[static]`

| Static constructor.

XFCIMPORT void XFcPrimitiveDraw::downScaleSpans | ( |  | ) | `[protected]`

| Downscales the span coordinates by 8.

XFCIMPORT void XFcPrimitiveDraw::fillSpan | ( | INT32 | aY | ) | `[protected]`

| Fills the span to a temporary scanline buffer using current XFcPrimitiveDrawFiller.

XFCIMPORT xfcPrimitiveBlitFunction XFcPrimitiveDraw::getBlitFunction | ( | INT32 | aBufferFormat | ) | `[protected]`

| Returns the blit function used for the buffer format.

XFCIMPORT void XFcPrimitiveDraw::initBitCounter | ( |  | ) | `[protected]`

| Init the bit counter that is used for calculating coverages from bit masks.

XFCIMPORT void XFcPrimitiveDraw::insertToAET | ( | XFcPrimitiveDrawEdge * | aEdge,
|  | XFcPrimitiveDrawEdge * | aAETEdge
| ) | `[protected]`

| Inserts edge to AET (active edge table).

XFCIMPORT void XFcPrimitiveDraw::insertToSpan | ( | XFcPrimitiveDrawEdge * | aEdge,
|  | INT32 | aMinX,
|  | INT32 | aMaxX,
|  | XFcPrimitiveDrawEdge * | aSpanEdge
| ) | `[protected]`

| Insets span to span table.

XFCIMPORT void XFcPrimitiveDraw::renderEvenOdd | ( | UINT8 * | aData,
|  | INT32 | aWidth,
|  | INT32 | aHeight,
|  | INT32 | aPitch,
|  | INT32 | aBufferFormat
| ) |

| Renders the edges to the surface without antialiasing using even-odd fillrule.

XFCIMPORT void XFcPrimitiveDraw::renderEvenOddAA | ( | UINT8 * | aData,
|  | INT32 | aWidth,
|  | INT32 | aHeight,
|  | INT32 | aPitch,
|  | INT32 | aBufferFormat
| ) |

| Renders the edges to the surface with antialiasing using even-odd fillrule.

XFCIMPORT void XFcPrimitiveDraw::renderNonZero | ( | UINT8 * | aData,
|  | INT32 | aWidth,
|  | INT32 | aHeight,
|  | INT32 | aPitch,
|  | INT32 | aBufferFormat
| ) |

| Renders the edges to the surface without antialiasing using non-zero fillrule.

XFCIMPORT void XFcPrimitiveDraw::renderNonZeroAA | ( | UINT8 * | aData,
|  | INT32 | aWidth,
|  | INT32 | aHeight,
|  | INT32 | aPitch,
|  | INT32 | aBufferFormat
| ) |

| Renders the edges to the surface with antialiasing using non-zero fillrule.

XFCIMPORT void XFcPrimitiveDraw::resetAET | ( |  | ) | `[protected]`

| Resets AET.

XFCIMPORT INT XFcPrimitiveDraw::resize | ( | INT32 | aWidth,
|  | INT32 | aHeight
| ) | `[protected]`

| Reallocates the tables for new size requirements of the primitivedraw.

XFCIMPORT void XFcPrimitiveDraw::scanlineToAET | ( | INT32 | aYPos | ) | `[protected]`

| Processes the scanline table at given Y position and add to AET.

XFCIMPORT void XFcPrimitiveDraw::scanlineToAETandSpanlist | ( | INT32 | aYPos,
|  | INT32 | aMinX,
|  | INT32 | aMaxX
| ) | `[protected]`

| Processes the scanline table at given Y position and add to AET and span list.

XFCIMPORT void XFcPrimitiveDraw::setClippingRect | ( | INT32 | aClipMinX,
|  | INT32 | aClipMinY,
|  | INT32 | aClipMaxX,
|  | INT32 | aClipMaxY
| ) |

| Sets the clipping rectangle for rendering. Note that for antialiased rendering, the clipping rectangle should be multiplied with 8. The clipping rectangle is inclusive, aClipMaxX and aClipMaxY are the last coordinates that are still inside the rect.

XFCIMPORT void XFcPrimitiveDraw::setColor | ( | UINT32 | aColor | ) |

| Sets the color for the rendering (doesn't contain alpha). The color is used in all render calls after this. This overrides the filler setting when called. The color is in X8R8G8B8 format

XFCIMPORT void XFcPrimitiveDraw::setFiller | ( | XFcPrimitiveDrawFiller * | aFiller | ) |

| Sets the filler for rendering. The filler is used in all render calls after this. This overrides the color setting when called. Filler can be also set to NULL, after which the current color is used.

XFCIMPORT void XFcPrimitiveDraw::setOpacity | ( | UINT8 | aOpacity | ) |

| Sets the opacity for the rendering. This is used as the opacity for both color and custom fillers.

XFCIMPORT void XFcPrimitiveDraw::sortAET | ( |  | ) | `[protected]`

| Sorts the AET with bubble sort. The algorithm sounds inefficient, but is suitable, as AET is mostly sorted already.

XFCIMPORT void XFcPrimitiveDraw::spansFromAET | ( | INT32 | aMinX,
|  | INT32 | aMaxX
| ) | `[protected]`

| Resets the span information in lines using AET.

## Member Data Documentation

XFcPrimitiveDrawEdge* XFcPrimitiveDraw::mAETBegin`[protected]`

| Pointer to the first edge in AET.

XFcPrimitiveDrawEdge* XFcPrimitiveDraw::mAETEnd`[protected]`

| Pointer to the last edge in AET.

UINT32 XFcPrimitiveDraw::mAlpha16`[protected]`

UINT32 XFcPrimitiveDraw::mAlpha32`[protected]`

UINT8* XFcPrimitiveDraw::mBitCounter`[protected]`

| Pointer to the bit counter table.

INT32 XFcPrimitiveDraw::mClipMaxX`[protected]`

INT32 XFcPrimitiveDraw::mClipMaxY`[protected]`

INT32 XFcPrimitiveDraw::mClipMinX`[protected]`

| Clipping rectangle boundaries.

INT32 XFcPrimitiveDraw::mClipMinY`[protected]`

UINT16 XFcPrimitiveDraw::mColor16`[protected]`

UINT32 XFcPrimitiveDraw::mColor32`[protected]`

| Stored color and alpha values.

UINT32 XFcPrimitiveDraw::mColorTable[33]`[protected]`

| Pre-computed color values in X6X5X5 format.

XFcPrimitiveDrawEdgeSet* XFcPrimitiveDraw::mEdgeSet`[protected]`

| Pointer to the edge set containing the primitives.

XFcPrimitiveDrawFiller* XFcPrimitiveDraw::mFiller`[protected]`

| Pointer to a filler that is used for more complex fills.

UINT32* XFcPrimitiveDraw::mFillerSpan`[protected]`

| Pointer to the temporary filler scanline.

INT32 XFcPrimitiveDraw::mHeight`[protected]`

| Height of the maximum rendering ares.

UINT8* XFcPrimitiveDraw::mHiResSpan`[protected]`

| Pointer to the high res scanline.

UINT8* XFcPrimitiveDraw::mLoResSpan`[protected]`

| Pointer to the low res scanline.

XFcPrimitiveDrawEdge** XFcPrimitiveDraw::mScanlineBegin`[protected]`

| Table of pointers to first edges of scanlines.

XFcPrimitiveDrawEdge** XFcPrimitiveDraw::mScanlineEnd`[protected]`

| Table of pointers to last edges of scanlines.

XFcPrimitiveDrawEdge* XFcPrimitiveDraw::mSpanBegin`[protected]`

| Pointer to the first edge of current span.

XFcPrimitiveDrawEdge* XFcPrimitiveDraw::mSpanEnd`[protected]`

| Pointer to the last edge of current span.

INT32 XFcPrimitiveDraw::mWidth`[protected]`

| Width of the maximum rendering area.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch