NAME

transform - Methods to Transform an Image


SYNOPSIS

Image * ChopImage( Image *image, const RectangleInfo *chop_info );

Image * CoalesceImages( Image *image, ExceptionInfo *exception );

Image * CropImage( Image *image, const RectangleInfo *crop_info, ExceptionInfo *exception );

Image * DeconstructImages( Image *image, ExceptionInfo *exception );

Image * FlipImage( Image *image, ExceptionInfo *exception );

Image * FlopImage( Image *image, ExceptionInfo *exception );

unsigned int ProfileImage( Image *image, const char *profile_name, const char *filename );

Image * RollImage( Image *image, const int x_offset, const int y_offset, ExceptionInfo *exception );

void TransformImage( Image ** image, const char *crop_geometry, const char *image_geometry );


FUNCTION DESCRIPTIONS

ChopImage

Method ChopImage creates a new image that is a subregion of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the ChopImage method is:

Image *ChopImage ( Image *image, const RectangleInfo *chop_info );
      ExceptionInfo *exception)

A description of each parameter follows:

chop_image:
Method ChopImage returns a pointer to the chop image. A null image is returned if there is a memory shortage or if the image width or height is zero.

image:
The address of a structure of type Image.

chop_info:
Specifies a pointer to a RectangleInfo which defines the region of the image to crop.

exception:
return any errors or warnings in this structure.

CoalesceImages

Method CoalesceImages merges a sequence of images. This is useful for GIF and MNG animation sequences that have page offsets and disposal methods.

The format of the CoalesceImages method is:

Image *CoalesceImages ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
The address of a structure of type Image; returned from ReadImage. It points to the first image in the group to be coalesced.

exception:
return any errors or warnings in this structure.

CropImage

Method CropImage creates a new image that is a subregion of an existing one. It allocates the memory necessary for the new Image structure and returns a pointer to the new image. This method is optimized to preserve the runlength encoding. That is, the crop image will always use less memory than the original.

The format of the CropImage method is:

Image *CropImage ( Image *image, const RectangleInfo *crop_info, ExceptionInfo *exception );

A description of each parameter follows:

crop_image:
Method CropImage returns a pointer to the crop image. A null image is returned if there is a memory shortage or if the image width or height is zero.

image:
The address of a structure of type Image.

crop_info:
Specifies a pointer to a RectangleInfo which defines the region of the image to crop.

exception:
return any errors or warnings in this structure.

DeconstructImages

Method DeconstructImages breaks down an image sequence into constituent parts. This is useful for creating GIF or MNG animation sequences.

The format of the DeconstructImages method is:

Image *DeconstructImages ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

image:
The address of a structure of type Image; returned from ReadImage. It points to the first next in the group to be deconstructed.

exception:
return any errors or warnings in this structure.

FlipImage

Method FlipImage creates a new image that reflects each scanline in the vertical direction It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the FlipImage method is:

Image *FlipImage ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

flip_image:
Method FlipImage returns a pointer to the image after reflecting. A null image is returned if there is a memory shortage.

image:
The address of a structure of type Image.

exception:
return any errors or warnings in this structure.

FlopImage

Method FlopImage creates a new image that reflects each scanline in the horizontal direction It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the FlopImage method is:

Image *FlopImage ( Image *image, ExceptionInfo *exception );

A description of each parameter follows:

flop_image:
Method FlopImage returns a pointer to the image after reflecting. A null image is returned if there is a memory shortage.

image:
The address of a structure of type Image.

exception:
return any errors or warnings in this structure.

ProfileImage

Method ProfileImage removes or adds a ICM, IPTC, or generic profile to an image. If the profile name is specified it is deleted from the image. If a filename is specified, one or more profiles are read and added to the image.

The format of the ProfileImage method is:

unsigned int ProfileImage ( Image *image, const char *profile_name, const char *filename );

A description of each parameter follows:

status:
Method ProfileImage returns True if the profile is successfully added or removed from the image, otherwise False.

image:
The address of a structure of type Image.

profile_name:
Specifies the type of profile to add or remove.

filename:
Specifies the filename of the ICM or IPTC profile.

RollImage

Method RollImage rolls an image vertically and horizontally. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

The format of the RollImage method is:

Image *RollImage ( Image *image, const int x_offset, const int y_offset, ExceptionInfo *exception );

A description of each parameter follows:

roll_image:
Method RollImage returns a pointer to the image after rolling. A null image is returned if there is a memory shortage.

image:
The address of a structure of type Image.

x_offset:
An integer that specifies the number of columns to roll in the horizontal direction.

y_offset:
An integer that specifies the number of rows to roll in the vertical direction.

exception:
return any errors or warnings in this structure.

TransformImage

Method TransformImage creates a new image that is a transformed size of of existing one as specified by the crop and image geometries. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.

If a crop geometry is specified a subregion of the image is obtained. If the specified image size, as defined by the image and scale geometries, is smaller than the actual image size, the image is first minified to an integral of the specified image size with an antialias digital filter. The image is then scaled to the exact specified image size with pixel replication. If the specified image size is greater than the actual image size, the image is first enlarged to an integral of the specified image size with bilinear interpolation. The image is then scaled to the exact specified image size with pixel replication.

The format of the TransformImage method is:

void TransformImage ( Image **image, const char *crop_geometry, const char *image_geometry );

A description of each parameter follows:

image:
The address of an address of a structure of type Image. The transformed image is returned as this parameter.

crop_geometry:
Specifies a pointer to a crop geometry string. This geometry defines a subregion of the image.

image_geometry:
Specifies a pointer to a image geometry string. The specified width and height of this geometry string are absolute.