Class: TRGBHighlightTransferMode

Declaration: RGBTransferModes.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TTransferMode

Inherited By:

None.

Purpose:

TRGBHighlightTransferMode is a concrete class, derived from TTransferMode, that generates a color based on a source color, a destination color, and a reference background color. This transfer mode can be used to implement highlighting an area onscreen by giving it a contrasting color. If the destination color is the same as the background color, the result is the same color as the source; otherwise, if the destination and source colors are the same, the result is the same color as the background; otherwise, it is the same color as the destination. The comparison of the source to the background color is made in the RGB color space, and the two colors' alpha (transparency) values must also match. (The source and destination colors need not be TRGBColors, and the resulting color is converted from RGB to the specified color space.) This transfer mode is different from most of the other RGB transfer modes, in that the transfer mode itself stores a TRGBColor (the background color). The color is specified as an argument to a constructor, and can be retrieved with TRGBHighlightTransferMode::GetBackgroundColor.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TRGBHighlightTransferMode::TRGBHighlightTransferMode

  1. TRGBHighlightTransferMode ()
  2. TRGBHighlightTransferMode (const TRGBColor & theColor)
  3. TRGBHighlightTransferMode (const TRGBHighlightTransferMode &)

Interface Category:

API.

Purpose:

  1. Default constructor. The background color is undefined.
  2. Constructor used to set the background color.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. You can also call this constructor directly.
  2. 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: TRGBHighlightTransferMode::~TRGBHighlightTransferMode

virtual ~ TRGBHighlightTransferMode ()

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: TRGBHighlightTransferMode::GetBackgroundColor

TRGBColor GetBackgroundColor () const

Interface Category:

API.

Purpose:

Returns the internally stored background color as a TRGBColor.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TRGBColor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRGBHighlightTransferMode::GetResultingColor

virtual void GetResultingColor (const TColor & sourceColor, const TColor & destColor, TColor & resultingColor) const

Interface Category:

API.

Purpose:

Replaces the source color with the destination color except when the destination color is the same as the background color, or when the source and destination colors are the same. If the destination color is the same as the background color, the source color is unchanged. If the source color is the same as the destination color, the source color is changed to the background color. All parameters are passed as TColor objects.

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: TRGBHighlightTransferMode::GetHighlightResult

void GetHighlightResult (const TRGBColor & sourceColor, const TRGBColor & destColor, TRGBColor & resultingColor) const

Interface Category:

API.

Purpose:

Replaces the source color with the destination color except when the destination color is the same as the background color, or when the source and destination colors are the same. If the destination color is the same as the background color, the source color is unchanged. If the source color is the same as the destination color, the source color is changed to the background color. All parameters are passed as TRGBColor objects.

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: TRGBHighlightTransferMode::operator=

TRGBHighlightTransferMode & operator =(const TRGBHighlightTransferMode & 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: TRGBHighlightTransferMode::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: TRGBHighlightTransferMode::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: TRGBHighlightTransferMode::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 kRGBHilightTransferMode.

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.