Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TTransferMode
Inherited By:
None.
Purpose:
TGrayBlendTransferMode is a concrete class, derived from TTransferMode, that interpolates between two colors using a grayscale. (The source and destination colors need not be grayscale, but the resulting color is always a gray.) 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 both the gray value and the transparency.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TGrayBlendTransferMode (GIntensity blendWeight)
- TGrayBlendTransferMode ()
- TGrayBlendTransferMode (const TGrayBlendTransferMode &)
Interface Category:
API.
Purpose:
- Constructor used to set the blend weight value.
- Default constructor. Sets the blend weight to 1.0, which causes the resultant color to be based only on the source color.
- Copy constructor.
Calling Context:
- You call this function directly (the only way to set the blend weight to a value other than 1.0.
- Called by the stream-in operators. You can also call this constructor directly.
- Called to copy an object.
Parameters:
- GIntensity blendWeight -The value of the blend weight (0.0 -1.0). A value of 0.5 will give equal weighting to both the source and destination colors.
- Takes no parameters.
- const TGrayBlendTransferMode & -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TGrayBlendTransferMode ()
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.
virtual void GetResultingColor (const TColor & sourceColor, const TColor & destColor, TColor & resultingColor) const
Interface Category:
API.
Purpose:
Performs an interpolation between the source and destination colors and returns a grayscale color (both the color and transparency values are interpolated). A weighting factor (0.0 -1.0) is set in the constructor. When the weighting factor is set to 0.5, the resulting color is determined by equal parts of the source and destination. The resulting grayscale color is returned in a TColor object.
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 grayscale color.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
GIntensity GetToBlendWeight () const
Interface Category:
API.
Purpose:
Returns the blend weight factor (0.0 -1.0) as a GIntensity object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a GIntensity object representing the blend weight given to the source and destination colors (0.0 -1.0).
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
static void GetBlendResult (const TGrayColor & sourceColor, GIntensity blendWeight, const TGrayColor & destColor, TGrayColor & resultingColor)
Interface Category:
API.
Purpose:
Performs an interpolation between the source and destination colors and returns a grayscale color based on the blend weighting factor, blendWeight. Both the color and transparency values are interpolated. When the weighting factor is set to 0.5, the resulting color is determined by equal parts of the source and destination. The resulting grayscale color is returned in a TGrayColor object.
Calling Context:
Call this function directly in order to override the blend weight value that was set in the constructor.
Parameters:
- const TGrayColor & sourceColor -The source color to blend.
- GIntensity blendWeight -The blend weight used.
- const TGrayColor & destColor -The destination color to blend.
- TGrayColor & resultingColor -The resulting, blended grayscale color.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TGrayBlendTransferMode & operator =(const TGrayBlendTransferMode & 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 kGrayBlendTransferMode.
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.