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 );
Image * ReadImages( const ImageInfo *image_info, ExceptionInfo *exception );
unsigned int WriteImage( const ImageInfo *image_info, Image *image );
Method ConstituteImage is a convenience routine that creates an image from the pixel data you supply and returns it. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. The pixel data must be in scanline order top-to-bottom. The data can be character, short int, integer, float, or double. Float and double require the pixels to be normalized [0..1]. The other types are [0..MaxRGB]. For example, to create a 640x480 image from unsigned red-green-blue character data, use
image=ConstituteImage ( 640, 480, "RGB", 0, 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:
Method DispatchImage is a convenience routine. Use it to extract pixel data from an image and place it in a buffer you supply. The data is saved either as char, short int, integer, float or double format in the order specified by the type parameter. For example, we want to extract scanline 1 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:
Method PingImage returns the image size in bytes if it exists and can be the image is returned as well. Note, only the first image in a multi-frame image file is pinged.
The format of the PingImage method is:
Image *PingImage ( const ImageInfo *image_info, ExceptionInfo *exception );
A description of each parameter follows:
Method ReadImage reads an image and returns it. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. By default, the image format is determined by its magic number. To specify a particular image format, precede the filename with an explicit image format name and a colon (i.e. ps:image) or as the filename suffix (i.e. image.ps).
The format of the ReadImage method is:
Image *ReadImage ( const ImageInfo *image_info, ExceptionInfo *exception );
A description of each parameter follows:
Method ReadImages reads a list of image names from a file and then returns the images as a linked list.
The format of the ReadImage method is:
Image *ReadImages ( const ImageInfo *image_info, ExceptionInfo *exception );
A description of each parameter follows:
Method WriteImage writes an image to a file as defined by image->filename. You can specify a particular image format by prefixing the file with the image type and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). The image may be modified to adapt it to the requirements of the image format. For example, DirectClass images must be color-reduced to PseudoClass if the format is GIF.
The format of the WriteImage method is:
unsigned int WriteImage ( const ImageInfo *image_info, Image *image );
A description of each parameter follows: