Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

IMG_Pixmap Class Reference

Base class for pixmaps. More...

#include <IMG_Pixmap.h>

Inheritance diagram for IMG_Pixmap:

IMG_PixmapRGBA32 IMG_BrushRGBA32 IMG_CanvasRGBA32 List of all members.

Public Types

enum  PixelType { kPixelTypeRGB32 = 0, kPixelTypeRGBA32 = 1, kPixelTypeRGB24 = 5 }
 The type of pixels that are stored in this pixmap. More...


Public Methods

 IMG_Pixmap ()
 Default constructor.

virtual ~IMG_Pixmap ()
 Destructor.

void* getDataPtr ()const
 Access to image data. More...

TUns32 getWidth ()const
 Access to image width. More...

TUns32 getHeight ()const
 Access to image height. More...

void getBounds (IMG_Rect &r)const
 Returns the bounds of the pixmap in a rectangle. More...

PixelType getPixelType ()const
 Access to pixel type. More...

void clamp (TInt32 &x,TInt32 &y)const
 Clamps coordinates inside (0, 0) and (width, height). More...

void clamp (float &u,float &v)const
 Clamps u, v coordinates between 0 and 1. More...

void getPixelAddress (float u,float v,TInt32 &x,TInt32 &y)const
 Converts (u,v) coordinates to pixel addresses. More...


Protected Attributes

void* m_image
 Pointer to the image data.

TUns32 m_width
 Width of the image in pixels.

TUns32 m_height
 Height of the image in pixels.

TUns32 m_rowBytes
 Number of bytes for one row in the image.

TUns32 m_pixelSize
 Size in bits for one pixel.

PixelType m_pixelType
 Type of pixels in this image.


Detailed Description

Base class for pixmaps.

Author(s):
Maarten Gribnau
Date:
March 6, 2001


Member Enumeration Documentation

enum IMG_Pixmap::PixelType
 

The type of pixels that are stored in this pixmap.

Enumeration values:
kPixelTypeRGB32   R:8, G:8, B:8, Ignore:8.
kPixelTypeRGBA32   R:8, G:8, B:8, Alpha:8.
kPixelTypeRGB24   R:8, G:8, B:8.


Member Function Documentation

void IMG_Pixmap::clamp ( float & u,
float & v ) const [inline]
 

Clamps u, v coordinates between 0 and 1.

Parameters:
u   requested u-coordinate
v   requested v-coordinate

void IMG_Pixmap::clamp ( TInt32 & x,
TInt32 & y ) const [inline]
 

Clamps coordinates inside (0, 0) and (width, height).

Parameters:
x   requested x-coordinate
y   requested y-coordinate

void IMG_Pixmap::getBounds ( IMG_Rect & r ) const [inline]
 

Returns the bounds of the pixmap in a rectangle.

Parameters:
bounds   of the image

void * IMG_Pixmap::getDataPtr ( ) const [inline]
 

Access to image data.

Returns:
pointer to the image data

TUns32 IMG_Pixmap::getHeight ( ) const [inline]
 

Access to image height.

Returns:
height of the image

void IMG_Pixmap::getPixelAddress ( float u,
float v,
TInt32 & x,
TInt32 & y ) const [inline]
 

Converts (u,v) coordinates to pixel addresses.

Assumes that (u,v) coordinates are in the [0,1] range.

Parameters:
u   requested u-coordinate in the image
v   requested v-coordinate in the image
x   calculated x-coordinate in the image
y   calculated y-coordinate in the image

IMG_Pixmap::PixelType IMG_Pixmap::getPixelType ( ) const [inline]
 

Access to pixel type.

Returns:
the pixel type

TUns32 IMG_Pixmap::getWidth ( ) const [inline]
 

Access to image width.

Returns:
width of the image


The documentation for this class was generated from the following files:
Generated at Thu May 3 17:29:38 2001 for ImgLib by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000