Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TTransferMode
Inherited By:
None.
Purpose:
THLSBlendTransferMode is a concrete class, derived from TTransferMode, that interpolates between two colors using the HLS (hue-lightness-saturation) color space. (The source and destination need not be THLSColors, and the resulting color is converted from HLS to the specified color space.)
A weighting factor determines the contribution of the source color to the mix. If the weight is 1.0, the resultant color is determined only by the source. Similarly, if the weight is 0.0, only the destination is used. Other weights perform a linear interpolation, so a weight of 0.5 mixes both colors equally. The interpolation applies to each of the HLS components as well as to the transparency. The direction of the interpolation of the hue component is controlled by the current hue direction setting, which can be clockwise or counterclockwise. The direction can be specified by a constructor argument; it defaults to clockwise.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- THLSBlendTransferMode (GIntensity blendWeight, EHueDirection direction =kClockwise)
- THLSBlendTransferMode ()
- THLSBlendTransferMode (const THLSBlendTransferMode &)
Interface Category:
API.
Purpose:
- Constructor used to set the blend weight and hue direction parameters.
- Default constructor. Sets the blend weight to 0.5 and the hue direction to kClockwise by default.
- Copy constructor.
Calling Context:
- Call this function directly.
- Called by the stream-in operators. You can also call this constructor directly.
- Called to copy an object.
Parameters:
- GIntensity blendWeight -The percentage of the source color to use in the blend. A value of 1.0 means all source; 0.0 means all destination; 0.5 means a 50/50 split between source and destination.
- EHueDirection direction =kClockwise -The direction of the hue interpolation algorithm: clockwise (default) or counterclockwise.
- Takes no parameters.
- const THLSBlendTransferMode & -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ THLSBlendTransferMode ()
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:
Not multithread safe.
Other Considerations:
None.
EHueDirection GetHueDirection () const
Interface Category:
API.
Purpose:
Returns the direction of hue interpolation: clockwise or counterclockwise.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns an EHueDirection with the current hue interpolation direction (kClockwise or kCounterClockwise).
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
GIntensity GetBlendWeight () const
Interface Category:
API.
Purpose:
Returns the relative percentage of the source color to use in the blend. A value of 1.0 means all 100% source. A value of 0.0 means 100% destination. A value of 0.5 means 50% source and 50% destination (equal blending).
Calling Context:
Call this function directly.
Parameters:
Return Value:
A GIntensity object with a value between 0.0 and 1.0.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void GetResultingColor (const TColor & sourceColor, const TColor & destColor, TColor & resultingColor) const
Interface Category:
API.
Purpose:
Transforms the destination TColor to a color that has each of its components defined as a blend of the source and destination color components. All of the arguments are passed as TColors.
Calling Context:
Call this function directly.
Parameters:
- const TColor & sourceColor -The source color to blend.
- const TColor & destColor -The destination color to blend.
- TColor & resultingColor -The resulting blended color.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
void GetBlendResult (const THLSColor & sourceColor, const THLSColor & destColor, THLSColor & resultingColor) const
Interface Category:
API.
Purpose:
Transforms the destination THLSColor to a color that has each of its components defined as a blend of the source and destination color components. All of the arguments are passed as THLSColors.
Calling Context:
Call this function directly.
Parameters:
- const THLSColor & sourceColor -The source color to blend.
- const THLSColor & destColor -The destination color to blend.
- THLSColor & resultingColor -The resulting blended color.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
THLSBlendTransferMode & operator =(const THLSBlendTransferMode & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function by using the operator in an assignment statement.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream & towhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & towhere -The stream that the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -The stream that the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ETransferModeClassID TemporaryTypeID () const
Interface Category:
API.
Purpose:
Returns the type of transfer mode this class represents.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns an ETransferModeClassID with value kHLSBlendTransferMode.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not 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.