NAME

pixels - Methods to Get or Set Image Pixels


SYNOPSIS

void CloseImagePixels( Image *image );

void DestroyImagePixels( Image *image );

PixelPacket * GetImagePixels( Image *image, const int x, const int y, const unsigned int columns, const unsigned int rows );

IndexPacket * GetIndexes( const Image *image );

PixelPacket * GetOnePixel( const Image image, const int x, const int y );

PixelPacket * GetPixels( const Image image );

PixelPacket * SetImagePixels( Image *image, const int x, const int y, const unsigned int columns, const unsigned int rows );

unsigned int SyncImagePixels( Image *image );


FUNCTION DESCRIPTIONS

CloseImagePixels

Method CloseImagePixels closes the pixel cache. Use this method to prevent the too many file descriptors from being allocated when reading an image sequence. File descriptors are only used for a disk-based cache. This is essentially a no-op for a memory-based cache.

The format of the CloseImagePixels method is:

void CloseImagePixels ( Image *image );

A description of each parameter follows:

image:
The address of a structure of type Image.

DestroyImagePixels

Method DestroyImagePixels deallocates memory associated with the pixel cache.

The format of the DestroyImagePixels method is:

void DestroyImagePixels ( Image *image );

A description of each parameter follows:

image:
The address of a structure of type Image.

GetIndexes

Method GetIndexes returns the colormap indexes associated with the last call to the SetImagePixels() or GetImagePixels() methods.

The format of the GetIndexes method is:

IndexPacket *GetIndexes ( const Image *image );

A description of each parameter follows:

indexes:
Method GetIndexes returns the colormap indexes associated with the last call to the SetImagePixels() or GetImagePixels() methods.

image:
The address of a structure of type Image.

GetOnePixel

Method GetOnePixel returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs.

The format of the GetOnePixel method is:

PixelPacket *GetOnePixel ( const Image image, const int x, const int y );

A description of each parameter follows:

pixels:
Method GetOnePixel returns a pixel at the specified (x,y) location.

image:
The address of a structure of type Image.

x,y:
These values define the location of the pixel to return.

GetImagePixels

Method GetImagePixels gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

The format of the GetImagePixels method is:

PixelPacket *GetImagePixels ( Image *image, const int x, const int y, const unsigned int columns, const unsigned int rows );

A description of each parameter follows:

status:
Method GetImagePixels returns a pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

image:
The address of a structure of type Image.

x,y,columns,rows:
These values define the perimeter of a region of pixels.

GetPixels

Method GetPixels returns the pixels associated with the last call to the SetImagePixels() or GetImagePixels() methods.

The format of the GetPixels method is:

PixelPacket *GetPixels ( const Image image );

A description of each parameter follows:

pixels:
Method GetPixels returns the pixels associated with the last call to the SetImagePixels() or GetImagePixels() methods.

image:
The address of a structure of type Image.

SetImagePixels

Method SetImagePixels allocates an area to store image pixels as defined by the region rectangle and returns a pointer to the area. This area is subsequently transferred from the pixel cache with method SyncImagePixels. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

The format of the SetImagePixels method is:

PixelPacket *SetImagePixels ( Image *image, const int x, const int y, const unsigned int columns, const unsigned int rows );

A description of each parameter follows:

pixels:
Method SetImagePixels returns a pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

image:
The address of a structure of type Image.

x,y,columns,rows:
These values define the perimeter of a region of pixels.

SyncImagePixels

Method SyncImagePixels saves the image pixels to the in-memory or disk cache. The method returns True if the pixel region is synced, otherwise False.

The format of the SyncImagePixels method is:

unsigned int SyncImagePixels ( Image *image );

A description of each parameter follows:

status:
Method SyncImagePixels returns True if the image pixels are transferred to the in-memory or disk cache otherwise False.

image:
The address of a structure of type Image.