IMAGE Class
IMAGE Class. A CmImage object stores an image that can be drawn in a CmDrawArea object or can be set as background for CmPushButton, CmRadioButton and CmToggleButton objects. Before drawing the image you must install() it, that is: allocate image colors. If your image is not currently displayed in any object and you want to keep it in memory, you can uninstall() it in order to free image colors. This is particularly recommended if you run your application in a colormap based color system (16 or 256 color modes). Installing an image can also cause further resource allocation: under Windows a BITMAP is created, under X-Window a PIXMAP is allocated in the server's memory, under GRX a GrContext is created. CmImage objects can be created by loading a BMP file or by specifying the image attributes as the dimensions and the depth.
CmImage(int imgw, int imgh, int np)
imgh -
The desired image height.
np -
The desired number of color planes. Valid values are 1, 4, 8, 24. void install(void)
void uninstall(void)
int getWidth(void)
int getHeight(void)
int getNColors(void)
int getNPlanes(void)
void getPixelRGB(int x, int y, int *pr, int *pg, int *pb)
y -
The Y coordinate of the pixel (top to bottom of image)
pr -
A pointer to an integer variable that will contain the Red pixel value
on return.
pg -
A pointer to an integer variable that will contain the Green pixel value
on return.
pb -
A pointer to an integer variable that will contain the Blue pixel value
on return. void setPixelRGB(int x, int y, int r, int g, int b)
y -
The Y coordinate of the pixel (top to bottom of image)
r -
The Red component to set to the pixel value.
g -
The Blue component to set to the pixel value.
b -
The Blue component to set to the pixel value. int getPixelIndex(int x, int y)
void setPixelIndex(int x, int y, int i)
void getCMapEntry(int i, int *pr, int *pg, int *pb)
pr -
Points to an integer variable that will contain the Red pixel value
on return.
pg -
Points to an integer variable that will contain the Green pixel value
on return.
pb -
Points to an integer variable that will contain the Blue pixel value
on return. void setCMapEntry(int i, int r, int g, int b)
r -
The Red component to set to the colormap entry.
g -
The Blue component to set to the colormap entry.
b -
The Blue component to set to the colormap entry. void merge(CmImage *src, int xo, int yo)
void setMask(CmImage *mask)
CmImage* clone(void)
CmImage* createImageMaskByCMapIndex(int index)
CmImage* createImageMaskByRGB(int r, int g, int b)
alphabetic index hierarchy of classes
generated by doc++