next up previous contents index
Next: Signals Up: Color Float movies Previous: Related file (external) types   Contents   Index


Functions Summary

The following is a description of all the functions related to the Cfmovie type. The list is in alphabetical order.

$ \bigcirc$Name


mw_change_cfmovie - Define the movie structure, if not defined




$ \bigcirc$Summary


Cfmovie mw_change_cfmovie(movie)

Cfmovie movie;




$ \bigcirc$Description


This function returns a movie structure if the input movie = NULL. It is provided despite the mw_new_cfmovie function for global coherence with other memory types.

The function mw_change_cfmovie returns NULL if not enough memory is available to define the structure. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Since the MegaWave2 compiler allocates structures for input and output objects (See Volume one: ``MegaWave2 User's Guide''), this function is normally used only for internal objects. Do not forget to deallocate the internal structures before the end of the module.

Images have to be allocated using the appropriate functions (See the example below).




$ \bigcirc$Example

Cfmovie movie=NULL; /* Internal use: no Input neither Output of module */

movie = mw_change_cfmovie(movie);
if (movie == NULL) mwerror(FATAL,1,"Not enough memory.\n");
...
(End of this example as for the mw_new_cfmovie function).

$ \bigcirc$Name


mw_delete_cfmovie - Deallocate all the movie




$ \bigcirc$Summary


void mw_delete_cfmovie(movie)

Cfmovie movie;




$ \bigcirc$Description


This function deallocates all the memory used by a Cfmovie structure: it deallocates the color planes of all images, the image structures and the movie structure itself.

You should set movie = NULL after this call since the address pointed by movie is no longer valid.




$ \bigcirc$Example

See the example of the mw_new_cfmovie function: when a memory allocation fails for mw_change_cfimage, all the previously memory allocations are freed by the call to mw_delete_cfmovie(movie).

$ \bigcirc$Name


mw_new_cfmovie - Create a new Cfmovie




$ \bigcirc$Summary


Cfmovie mw_new_cfmovie();




$ \bigcirc$Description


This function creates a new Cfmovie structure. It returns NULL if not enough memory is available to create the structure. Your code should check this value to send an error message in the NULL case, and do appropriate statement.

Since the MegaWave2 compiler allocates structures for input and output objects (See Volume one: ``MegaWave2 User's Guide''), this function is normally used only for internal objects. Do not forget to deallocate the internal structures before the end of the module.

Images have to be allocated using the appropriate functions (See the example below).




$ \bigcirc$Example

/* Create a movie with 10 images of size (100,100) */

Cfmovie movie;  /* Internal use: no Input neither Output of module */
Cfimage image,image_prev; /* Internal use */

movie = mw_new_cfmovie();
if (movie == NULL) mwerror(FATAL,1,"Not enough memory.\n");
for (l=1;l<=10;l++)
 {
   if ((image = mw_change_cfimage(NULL,100,100)) == NULL)
    {
      mw_delete_cfmovie(movie);
      mwerror(FATAL,1,"Not enough memory.");
    }
    if (l == 1) movie->first = image;
    else
      {
        image_prev->next = image;
        image->previous = image_prev;
       }
     image_prev = image;
 }


next up previous contents index
Next: Signals Up: Color Float movies Previous: Related file (external) types   Contents   Index
mw 2004-05-05