NAME

cache - Methods to Get or Set Image Pixels


SYNOPSIS

void CloseImagePixels( Image *image );

void DestroyImagePixels( Image *image );

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

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

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

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

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

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


FUNCTION DESCRIPTIONS

CloseImagePixels

Method CloseImagePixels ( ) closes the pixel cache. Use this method to preventtoo many file descriptors from being allocated when reading an imagesequence. File descriptors are only used for a disk-based cache. This isessentially 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 image.

DestroyImagePixels

Method DestroyImagePixels ( ) deallocates memory associated with the pixelcache.;
The format of the DestroyImagePixels ( ) method is:;
void DestroyImagePixels ( Image *image );

A description of each parameter follows:

image:
The image.

GetImagePixels

Method GetImagePixels ( ) gets pixels from the in-memory or disk pixel cacheas defined by the geometry parameters. A pointer to the pixels is returnedif the pixels are transferred, otherwise a NULL is returned.;
The format of the GetImagePixels ( ) method is:;
PixelPacket *GetImagePixels ( Image *image, const long x, const long y, const unsigned long columns, const unsigned long rows );

A description of each parameter follows:

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

image:
The image.

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

GetIndexes

Method GetIndexes ( ) returns the indexes associated with the last call toSetImagePixels ( ) or GetImagePixels ( ) .;
The format of the GetIndexes ( ) method is:;
IndexPacket *GetIndexes ( const Image *image );

A description of each parameter follows:

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

image:
The 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 long x, const long y );

A description of each parameter follows:

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

image:
The image.

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

GetPixels

Method GetPixels ( ) returns the pixels associated with the last call toSetImagePixels ( ) or GetImagePixels ( ) .;
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 SetImagePixels ( ) or GetImagePixels ( ) .;

image:
The image.

SetImagePixels

Method SetImagePixels ( ) allocates an area to store image pixels as definedby the region rectangle and returns a pointer to the area. This area issubsequently transferred from the pixel cache with SyncImagePixels ( ) . Apointer to the pixels is returned if the pixels are transferred, otherwisea NULL is returned.;
The format of the SetImagePixels ( ) method is:;
PixelPacket *SetImagePixels ( Image *image, const long x, const long y, const unsigned long columns, const unsigned long rows );

A description of each parameter follows:

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

image:
The 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 diskcache. The method returns True if the pixel region is synced, otherwiseFalse.;
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 image.