VimosImageArray


Functions

VimosImageArray * newImageArray (int size)
 Create an empty image array of appropriate size.
void deleteImageArray (VimosImageArray *array)
 Delete an image array object.
void destroyImageArray (VimosImageArray *array)
 Destroy an image array object.
int imageArrayIsEmpty (const VimosImageArray *array)
 Check if an image array object is empty.
int imageArrayCapacity (const VimosImageArray *array)
 Get the capacity of an image array.
int imageArraySize (const VimosImageArray *array)
 Get the number of images stored in an image array.
const VimosImage * imageArrayGet (const VimosImageArray *array, int index)
 The function retrieves an image from an image array object.
int imageArraySet (VimosImageArray *array, int index, const VimosImage *image)
 Set an element of an image array.
VimosImage * imageArrayRemove (VimosImageArray *array, int index)
 Remove an image from an image array object.
VimosImage ** imageArrayGetData (const VimosImageArray *array)
 Get reference to the array objects data.

Detailed Description

The module VimosImageArray implements a simple, fixed size array container for images.

Function Documentation

void deleteImageArray ( VimosImageArray *  array  ) 

Delete an image array object.

Returns:
Nothing.
Parameters:
array Image array object to be deallocated.
The function deallocates the image array object array. The array object must be empty.

Note:
If array is NULL nothing is done.
See also:
destroyImageArray
Author:
R. Palsa

void destroyImageArray ( VimosImageArray *  array  ) 

Destroy an image array object.

Returns:
Nothing.
Parameters:
array Image array object to be destroyed.
The function works as deleteImageArray(), but any image which is stored in the array is deallocated prior to the deallocation of the array object array.

Note:
If array is NULL nothing is done.
See also:
deleteImageArray
Author:
R. Palsa

int imageArrayCapacity ( const VimosImageArray *  array  ) 

Get the capacity of an image array.

Returns:
The function returns the image array's capacity.
Parameters:
array Image array object.
The function reports the capacity of the array array, i.e. the maximum number of images which could be stored in the array.

Author:
R. Palsa

const VimosImage* imageArrayGet ( const VimosImageArray *  array,
int  index 
)

The function retrieves an image from an image array object.

Returns:
The function returns a handle to a stored image. If no image is associated to an array element NULL is returned.
Parameters:
array Image array object.
index Array element offset.
The function returns a reference to the image stored in the array array. The offset index is the usual C array offset, i.e. the first image is accessed by passing 0 as index.

See also:
imageArraySet
Author:
R. Palsa

VimosImage** imageArrayGetData ( const VimosImageArray *  array  ) 

Get reference to the array objects data.

Returns:
The function returns the reference to the array data block. This function always succeeds.
Parameters:
array Image array object.
The function returns a handle of the the array's data block.

Note:
This function should be used with care.
Author:
R. Palsa

int imageArrayIsEmpty ( const VimosImageArray *  array  ) 

Check if an image array object is empty.

Returns:
The function returns VM_TRUE if the array is empty, otherwise VM_FALSE is returned.
Parameters:
array Image array object to be tested.
The function checks if any image is stored in the array.

Author:
R. Palsa

VimosImage* imageArrayRemove ( VimosImageArray *  array,
int  index 
)

Remove an image from an image array object.

Returns:
The function returns a handle to the removed image.
Parameters:
array Image array object.
index Array element offset.
The function removes the image stored at the array offset index and returns a reference to the removed image. The array element is reset to NULL. If no image was stored in the array element the function succeeds and the returned reference is NULL.

Author:
R. Palsa

int imageArraySet ( VimosImageArray *  array,
int  index,
const VimosImage *  image 
)

Set an element of an image array.

Returns:
The function returns EXIT_SUCCESS if no error occurred, or EXIT_FAILURE otherwise.
Parameters:
array Image array object.
index Array element offset.
image Image object.
The functions stores the image image into the element with offset index of the image array object array. To be successfull index must be equal or larger than 0, smaller than the array's capacity and the array element must not already reference another image. If a stored image should be replaced by another image first use imageArrayRemove() to extract an image from the array object.

Note:
One cannot use this function to reset an array element, i.e. one cannot pass NULL as image image.
See also:
imageArrayGet, imageArrayRemove
Author:
R. Palsa

int imageArraySize ( const VimosImageArray *  array  ) 

Get the number of images stored in an image array.

Returns:
The function returns the number of stored images.
Parameters:
array Image array object.
The function retrieves the number of images currently stored in the image array object array. The reported number is not the array objects capacity, i.e. the maximum number of images which could be stuffed into the array.

Author:
R. Palsa

VimosImageArray* newImageArray ( int  size  ) 

Create an empty image array of appropriate size.

Returns:
The function returns the pointer to the allocated array object if no error occurred, or NULL otherwise.
Parameters:
size Size of the image array.
The function allocates the memory for an image array of size elements. All array elements are initialized to to NULL.

Author:
R. Palsa


Generated on Mon Mar 14 15:55:43 2011 for VIMOS DRS Reference Manual by  doxygen 1.4.7