Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TTransferMode
Inherited By:
None.
Purpose:
THSVBlendTransferMode is a concrete class, derived from TTransferMode, that interpolates between two colors using the HSV (hue-saturation-value) color space. (The source and destination need not be THSVColors, and the resulting color is converted from HSV 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 HSV 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 may 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.
- THSVBlendTransferMode (GIntensity blendWeight, EHueDirection direction =kClockwise)
- THSVBlendTransferMode ()
- THSVBlendTransferMode (const THSVBlendTransferMode &)
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 THSVBlendTransferMode & -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ THSVBlendTransferMode ()
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 THSVColor & sourceColor, const THSVColor & destColor, THSVColor & resultingColor) const
Interface Category:
API.
Purpose:
Transforms the destination THSVColor 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 THSVColors.
Calling Context:
Call this function directly.
Parameters:
- const THSVColor & sourceColor -The source color to blend.
- const THSVColor & destColor -The destination color to blend.
- THSVColor & resultingColor -The resulting blended color.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
THSVBlendTransferMode & operator =(const THSVBlendTransferMode & 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 kHSVBlendTransferMode.
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.