constitute - Methods to Constitute an Image
image: ConstituteImage( )returns a pointer to the image. A null image is returned if there is a memory shortage or if the image cannot be read.;
DestroyConstitute( void );
unsigned int DispatchImage( Image *image, const int x, const int y, const unsigned int columns, const unsigned int rows, const char *map, const StorageType type, void *pixels );
Image * PingImage( const ImageInfo *image_info, ExceptionInfo *exception );
Image * ReadImage( const ImageInfo *image_info, ExceptionInfo *exception );
unsigned int WriteImage( const ImageInfo *image_info, Image *image );
ConstituteImage ( ) returns an image from the the pixel data you supply.The pixel data must be in scanline order top-to-bottom. The data can bechar, short int, int, float, or double. Float and double require thepixels to be normalized [0..1], otherwise [0..MaxRGB]. For example, tocreate a 640x480 image from unsigned red-green-blue character data, use;
image=ConstituteImage ( 640, 480, "RGB", CharPixel, pixels, &exception );;
The format of the Constitute method is:
Image *ConstituteImage ( const unsigned int width, const unsigned int height, const char *map, const StorageType type, const void *pixels, ExceptionInfo *exception );
A description of each parameter follows:
image: ConstituteImage ( ) returns a pointer to the image. A null image is returned if there is a memory shortage or if the image cannot be read.;
Method DestroyConstitute destroys the constitute environment.
The format of the DestroyConstitute method is:
DestroyConstitute ( void );
DispatchImage ( ) extracts pixel data from an image and returns it to you.The method returns False on success otherwise True if an error isencountered. The data is returned as char, short int, int, float, or doublein the order specified by map. Suppose we want want to extract the firstscanline of a 640x480 image as character data in red-green-blue order:;
DispatchImage ( image, 0, 0, 640, 1, "RGB", 0, pixels );;
The format of the DispatchImage method is:
unsigned int DispatchImage ( Image *image, const int x, const int y, const unsigned int columns, const unsigned int rows, const char *map, const StorageType type, void *pixels );
A description of each parameter follows:
PingImage ( ) is a convenience method that returns information about animage without having to read the image into memory. It returns thewidth, height, file size in bytes, and the file format of the image.For an image sequence, only the information for the first imagein the sequence is returned.;
PingImage ( ) returns an Image on success and NULL if the image cannot bepinged. The image does not contain any pixel data.;
The format of the PingImage method is:
Image *PingImage ( const ImageInfo *image_info, ExceptionInfo *exception );
A description of each parameter follows:
ReadImage ( ) reads an image or image sequence from a file or file handle.The method returns a NULL if there is a memory shortage or if the imagecannot be read.;
The format of the ReadImage method is:
Image *ReadImage ( const ImageInfo *image_info, ExceptionInfo *exception );
A description of each parameter follows:
Write()
allows you to write a single or image or a sequence to a file or filehandle. Write()
returns a value other than 0 if the image is written. If 0 is returned, check the exception member of image to determine why the image failed to write.
The format of the WriteImage method is:
unsigned int WriteImage ( const ImageInfo *image_info, Image *image );
A description of each parameter follows: