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.
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:
- GDevCoordinate y -The y-coordinate position.
- GDevCoordinate x1 -The x1-coordinate position.
- GDevCoordinate x2 -The x2-coordinate position.
- GScanlineSpan * * curstack -A pointer to the current stack pointer.
- GScanlineSpan * stackstart -A pointer to the starting or bottom location in the current stack.
- GScanlineSpan * stacktop -A pointer to the end or top location in the current stack.
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:
- GScanlineSpan * * curstack -A pointer to the current stack pointer.
- GScanlineSpan * stackstart -A pointer to the starting or bottom location in the current stack.
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:
- long count -The count of the spans.
- GScanlineSpan * spans -A pointer to the spans to be filled.
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:
- GDevCoordinate y -The y-coordinate.
- GDevCoordinate x1 -The x1-coordinate.
- GDevCoordinate x2 -The x2-coordinate.
- unsigned long count -The number of rectilinear areas.
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:
- GDevCoordinate y -The y-coordinate.
- GDevCoordinate x1 -The x1-coordinate.
- GDevCoordinate x2 -The x2-coordinate.
- unsigned char * matte -A pointer to the matte character value.
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:
- GDevCoordinate x -The x-coordinate.
- GDevCoordinate y -The y-coordinate.
- TColor & color -The color for the paint image.
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:
- const TColor & color -The color for the abutting edge.
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:
- GDevCoordinate x -The x-coordinate.
- GDevCoordinate y -The y-coordinate.
- unsigned char blendWeight -The composite color that is determined from the respective colors of the two painters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
- TSpanPainter ()
- TSpanPainter (const TSpanPainter & source)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and derived classes.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TSpanPainter & source -The object to be copied.
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.