Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TModifiableImage
Inherited By:
None.
Purpose:
TRGBColorArray is a class embedded within TIndexedImage that describes the color lookup table. Each element of the array is a color represented with either 1, 2, 4, or 8 bits.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Member Function: TRGBColorArray::TRGBColorArray
- TRGBColorArray (unsigned long noOfColors =256)
- TRGBColorArray (const TRGBColorArray & source)
Interface Category:
API.
Purpose:
- Creates a new color lookup table for use by TIndexedImage.
- Copy constructor.
Calling Context:
- Call to create a new color lookup table for use by TIndexedImage.
- Called to copy an object.
Parameters:
- unsigned long noOfColors =256 -The depth of the image.
- const TRGBColorArray & source -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: TRGBColorArray::~TRGBColorArray
~ TRGBColorArray ()
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: TRGBColorArray::GetColor
TRGBColor GetColor (unsigned long i) const
Interface Category:
API.
Purpose:
Retrieves the color from the specified location in the lookup table.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index of the location in the lookup table from which to retrieve the color value.
Return Value:
Returns the color at the specified location in the lookup table.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRGBColorArray::GetCompactRGBColor
TColorTable :: CompactRGBColor GetCompactRGBColor (unsigned long i) const
Interface Category:
API.
Purpose:
Returns the RGB color value for the specified index.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index specifying which color position to poll.
Return Value:
The compact RGB color value. This is a structure containing all three color components.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRGBColorArray::SetColor
- void SetColor (unsigned long i, const TRGBColor & p)
- void SetColor (unsigned long i, const TColorTable :: CompactRGBColor & p)
Interface Category:
API.
Purpose:
- Sets the color at the specified location in the lookup table to the specified color.
- Sets the color at the specified location in the lookup table to the specified color.
Calling Context:
- Call to set the color at a specific location in the color lookup table.
- Call to set the color at a specific location in the color lookup table.
Parameters:
- unsigned long i -The index of the location in the lookup table to set a new color.
- const TRGBColor & p -The color to set at the specified location.
- unsigned long i -The index of the location in the lookup table to set a new color.
- const TColorTable :: CompactRGBColor & p -The color to set at the specified location, in compact color form.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRGBColorArray::GetColorLevels
unsigned long GetColorLevels () const
Interface Category:
API.
Purpose:
Returns the image depth, indicating how many colors are held within the color table.
Calling Context:
Call to determine the image depth of the image.
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:
None.
Member Function: TRGBColorArray::GetDefaultColors
static const TRGBColorArray & GetDefaultColors ()
Interface Category:
API.
Purpose:
This returns the default color table.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The color array for the default color table.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TRGBColorArray::operator>>=
TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -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:
None.
Member Function: TRGBColorArray::operator<<=
TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream from which the object streams 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:
None.
Member Function: TRGBColorArray::operator=
TRGBColorArray & operator =(const TRGBColorArray & Src)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TRGBColorArray & Src -The object to be copied.
Return Value:
Returns a const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TModifiableImage
Inherited By:
None.
Purpose:
TIndexedImage is a concrete 2-bit, 4-bit, or 8-bit image with a color lookup table. Embedded in TIndexedImage is TRGBColorArray that describes the color lookup table. Colors are stored in the TRGBColorArray using either 2, 4, or 8 bits. Each pixel of the image is specified with a single component that is an index into the TRGBColorTable. To derive an XYZcolor from this index, call TRGBColorTable::GetColor with the index and a reference to a TXYZColor. The TColorProfile of the TRGBColorTable is identical to the one referenced by the Image. To map a TColor into the appropriate index, call TColor::FindIndex, passing in the colorlist.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TIndexedImage ()
- TIndexedImage (const TImage &, const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors ())
- TIndexedImage (const TIndexedImage &)
- TIndexedImage (const TGPoint & dstOrigin, long widthInPixels, long heightInPixels, const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors (), TGPoint dpi =TGImage :: k72DPI, TGrafBundle * adoptBundle =NIL, TGImage :: EOrientation orientation =TGImage :: kIdentity, const TColorProfile & theProfile =* TColorProfile :: GetDefaultColorProfile (), const TGPoint & sourceOrigin =TGPoint ( 0, 0 ))
- TIndexedImage (const TGPoint & dstOrigin, const TGPoint & imageSizeInWorldSpace, const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors (), TGPoint dpi =TGImage :: k72DPI, TGrafBundle * adoptBundle =NIL, TGImage :: EOrientation orientation =TGImage :: kIdentity, const TColorProfile & theProfile =* TColorProfile :: GetDefaultColorProfile (), const TGPoint & sourceOrigin =TGPoint ( 0, 0 ))
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a TIndexedImage from another type of image.
- Copy constructor.
- Creates a TIndexedImage initialized with the given parameters.
- Creates a TIndexedImage initialized with the given parameters.
Calling Context:
- Called by the stream-in operators.
- Call to create a TIndexedImage from another type of image.
- Called to copy an object.
- Call to create a new TIndexedImage.
- Call to create a new TIndexedImage.
Parameters:
- Takes no parameters.
- const TImage & -The image from which to construct the TIndexedImage.
- const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors () -The color lookup table for the image.
- const TIndexedImage & -The image to be copied.
- const TGPoint & dstOrigin -The origin of the image in world space.
- long widthInPixels -The width of the image measured in pixels.
- long heightInPixels -The height of the image measured in pixels.
- const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors () -The color lookup table for the image.
- TGPoint dpi =TGImage :: k72DPI -The vertical and horizontal resolution of the image. The default value for both axes is 72 dpi.
- TGrafBundle * adoptBundle =NIL -The initial attribute bundle for the image. The default value is NIL.
- TGImage :: EOrientation orientation =TGImage :: kIdentity -The initial orientation for the image. The default value is kIdentity; the orientation of the image as stored in memory.
- const TColorProfile & theProfile =* TColorProfile :: GetDefaultColorProfile () -The color profile for the image.
- const TGPoint & sourceOrigin =TGPoint ( 0 , 0 ) -The offscreen origin for the image.
- const TGPoint & dstOrigin -The origin of the image in world space.
- const TGPoint & imageSizeInWorldSpace -The height and width of the image in world space.
- const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors () -The color lookup table for the image.
- TGPoint dpi =TGImage :: k72DPI -The vertical and horizontal resolution of the image. The default value for both axes is 72 dpi.
- TGrafBundle * adoptBundle =NIL -The initial attribute bundle for the image. The default value is NIL.
- TGImage :: EOrientation orientation =TGImage :: kIdentity -The initial orientation for the image. The default value is kIdentity; the orientation of the image as stored in memory.
- const TColorProfile & theProfile =* TColorProfile :: GetDefaultColorProfile () -The color profile for the image.
- const TGPoint & sourceOrigin =TGPoint ( 0 , 0 ) -The offscreen origin for the image.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TIndexedImage ()
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: TIndexedImage::GetColorLevels
unsigned long GetColorLevels () const
Interface Category:
API.
Purpose:
Returns the image depth, by returning the number of colors held in the image's color table.
Calling Context:
Call to determine the image depth of the image.
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:
None.
Member Function: TIndexedImage::operator=
TIndexedImage & operator =(const TIndexedImage & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
Returns a const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool IsEqual (const MCollectible *) const
Interface Category:
API.
Purpose:
Determines whether this TIndexedImage and the specified MCollectible are both images and are the same image.
Calling Context:
Call this function directly.
Parameters:
- const MCollectible * -The object to be compared with the image.
Return Value:
Returns true if both the images are equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TIndexedImage::operator>>=
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -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:
None.
Member Function: TIndexedImage::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream from which the object streams 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:
None.
Member Function: TIndexedImage::CreateGrafDevice
virtual TGrafDevice * CreateGrafDevice ()
Interface Category:
API.
Purpose:
Creates a new rendering pipeline device for an image object.
Calling Context:
Called when no graphics device has been defined for the object.
Parameters:
Return Value:
Returns a pointer to a new graphics device.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TIndexedImage::GetSourceOrigin
virtual TGPoint GetSourceOrigin () const
Interface Category:
API.
Purpose:
Returns the defined origin for the source image of a given object.
Calling Context:
Called when the user needs to determine the origin of the source image.
Parameters:
Return Value:
Returns the coordinate which corresponds to the location of the origin of the source image (in pixel space).
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.