Class: TGModifiableImage

Declaration: Image.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TGImage

Inherited By:

TPixelBuffer

Purpose:

TGModifiableImage derives from TGImage and is a geometry class representing a device-independent, pixel-based, editable image. Classes derived from TGModifiableImage support various image storage formats such as continuous tone monochrome or color images, and transparent RGB images.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

Classes derived from TGModifiableImage must override the pure virtual functions Resize, SetPixel, GetModifiableChannelAddress, CopyPixelBlock, and CopyOverlappingPixelBlock.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGModifiableImage::~TGModifiableImage

virtual ~ TGModifiableImage ()

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: TGModifiableImage::SetPixel

virtual void SetPixel (long xLocation, long yLocation, const TColor & color)

Interface Category:

API.

Purpose:

Sets the color value for the pixel at the specified location.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TGModifiableImage.

Member Function: TGModifiableImage::GetModifiableChannelAddress

virtual void * GetModifiableChannelAddress (unsigned long channelNumber)

Interface Category:

API.

Purpose:

Gets the memory address of the specified channel. The memory is editable by the caller. This function returns NIL if the specified channel isn't valid.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the address at the beginning of the channel.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TGModifiableImage.

Member Function: TGModifiableImage::CanBlockMovePixels

virtual bool CanBlockMovePixels (const TGImage & srcpixels, const TAttributeState & attributes) const

Interface Category:

API.

Purpose:

Determines whether a CopyPixelBlock or CopyOverlappingPixelBlock function can be used to move the pixel memory.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if a CopyPixelBlock or CopyOverlappingPixelBlock function can be used to move the pixel memory.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGModifiableImage::CopyPixelBlock

virtual void CopyPixelBlock (const TGImage & srcPixels, long sourceOriginX, long sourceOriginY, const TLongRect & dstBounds)

Interface Category:

API.

Purpose:

Copies the specified source pixels to the specified location within this image. Specify the point within the given block of source pixels to begin copying. Also, specify the point in the current image to place the copied pixels, along with the height and width of the block to be copied. This function assumes that the clip rectangles are preclipped.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TGModifiableImage.

Member Function: TGModifiableImage::CopyOverlappingPixelBlock

virtual void CopyOverlappingPixelBlock (long sourceOriginX, long sourceOriginY, const TLongRect & dstBounds)

Interface Category:

API.

Purpose:

Copies the specified source pixels to the specified location within this image. This function differs from CopyPixelBlock in that it allows the copy to overlap the original pixel buffer.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TGModifiableImage.

Member Function: TGModifiableImage::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: TGModifiableImage::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: TGModifiableImage::TGModifiableImage

  1. TGModifiableImage ()
  2. TGModifiableImage (const TLongRect & bounds, TGPoint dpi =TGImage :: k72DPI, EOrientation orientation =kIdentity)
  3. TGModifiableImage (const TGModifiableImage &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a TGModifiableImage initialized with the specified parameters.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Call this function 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:

TGModifiableImage is an abstract base class--all the constructors are protected. Do not instantiate this class.

Member Function: TGModifiableImage::operator=

const TGModifiableImage & operator =(const TGModifiableImage & 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:

The operator =is a protected member function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.