Class: TRGBBlendTransferMode

Declaration: RGBTransferModes.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TTransferMode

Inherited By:

None.

Purpose:

TRGBBlendTransferMode is a concrete class, derived from TTransferMode, that interpolates between two colors using the RGB color space. (The source and destination colors need not be TRGBColors, and the resulting color is converted from RGB 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 RGB components as well as to the transparency.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TRGBBlendTransferMode::TRGBBlendTransferMode

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

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. Call this constructor directly.
  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: TRGBBlendTransferMode::~TRGBBlendTransferMode

virtual ~ TRGBBlendTransferMode ()

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: TRGBBlendTransferMode::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 in RGB color space and returns the blended 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 RGB 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: TRGBBlendTransferMode::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: TRGBBlendTransferMode::GetBlendResult

static void GetBlendResult (const TRGBColor & sourceColor, GIntensity blendWeight, const TRGBColor & destColor, TRGBColor & resultingColor)

Interface Category:

API.

Purpose:

Performs an interpolation between the source and destination colors in RGB color space and returns the blended 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 RGB color is returned in a TRGBColor 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: TRGBBlendTransferMode::operator=

TRGBBlendTransferMode & operator =(const TRGBBlendTransferMode & 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: TRGBBlendTransferMode::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: TRGBBlendTransferMode::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: TRGBBlendTransferMode::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 kRGBBlendTransferMode.

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.