Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
TImageTextureMap
Purpose:
TImageMap is an abstract base class for image maps. An image map is used to apply an image to the surface of a 3-D object, much like applying wallpaper to a wall. The map stores a set of colors, usually defined by the pixels of an image. TImageMap::GetValue is the interface to the map; this member function returns the color for the specified TShadingSample object. Within GetValue, a derived class typically uses the TShadingSample's texture coordinates (stored in TShadingSample::fTextureCoordinate) as an index specifying the location in a 2-D array of pixels; but the derived class could implement the map in a more abstract way.
When a renderer invokes TImageMapShader::ComputeShade, the shader in turn invokes TImageMap::GetValue. The value returned is typically used as the base color for the current surface point, replacing whatever color was set in the graphic's bundle. (This color can then be altered by further shading.) However, it is entirely up to the shader to determine how it uses the value gotten from the map. For example, rather than simply replacing the existing color, the value can be used as a multiplier, or even as an index to another color map.
Instantiation:
Abstract class; do not allocate.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TImageMap ()
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: TImageMap::GetValue
virtual void GetValue (const TShadingSample & info, TColor & returnColor) const
Interface Category:
API.
Purpose:
Returns, in its TColor argument, the color that has been mapped to the specified TShadingSample. This is a pure virtual function that must be overridden by derived classes.
Calling Context:
Do not call this function directly.
Parameters:
- const TShadingSample & info -The information about the surface point needed by the shader.
- TColor & returnColor -The resulting color from the image map is returned here.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TImageMap::operator>>=
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream that the object streams itself out to.
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: TImageMap::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream that the object streams itself in from.
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.
- TImageMap ()
- TImageMap (const TImageMap &)
Interface Category:
API.
Purpose:
- Default constructor. This is a protected constructor that must be overridden by derived classes.
- Copy constructor. This is a protected constructor that must be overridden by derived classes.
Calling Context:
- Called by the stream-in operators. Do not call this function directly.
- Called to copy an object. Do not call this function directly, except from within a derived class' copy constructor.
Parameters:
- Takes no parameters.
- const TImageMap & -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TImageMap::operator=
TImageMap & operator =(const TImageMap & source)
Interface Category:
API.
Purpose:
Assignment operator. This is a protected member function that must be overridden by a derived class.
Calling Context:
Do not call this function directly, except from within the operator =function of a derived class.
Parameters:
- const TImageMap & source -The object to be copied.
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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.