IImage
- IImage is a wrapper for the IGImage geometry class.
The IImage class provides a wrapper for the IGImage geometry class. IImages have an IGImage,
and a matrix. You can draw and transform images, as you can all
IMGraphics. You can also get and set the bundle.
These three spaces are associated with the image: modeling space, which is the space
outside the IImage; image space, or world space, which is the space outside the IGImage; and pixel space, which
is the space outside the IGImage where incrementing by 1 moves to the next pixel.
Most operations are performed in modeling space.
To go from modeling space to world space, call matrix and transform
the modeling space point into a world space point. To go from world space to modeling space call matrix
and untransform the world space point into a modeling space point.
To go from world space to pixel space call TransformPointsIntoPixelCoords.
To go from pixel space to world space call UnTransformPointsFromPixelCoords.
To transform from modeling space to pixel space, call: worldPoint = image.matrix()-> transformPoint(modelingPoint);
worldPointArray[0] = worldPoint; and image.transformPointsIntoPixelCoords(worldPointArray, pixelPointArray);.
IImage - Member Functions and Data by Group
Constructors & Destructor
Use the functions in this group to construct and destroy objects of class IImage.
- ~IImage
public:
virtual ~IImage()
- Destroys an IImage object.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- IImage
- This constructor creates an IImage objects.
Overload 1
public:
IImage(const IImage& bitmap, const IGRect2D& rectangle)
- Use this constructor to create an IImage object as a subimage of a bitmap.
- bitmap
- A constant reference to the image to be copied.
- rectangle
- A constant reference to the rectangle of interest in the specified bitmap.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Overload 2
public:
IImage(const IBitmapHandle& bitmapHandle)
- Use this constructor to creates an IImage using a bitmap handle.
- bitmapHandle
- A constant reference to the handle of the bitmap.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Overload 3
public:
IImage( long width,
long height,
IGImage::EImageType imageType,
ICoordinateSystem::EOrientation orientation = ICoordinateSystem::applicationOrientation ( ),
IColorMap* colmap = & ( IColorMap::defaultColorMap ( ) ) )
- Use this constructor to create an IImage initialized with the specified height, width, and type.
Note that on the OS/2 platform, you should use long values for the first two parameters.
For example, you would specify IImage(64L, 64L, IGImage::kTrueColor24Bit).
A compilation error could occur if
the first two parameters were used literally, for example, as IImage(64, 64, IGImage::kTrueColor24Bit).
- width
- The width of the image.
- height
- The height of the image.
- imageType
- The type of the image as defined in IGImage.
- orientation
- The orientation of the image.
- colmap
- The color map of the image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Overload 4
public:
IImage(const IGImage&)
- Use this constructor to create an IImage object based on the provided
IGImage object.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Overload 5
public:
IImage(const IImage&)
- Use this constructor to create an IImage object that is copied from the given one.
- src
- A constant reference to the IImage object to be copied.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Overload 6
- Default constructor.
public:
IImage()
- Use this constructor to create an IImage with empty geometry and attributes.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Assignment Operator
Use the function in this group to assign the given IImage object to the target one.
- operator =
public:
IImage& operator =(const IImage& source)
- Assigment operator.
- source
- The IImage to be copied.
- Return
- A non-const reference to the left-hand side object.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Identifying the Graphics Port and Drawing the Image to It
Use the functions in this group to obtain the graphics port to be used to render the image
and to draw the image to the graphics port.
- draw
public:
virtual void draw(IGrafPort& port) const
- Draws the graphic to the specified IGrafPort.
- port
- The grafport into which to render this image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- grafPort
- Returns the IGrafPort used to render this image.
public:
IGrafPort* grafPort()
- IImage does not ensure multitask safety, so you can only obtain one grafport.
Use this grafport to render into the image.
- Return
- The pointer to the grafport of this image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Obtaining and Releasing the Attribute Bundle
Use the functions in this group to obtain and release the
attribute bundle used for the IImage graphic.
- adoptAttributeState
public:
virtual void
adoptAttributeState( IAttributeState* adoptedAttributeState )
- Adopts the specified attribute bundle to determine the graphic's attributes.
- adoptedAttributeState
- A pointer to the attribute bundle to be adopted by this IImage.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- attributeState
public:
virtual const IAttributeState* attributeState() const
- Gets the attribute bundle, keeping it available to the IImage.
- Return
- A constant pointer to the attribute bundle.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- orphanAttributeState
public:
virtual IAttributeState* orphanAttributeState()
- Relinquishes knowledge of, and responsibility for, the IImage's attribute bundle, returning it to the caller.
- Return
- The pointer to the orphaned bundle.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Obtaining Image Values and Information
Use the functions in this group to obtain information about the
IImage object, such as its transformation matrix in world space, whether it has a color transparent mask, the
transparent color, and the bounding rectangle.
- geometricBounds
public:
virtual IGRect2D geometricBounds() const
- Calculates and returns the image's bounding rectangle, not including any area determined by the attribute bundle.
- Return
- The smallest rectangle that fully encloses the image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- hasTransparentColor
public:
bool hasTransparentColor() const
- Checks if the IImage has a color transparent mask.
- Return
- True if this IImage has a transparent mask.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- sourceBounds
public:
IGRect2D sourceBounds() const
- Calculates and returns the bounding rectangle of the source image for the image object (in pixel space).
- Return
- The smallest rectangle that fully encloses the source image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- transparentColor
public:
IBaseColor transparentColor() const
- Returns the transparent color.
- Return
- The transparent color.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- sourceOrigin
protected:
IGPoint2D sourceOrigin() const
- Returns origin point (0., 0.).
- Return
- The point (0.0, 0.0).
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Obtaining the Image Geometry
Use this function to obtain the image geometry.
- image
- Returns the image geometry for which this class is a wrapper.
public:
const IGImage* image() const
- You cannot edit the image geometry this function returns.
- Return
- A constant pointer to the IGImage representing the image geometry of this image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Reflecting the Image
Use these functions to reflect the image either horizontally or vertically.
- reflectHorizontally
public:
IImage& reflectHorizontally()
- Reflects the image horizontally.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- reflectVertically
public:
IImage& reflectVertically()
- Reflects the image vertically.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Replacing an Image or Modifying Aspects of It
Use the functions in this group to adopt an image and delete the old one or to modify an image.
For example, you can use these functions to draw a portion of the image, move the image's
position, set the transparent mask and reset it (deleting the old one), scale the image, transpose it,
and transform its shape.
- drawPartial
public:
void
drawPartial( IGrafPort& port,
const IGRect2D& areaOfInterestInSource ) const
- Draws the portion of the image that lies within the specified rectangle to the specified IGrafPort.
- port
- The port into which to render the image.
- areaOfInterestInSource
- The rectangular portion of the image to render.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- resetTransparentColor
public:
IImage& resetTransparentColor()
- Resets the transparent mask.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- setTransparentColor
public:
IImage& setTransparentColor(const IBaseColor& aColor)
- Sets the transparent mask and the flag after deleting the old one.
- aColor
- A constant reference to the transparent color.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- transformBy
public:
virtual void transformBy(const IGrafMatrix&)
- Transforms the image's shape and position by applying the specified transformation matrix.
- matrix
- A constant reference to the matrix by which this image is to be transformed.
- Exception
Determined |
by derived classes. |
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- transposeXForY
public:
IImage& transposeXForY()
- Transposes the image.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- adoptImage
protected:
void adoptImage(IGImage* theImage)
- Adopts an IGImage and deletes the old image and the old mask.
- theImage
- Pointer to the new image to be adopted.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Rotating an Image
Use the functions in this group to rotate an image by 180, 270, or 90 degrees.
- rotateBy180
public:
IImage& rotateBy180()
- Rotates the image by 180 degrees.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- rotateBy270
public:
IImage& rotateBy270()
- Rotates the image by 270 degrees.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- rotateBy90
public:
IImage& rotateBy90()
- Rotates the image by 90 degrees.
- Return
- A reference to itself.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Streaming the Object In and Out
Use the functions in this group to write an IImage object out to a stream and read one in from a stream.
- readFromStream
protected:
virtual void readFromStream(IDataStream& toWhere)
- Reads the image object in from the specified stream.
- fromStream
- A constant reference to the stream from which to read in the image.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
- writeToStream
protected:
virtual void writeToStream(IDataStream& toWhere) const
- Writes the image object out to the specified stream.
- toWhere
- The stream to which this image is to be written out.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
Testing Two Images for Equality
Use the function in this group to test two objects for equality.
- operator ==
public:
virtual bool operator ==(const IMDrawable&) const
- Tests two IImage objects for equality.
- rhs
- A constant reference to the object to be compared with this one.
- Return
- True if the two IImage objects have the same IGImages and attributes.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
Yes |
IImage - Inherited Member Functions and Data
Inherited Public Functions
- IMDrawable
-
- IMGraphic
-
- IMStreamable
-
Inherited Public Data
Inherited Protected Functions
- IMDrawable
-
- IMGraphic
-
IMGraphic(IGrafBundle* adoptedBundle)
IMGraphic(const IMGraphic&)
IMGraphic& operator =(const IMGraphic& source)
virtual void resetTimeStamp()
void setHit(bool flag)
virtual void setTimeStamp(const unsigned long&)
virtual unsigned long timeStamp() const
virtual void updateTimeStamp()
- IMStreamable
-
IMStreamable(const IMStreamable& other)
IMStreamable()
virtual void readFromStream(IDataStream& fromwhere) = 0
virtual void writeToStream(IDataStream& towhere) const = 0
Inherited Protected Data