Class: THLSBlendTransferMode

Declaration: HLSTransferModes.h

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.

Member Function: THLSBlendTransferMode::THLSBlendTransferMode

  1. THLSBlendTransferMode (GIntensity blendWeight, EHueDirection direction =kClockwise)
  2. THLSBlendTransferMode ()
  3. THLSBlendTransferMode (const THLSBlendTransferMode &)

Interface Category:

API.

Purpose:

  1. Constructor used to set the blend weight and hue direction parameters.
  2. Default constructor. Sets the blend weight to 0.5 and the hue direction to kClockwise by default.
  3. Copy constructor.

Calling Context:

  1. Call this function 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: THLSBlendTransferMode::~THLSBlendTransferMode

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.

Member Function: THLSBlendTransferMode::GetHueDirection

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.

Member Function: THLSBlendTransferMode::GetBlendWeight

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.

Member Function: THLSBlendTransferMode::GetResultingColor

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THLSBlendTransferMode::GetBlendResult

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: THLSBlendTransferMode::operator=

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.

Member Function: THLSBlendTransferMode::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: THLSBlendTransferMode::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: THLSBlendTransferMode::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 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.