VIMOS DRS Reference Manual
2.9.13
|
Functions | |
VimosImageArray * | newImageArray (int size) |
Create an empty image array of appropriate size. More... | |
void | deleteImageArray (VimosImageArray *array) |
Delete an image array object. More... | |
void | destroyImageArray (VimosImageArray *array) |
Destroy an image array object. More... | |
int | imageArrayIsEmpty (const VimosImageArray *array) |
Check if an image array object is empty. More... | |
int | imageArrayCapacity (const VimosImageArray *array) |
Get the capacity of an image array. More... | |
int | imageArraySize (const VimosImageArray *array) |
Get the number of images stored in an image array. More... | |
const VimosImage * | imageArrayGet (const VimosImageArray *array, int index) |
The function retrieves an image from an image array object. More... | |
int | imageArraySet (VimosImageArray *array, int index, const VimosImage *image) |
Set an element of an image array. More... | |
VimosImage * | imageArrayRemove (VimosImageArray *array, int index) |
Remove an image from an image array object. More... | |
VimosImage ** | imageArrayGetData (const VimosImageArray *array) |
Get reference to the array objects data. More... | |
The module VimosImageArray implements a simple, fixed size array container for images.
void deleteImageArray | ( | VimosImageArray * | array | ) |
Delete an image array object.
array | Image array object to be deallocated. |
The function deallocates the image array object array. The array object must be empty.
NULL
nothing is done.void destroyImageArray | ( | VimosImageArray * | array | ) |
Destroy an image array object.
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.
NULL
nothing is done.int imageArrayCapacity | ( | const VimosImageArray * | array | ) |
Get the capacity of an image array.
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.
const VimosImage* imageArrayGet | ( | const VimosImageArray * | array, |
int | index | ||
) |
The function retrieves an image from an image array object.
NULL
is returned.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.
VimosImage** imageArrayGetData | ( | const VimosImageArray * | array | ) |
Get reference to the array objects data.
array | Image array object. |
The function returns a handle of the the array's data block.
int imageArrayIsEmpty | ( | const VimosImageArray * | array | ) |
Check if an image array object is empty.
VM_TRUE
if the array is empty, otherwise VM_FALSE
is returned.array | Image array object to be tested. |
The function checks if any image is stored in the array.
VimosImage* imageArrayRemove | ( | VimosImageArray * | array, |
int | index | ||
) |
Remove an image from an image array object.
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
.
int imageArraySet | ( | VimosImageArray * | array, |
int | index, | ||
const VimosImage * | image | ||
) |
Set an element of an image array.
EXIT_SUCCESS
if no error occurred, or EXIT_FAILURE
otherwise.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.
NULL
as image image.int imageArraySize | ( | const VimosImageArray * | array | ) |
Get the number of images stored in an image array.
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.
VimosImageArray* newImageArray | ( | int | size | ) |
Create an empty image array of appropriate size.
NULL
otherwise.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
.