constitute - Methods to Constitute an Image
Image * ConstituteImage( const unsigned int width, const unsigned int height, const char *map, const StorageType type, const void *pixels, ExceptionInfo *exception );
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 be char, short int, int, float, or double. Float and double require the pixels to be normalized [0..1], otherwise [0..MaxRGB]. For example, to create 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:
DispatchImage extracts pixel data from an image and returns it to you. The method returns False on success otherwise True if an error is encountered. The data is returned as char, short int, int, float, or double in the order specified by map. Suppose we want want to extract the first scanline 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 an image without having to read the image into memory. It returns the width, height, file size in bytes, and the file format of the image. For an image sequence, only the information for the first image in the sequence is returned.
PingImage returns an Image on success and NULL if the image cannot be pinged. 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 image cannot 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: