Class: TIndexedImage

Declaration: GraphicImage.h


Class: TIndexedImage::TRGBColorArray

Declaration: GraphicImage.h

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

  1. TRGBColorArray (unsigned long noOfColors =256)
  2. TRGBColorArray (const TRGBColorArray & source)

Interface Category:

API.

Purpose:

  1. Creates a new color lookup table for use by TIndexedImage.
  2. Copy constructor.

Calling Context:

  1. Call to create a new color lookup table for use by TIndexedImage.
  2. 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: 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:

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:

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

  1. void SetColor (unsigned long i, const TRGBColor & p)
  2. void SetColor (unsigned long i, const TColorTable :: CompactRGBColor & p)

Interface Category:

API.

Purpose:

  1. Sets the color at the specified location in the lookup table to the specified color.
  2. Sets the color at the specified location in the lookup table to the specified color.

Calling Context:

  1. Call to set the color at a specific location in the color lookup table.
  2. Call to set the color at a specific location in the color lookup table.

Parameters:

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:

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:

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:

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.

Class: TIndexedImage

Declaration: GraphicImage.h

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.

Member Function: TIndexedImage::TIndexedImage

  1. TIndexedImage ()
  2. TIndexedImage (const TImage &, const TRGBColorArray & colorTable =TRGBColorArray :: GetDefaultColors ())
  3. TIndexedImage (const TIndexedImage &)
  4. 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 ))
  5. 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:

  1. Default constructor.
  2. Creates a TIndexedImage from another type of image.
  3. Copy constructor.
  4. Creates a TIndexedImage initialized with the given parameters.
  5. Creates a TIndexedImage initialized with the given parameters.

Calling Context:

  1. Called by the stream-in operators.
  2. Call to create a TIndexedImage from another type of image.
  3. Called to copy an object.
  4. Call to create a new TIndexedImage.
  5. Call to create a new TIndexedImage.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TIndexedImage::~TIndexedImage

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.

Member Function: TIndexedImage::IsEqual

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:

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:

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:

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.