Class: TGrayBlendTransferMode

Declaration: GrayTransferModes.h

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.

Member Function: TGrayBlendTransferMode::TGrayBlendTransferMode

  1. TGrayBlendTransferMode (GIntensity blendWeight)
  2. TGrayBlendTransferMode ()
  3. TGrayBlendTransferMode (const TGrayBlendTransferMode &)

Interface Category:

API.

Purpose:

  1. Constructor used to set the blend weight value.
  2. Default constructor. Sets the blend weight to 1.0, which causes the resultant color to be based only on the source color.
  3. Copy constructor.

Calling Context:

  1. You call this function directly (the only way to set the blend weight to a value other than 1.0.
  2. Called by the stream-in operators. You can also call this constructor directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrayBlendTransferMode::~TGrayBlendTransferMode

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.

Member Function: TGrayBlendTransferMode::GetResultingColor

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrayBlendTransferMode::GetToBlendWeight

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.

Member Function: TGrayBlendTransferMode::GetBlendResult

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrayBlendTransferMode::operator=

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.

Member Function: TGrayBlendTransferMode::operator>>=

virtual TStream & operator >>=(TStream & towhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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.

Member Function: TGrayBlendTransferMode::operator<<=

virtual TStream & operator <<= (TStream & fromwhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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.

Member Function: TGrayBlendTransferMode::TemporaryTypeID

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.