Functions | |
MIMAGE | MAllocImage (int imgw, int imgh, int np) |
Creates an empty MIMAGE object. | |
MIMAGE | MReadImageFile (const char *fname) |
Creates a MIMAGE object from an image file. | |
MIMAGE | MReadPNGFile (const char *fname) |
Creates a MIMAGE object from a PNG file. | |
MIMAGE | MReadBMPFile (const char *fname) |
Creates a MIMAGE object from a Windows BMP file. | |
MIMAGE | MReadTIFFFile (const char *fname) |
Creates a MIMAGE object from a TIFF file. | |
MIMAGE | MReadJPEGFile (const char *fname) |
Creates a MIMAGE object from a JPEG file. | |
MIMAGE | MReadGIFFile (const char *fname) |
Creates a MIMAGE object from a GIF file. | |
MIMAGE | MImageClone (MIMAGE img) |
Creates a new image by cloning the one received as parameter. | |
void | MImageAddDefaultTypeGIF (void) |
Adds GIF format to the list of image types supported by default image loading function MReadImage(). | |
void | MImageAddDefaultTypeTIFF (void) |
Adds TIFF format to the list of image types supported by default image loading function MReadImage(). | |
void | MImageAddDefaultTypeJPEG (void) |
Adds JPEG format to the list of image types supported by default image loading function MReadImage(). | |
void | MImageAddDefaultTypePNG (void) |
Adds PNG format to the list of image types supported by default image loading function MReadImage(). | |
void | MAddImagePath (const char *path) |
Adds a path to the image search path list. | |
void | MRemoveImagePath (const char *path) |
Removes a previously added image search path. | |
void | MImageAddAlphaChannel (MIMAGE_DESCR *img) |
Adds the alpha channel to an image structure. | |
int | MImageGetPixelAlpha (MIMAGE img, int x, int y) |
Gets the alpha value associated to pixel x,y in the image. | |
void | MImageSetPixelAlpha (MIMAGE img, int x, int y, CARD8 alpha) |
Sets the alpha value associated to pixel x,y in the image. | |
MIMAGE | MCreateImageMaskByCMapIndex (MIMAGE img, int index) |
Creates a MIMAGE object suitable for use as a Mask for the image object 'img'. | |
MIMAGE | MCreateImageMaskByPixel (MIMAGE img, int x, int y) |
Creates a mask for image 'img' by pixel position. | |
MIMAGE | MCreateImageMaskByRGB (MIMAGE img, int r, int g, int b) |
Creates a MIMAGE object suitable for use as a Mask for the image object 'img'. | |
int | MWriteTIFFFile (MIMAGE img, const char *name, int compression) |
Dumps an image to a TIFF file. | |
int | MWriteBMPFile (MIMAGE img, const char *fname) |
Dumps an image to a BMP file. | |
int | MWriteJPEGFile (MIMAGE img, const char *name, int quality) |
Dumps an image to a JPEG file. | |
void | MFreeImage (MIMAGE img) |
Frees all resources used by the image, making image 'img' no longer useable. | |
void | MInstallImage (MIMAGE img) |
Prepares the image object for drawing. | |
void | MUninstallImage (MIMAGE img) |
Frees image resources. | |
void | MImageGetInfo (MIMAGE img, int *pw, int *ph, int *pnplanes) |
Returns basic image information: width, height and nr of planes. | |
void | MImageGetPixelRGB (MIMAGE img, int x, int y, int *pr, int *pg, int *pb) |
Returns the R-G-B values of an image pixel. | |
void | MImageSetPixelRGB (MIMAGE img, int x, int y, int r, int g, int b) |
Sets the R-G-B values of an image pixel. | |
int | MImageGetPixelIndex (MIMAGE img, int x, int y) |
Returns the colormap index value of an image pixel. | |
void | MImageSetPixelIndex (MIMAGE img, int x, int y, int i) |
Sets the colormap index value of an image pixel. | |
void | MImageGetCMapEntry (MIMAGE img, int i, int *pr, int *pg, int *pb) |
Returns the R-G-B values of a colormap entry in the image. | |
void | MImageSetCMapEntry (MIMAGE img, int i, int r, int g, int b) |
Sets the R-G-B values of an entry in the image colormap. | |
void | MImageSetMask (MIMAGE dst, MIMAGE mask) |
Enables masked drawing for the 'dst' image. | |
void | MImageMerge (MIMAGE dst, MIMAGE src, int xo, int yo, int transparent) |
Copies the image 'src' over 'dst' starting at offset 'xo','yo'. | |
void | MImageComputeBackgroundRGB (MIMAGE img, int *pr, int *pg, int *pb) |
void | MImageSetMaskByCMapIndex (MIMAGE img, int id) |
void | MImageSetMaskByPixel (MIMAGE img, int x, int y) |
void | MImageSetMaskByRGB (MIMAGE img, int r, int g, int b) |
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.
|
Adds a path to the image search path list.
Via this function you can extend the image path search list.
of the following base directories:
|
|
Creates an empty MIMAGE object. You can set image pixel colors using MImageSetPixelRGB in case of a True Color image (24 planes), or MImageSetPixelIndex and MImageSetCMapEntry in case of a colormapped image (nplanes != 24).
|
|
Creates a MIMAGE object suitable for use as a Mask for the image object 'img'. The returned image has a 1 plane depth and same dimensions as the calling object. Pixels in the calling object that are using the colormap entry specified by the 'index' argument will generate zero pixels in the returned mask. Provided that the returned image is used to set the image mask (see: MImageSetMask ), the 'index' argument specifies a color in the calling CmImage object to be made 'transparent'. This method works correctly ONLY with Colormapped images. |
|
Creates a mask for image 'img' by pixel position. The returned image is able to mask all pixels in the source image having the same color of the pixel at position 'x', 'y'. |
|
Creates a MIMAGE object suitable for use as a Mask for the image object 'img'. The returned image has a 1 plane depth and same dimensions as the image object 'img'. Pixels in 'img' having an R-G-B value exactly equal to that provided by the 'r', 'g', 'b' arguments will generate zero pixels in the returned mask. Provided that the returned image is used to set the image mask (see: MImageSetMask ), the 'index' argument specifies a color in the calling CmImage object to be made 'transparent'. This function works with both TryeColor and Colormapped images. For Colormapped images, the createImageMaskByCMapIndex method is more performant. |
|
Frees all resources used by the image, making image 'img' no longer useable.
|
|
Adds the alpha channel to an image structure.
|
|
Adds GIF format to the list of image types supported by default image loading function MReadImage(). After having called this static method the application code is enabled to load GIF image files. |
|
Adds JPEG format to the list of image types supported by default image loading function MReadImage(). After having called this static method the application code is enabled to load JPEG image files. If you use this method in your program, you'll have to link the external jpeg-6b library by Independent JPEG Group. |
|
Adds PNG format to the list of image types supported by default image loading function MReadImage(). After having called this static method the application code is enabled to load PNG image files. If you use this method in your program, you'll have to link the external libpng 1.2.5 library. |
|
Adds TIFF format to the list of image types supported by default image loading function MReadImage(). After having called this static method the application code is enabled to load TIFF image files. If you use this method in your program, you'll have to link the external tiff library by Sam Leffler. |
|
Creates a new image by cloning the one received as parameter.
|
|
|
|
Returns the R-G-B values of a colormap entry in the image. This method works ONLY with Colormapped images.
|
|
Returns basic image information: width, height and nr of planes.
|
|
Gets the alpha value associated to pixel x,y in the image.
|
|
Returns the colormap index value of an image pixel. The pixel is identified by the 'x' and 'y' arguments (upper left corner of the image). This method works ONLY with Colormapped images. A negative value (-1) is returned if the image is TrueColor. |
|
Returns the R-G-B values of an image pixel. This method works with both TrueColor and Colormapped images.
|
|
Copies the image 'src' over 'dst' starting at offset 'xo','yo'. Pixels in 'src' having a color index equal to 'transparent' are not copied. This function only works with colormapped images having the same depth (2, 16 or 256 colors). |
|
Sets the R-G-B values of an entry in the image colormap. This method works ONLY with Colormapped images.
|
|
Enables masked drawing for the 'dst' image. The 'mask' image must be a 1 plane image having same dimensions as 'dst'. Only pixels in the calling object having a corresponding pixel value of 1 in the associated mask will be output. |
|
|
|
|
|
|
|
Sets the alpha value associated to pixel x,y in the image.
|
|
Sets the colormap index value of an image pixel. The pixel is identified by the 'x' and 'y' arguments (upper left corner of the image). This method takes effect ONLY in Colormapped images. |
|
Sets the R-G-B values of an image pixel. This method works with both TrueColor and Colormapped images. In case of Colormapped image, the nearest color defined in the image colormap is used to set the pixel value.
|
|
Prepares the image object for drawing. This method causes the image colors to be allocated and a system dependent pixmap to be created. |
|
Creates a MIMAGE object from a Windows BMP file. Both uncompressed and RLE compressed formats are supported. If the bitmap file loading fails for any reason, then a NULL value is returned.
|
|
Creates a MIMAGE object from a GIF file.
|
|
Creates a MIMAGE object from an image file.
If the bitmap file loading fails for any reason, then a NULL value is returned. This function is capable of loading a generic image file among the supported types defined as default. At program startup, only the BMP image format is available as a default type. If you want to add further image types in the default list, then you have to explicitly instruct the library by calling one or more of the functions: MImageAddDefaultTypeGIF(), MImageAddDefaultTypeTIFF(), MImageAddDefaultTypeJPEG(), MImageAddDefaultTypePNG().
|
|
Creates a MIMAGE object from a JPEG file.
|
|
Creates a MIMAGE object from a PNG file. If the image file loading fails for any reason, then a NULL value is returned.
|
|
Creates a MIMAGE object from a TIFF file.
|
|
Removes a previously added image search path. This method has no effect on existing paths in the list that haven't been added using addPath().
|
|
Frees image resources. This method causes the image colors to be freed and the system dependent pixmap to be destroyed. The image can be re-installed again later if necessary. |
|
Dumps an image to a BMP file.
|
|
Dumps an image to a JPEG file.
|
|
Dumps an image to a TIFF file.
|