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.
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.
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:
- long xLocation -The x-coordinate of the pixel location.
- long yLocation -The y-coordinate of the pixel location.
- TColor & color -The new color for the pixel at the specified location.
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:
- unsigned long channelNumber -The channel number for which the address is requested.
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:
- const TGImage & srcpixels -The source pixels to be block copied.
- const TAttributeState & attributes -The attribute bundle for the source pixels.
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.
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:
- const TGImage & srcPixels -The source pixels to be block copied.
- long sourceOriginX -The X location within the source data to begin copying the pixels.
- long sourceOriginY -The Y location within the source data to begin copying the pixels.
- const TLongRect & dstBounds -The bounding rectangle within this image to place the copied pixels.
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:
- long sourceOriginX -The X location within the source data to begin copying the pixels.
- long sourceOriginY -The Y location within the source data to begin copying the pixels.
- const TLongRect & dstBounds -The bounding rectangle within this image to place the copied pixels.
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.
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:
None.
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 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.
- TGModifiableImage ()
- TGModifiableImage (const TLongRect & bounds, TGPoint dpi =TGImage :: k72DPI, EOrientation orientation =kIdentity)
- TGModifiableImage (const TGModifiableImage &)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a TGModifiableImage initialized with the specified parameters.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Call this function directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TLongRect & bounds -The bounding rectangle for the new image.
- TGPoint dpi =TGImage :: k72DPI -The horizontal and vertical resolutions for the image. The default value is 72 dots per inch on both axes.
- EOrientation orientation =kIdentity -The orientation of the new image. The default orientation has no rotation or reflection.
- const TGModifiableImage & -The object to be copied.
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.
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.