Class: TSpanPainter

Declaration: SpanPainter.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TPainter

Inherited By:

None.

Purpose:

TSpanPainter derives from TPainter and is used for filling in graphic images. In particular, this class is used when handling more than one painter for a frame buffer. It handles the color and shaping problems that can occur when two or more painters are filling in shapes and overlap.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSpanPainter::~TSpanPainter

virtual ~ TSpanPainter ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::PaintBufferedSpan

void PaintBufferedSpan (GDevCoordinate y, GDevCoordinate x1, GDevCoordinate x2, GScanlineSpan * * curstack, GScanlineSpan * stackstart, GScanlineSpan * stacktop)

Interface Category:

API.

Purpose:

Buffers a span in a local stack. This is called by a client to reduce member function invocation overhead.

Calling Context:

Call this function directly while scan converting is in process.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::FlushBufferedSpans

void FlushBufferedSpans (GScanlineSpan * * curstack, GScanlineSpan * stackstart)

Interface Category:

API.

Purpose:

Flushes any remaining spans to the frame buffer.

Calling Context:

Call this function directly when you have finished scan converting..

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::PaintSpans

virtual void PaintSpans (long count, GScanlineSpan * spans)

Interface Category:

API.

Purpose:

Fills each span with the paint graphics image. This function iterates over the count of the spans, filling each span with the graphics.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::PaintBlock

virtual void PaintBlock (GDevCoordinate y, GDevCoordinate x1, GDevCoordinate x2, unsigned long count)

Interface Category:

API.

Purpose:

Fills a rectilinear area with the paint graphics image.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::CompositeSpan

virtual void CompositeSpan (GDevCoordinate y, GDevCoordinate x1, GDevCoordinate x2, unsigned char * matte)

Interface Category:

API.

Purpose:

Composites the current paint image with a value from the matte image. This function is used for compositing transparent areas or edges with pixel-subpixel positioning.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::IsShadingConstant

virtual bool IsShadingConstant ()

Interface Category:

API.

Purpose:

Returns a Boolean that indicates whether shading is constant throughout the shape. This function is called when filling and framing a shape with two painters, if their edges abut at a subpixel level. The renderer needs to know the desired color for the first painter and needs to set the color properly for the second painter for any edges that abut. The renderer can call this function for the first painter. If it returns true, then the functions GetDesiredColorAt and SetAbuttingEdgeColor need only be called once.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the shading is constant for the painter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::GetDesiredColorAt

virtual void GetDesiredColorAt (GDevCoordinate x, GDevCoordinate y, TColor & color)

Interface Category:

API.

Purpose:

Gets the color that the painter image requires through the specified x- and y-coordinates.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::SetAbuttingEdgeColor

virtual void SetAbuttingEdgeColor (const TColor & color)

Interface Category:

API.

Purpose:

Determines the appropriate color for rendering for those pixels that are the composite of the edges of two painters; that is, where two painters meet.

Calling Context:

This function is called by the scan converter for the second painter after GetDesiredColorAt determines the color for the first painter.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::PaintAbuttingEdgePixel

virtual void PaintAbuttingEdgePixel (GDevCoordinate x, GDevCoordinate y, unsigned char blendWeight)

Interface Category:

API.

Purpose:

Sets the color for a pixel that is a composite of two painters, such as two painters whose edges abut.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::TSpanPainter

  1. TSpanPainter ()
  2. TSpanPainter (const TSpanPainter & source)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and derived classes.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSpanPainter::operator=

const TSpanPainter & operator =(const TSpanPainter & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.