transform - Methods to Transform an Image

- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS
  - ChopImage
  - CoalesceImages
  - CropImage
  - DeconstructImages
  - FlipImage
  - FlopImage
  - RollImage

# NAME

transform - Methods to Transform an Image

# SYNOPSIS

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

void CoalesceImages( Image `*images` );

Image * CropImage( const Image *image, const RectangleInfo `*crop_info` );

void DeconstructImages( Image `*images` );

Image * FlipImage( const Image `*image` );

Image * FlopImage( const Image `*image` );

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

# 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 ( const Image *image, const RectangleInfo *chop_info );

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.

## 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:

> void CoalesceImages ( Image *images );

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.

## 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 cropped image will always use less memory than the original.

The format of the CropImage method is:

> Image *CropImage ( const Image *image, const RectangleInfo *crop_info );

A description of each parameter follows:

cropped_image:

  Method CropImage returns a pointer to the cropped 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.

## 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:

> void DeconstructImages ( Image *images );

A description of each parameter follows:

images:

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

## 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 ( const Image *image );

A description of each parameter follows:

flipped_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.

## 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 ( const Image *image );

A description of each parameter follows:

flopped_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.

## 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 ( const Image *image, const int x_offset, const int y_offset );

A description of each parameter follows:

rolled_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.