Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
None.
Purpose:
TColorTable is an abstract base class for implementing color lookup tables for the various pixel buffers requiring a color lookup table. Color lookup tables contain a finite number of colors which are accessed by an index into the table. Two pixel buffers which make use of color lookup tables that are provided include TClut2PixelBuffer and TGray4PixelBuffer.
TColorTable has a TColorTableSearcher that can iterate through the table. You can use the table searcher to find specific colors or to find the closest match to a specific color.
TColorTable has several dither matrices that contain information for approximating colors not present in the color table via a spatial mixture of existing colors.
This class' interface will change in future releases.
Instantiation:
Abstract base class; do not allocate.
Deriving Classes:
Provided classes include TGrayColorTable and TRGBColorTable. Derived classes should override GetSize, SetSize, GetRGBColor, GetGrayColor, IsAGrayscaleRamp, IsArbitrary, IsFixed, AdoptColorSearcher, all the FindClosestMatch functions, GetColorTableSearcher, and all the GetOrderedDitherMatrix functions.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TColorTable ()
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:
This class' interface will change in future releases.
Member Function: TColorTable::GetSize
virtual long GetSize () const
Interface Category:
API.
Purpose:
Returns the number of colors contained within the table.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the number of colors in the color table.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::GetRGBColor
virtual void GetRGBColor (CompactRGBColor & color, short whichcolor) const
Interface Category:
API.
Purpose:
Returns the RGB color at the specified index in the color table.
Calling Context:
Call this function directly.
Parameters:
- CompactRGBColor & color -The color whose index is whichcolor.
- short whichcolor -The position in the color table to read.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::GetGrayColor
virtual GrayColor GetGrayColor (short whichcolor) const
Interface Category:
API.
Purpose:
Converts the RGB color at the specified index in the color table to gray and returns it.
Calling Context:
Call this function directly.
Parameters:
- short whichcolor -The position in the color table to return.
Return Value:
Returns a gray scale value for the color at location whichcolor.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::FindClosestMatchToRGBColor
- virtual unsigned short FindClosestMatchToRGBColor (const CompactRGBColor & color)
- virtual unsigned short FindClosestMatchToRGBColor (const TRGBColor & color)
Interface Category:
API.
Purpose:
- Searches the color table for the color that most closely matches the specified TRGBColor and returns it.
- Searches the color table for the color that most closely matches the specified CompactRGBColor and returns it.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- const TRGBColor & color -The color to search for.
- const CompactRGBColor & color -The color to search for.
Return Value:
Returns an unsigned short that contains the index of the closest matching color.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::FindClosestMatchToGrayColor
- virtual unsigned short FindClosestMatchToGrayColor (GrayColor agray)
- virtual unsigned short FindClosestMatchToGrayColor (const TGrayColor & color)
Interface Category:
API.
Purpose:
- Searches the color table for the color that most closely matches the specified TGrayColor and returns it.
- Searches the color table for the color that most closely matches the specified GrayColor and returns it.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- const TGrayColor & color -The color to search for.
- GrayColor agray -The color to search for.
Return Value:
Returns an unsigned short that contains the index of the closest matching color.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::FindClosestMatchToColor
virtual unsigned short FindClosestMatchToColor (const TColor & color)
Interface Category:
API.
Purpose:
Searches the color table for the color that most closely matches the specified TColor and returns it.
Calling Context:
Call this function directly.
Parameters:
- const TColor & color -The color to search for.
Return Value:
Returns an unsigned short that contains the index of the closest matching color.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::GetUnreachableSeed
static unsigned long GetUnreachableSeed ()
Interface Category:
API.
Purpose:
Returns a number of an invalid seed that does not match any color table.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a number of an invalid seed that does not match any color table.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::GetSeed
unsigned long GetSeed () const
Interface Category:
API.
Purpose:
Returns the unique number identifying this color table.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the unique number identifying this color table.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::operator=
const TColorTable & operator =(const TColorTable & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
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:
This class' interface will change in future releases.
Member Function: TColorTable::operator==
bool operator ==(const TColorTable & source) const
Interface Category:
API.
Purpose:
Tests whether this TColorTable differs from the argument.
Calling Context:
Call this function directly.
Parameters:
- const TColorTable & source -The object which is tested against this object.
Return Value:
Returns true if the objects are equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::operator>>=
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & towhere -The stream to which the object streams itself out.
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:
This class' interface will change in future releases.
Member Function: TColorTable::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -The stream from which the object stream itself in.
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:
This class' interface will change in future releases.
- TColorTable ()
- TColorTable (const TColorTable & src)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators .
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TColorTable & src -The object to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::UpdateSeed
void UpdateSeed ()
Interface Category:
API.
Purpose:
Bumps the unique number identifying this color table. Used when the color table's attributes change.
Calling Context:
Used internally when internal attributes change.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Member Function: TColorTable::GetClosestColorInTable
virtual void GetClosestColorInTable (const TColor & wantedColor, TColor & colorYouGot)
Interface Category:
API.
Purpose:
Searches the color table for the color that most closely matches the specified TColor and returns it.
Calling Context:
Call this function directly.
Parameters:
- const TColor & wantedColor -The color to search for.
- TColor & colorYouGot -The color in the colortable that is the closest match .
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This class' interface will change in future releases.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.