next up previous contents index
Next: Geometrical structures : Point, Up: Two-dimensional wavelet Previous: Related file (external) types   Contents   Index


Functions Summary

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

$ \bigcirc$Name


mw_alloc_biortho_wtrans2d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_biortho_wtrans2d(wtrans,level,nrow,ncol)

Wtrans2d wtrans;

int level;

int nrow,ncol;




$ \bigcirc$Description


This function allocates the array images of a Wtrans2d structure previously created using mw_new_wtrans2d, in order to receive an biorthonormal wavelet representation (spatial decimation, norient = 3). Each image images[l][r] for l = 1...nlevel, r = 0...norient is created and allocated to the right size. Previously allocations are deleted, if any.

The number of levels for the decomposition is given by level and the size of the original image is given by nrow (number of rows), ncol (number of columns).

The array images can be addressed after this call, if the allocation successed. There is no default values for the images. The type field of the Wtrans2d structure is set to mw_biorthogonal.

The function mw_alloc_biortho_wtrans2d returns NULL if not enough memory is available to allocate one of the images. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans2d (see example below).




$ \bigcirc$Example

Wtrans2d Output; /* optional Output of the module */
Fimage Image;    /* needed Input of the module: original image */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition */
  if(mw_alloc_biortho_wtrans2d(Output, 8, Image->nrow, Image->ncol)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  Output->images[0][0] = Image;
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_alloc_dyadic_wtrans2d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_dyadic_wtrans2d(wtrans,level,nrow,ncol)

Wtrans2d wtrans;

int level;

int nrow,ncol;




$ \bigcirc$Description


This function allocates the array images of a Wtrans2d structure previously created using mw_new_wtrans2d, in order to receive an dyadic wavelet representation (no spatial decimation, norient = 2). Each image images[l][r] for l = 1...nlevel, r = 0...norient is created and allocated to the right size. Previously allocations are deleted, if any.

The number of levels for the decomposition is given by level and the size of the original image is given by nrow (number of rows), ncol (number of columns).

The array images can be addressed after this call, if the allocation successed. There is no default values for the images. The type field of the Wtrans2d structure is set to mw_dyadic.

The function mw_alloc_dyadic_wtrans2d returns NULL if not enough memory is available to allocate one of the images. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans2d (see example below).




$ \bigcirc$Example

Wtrans2d Output; /* optional Output of the module */
Fimage Image;    /* needed Input of the module: original image */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition */
  if(mw_alloc_dyadic_wtrans2d(Output, 8, Image->nrow, Image->ncol)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  Output->images[0][0] = Image;
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_alloc_ortho_wtrans2d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_ortho_wtrans2d(wtrans,level,nrow,ncol)

Wtrans2d wtrans;

int level;

int nrow,ncol;




$ \bigcirc$Description


This function allocates the array images of a Wtrans2d structure previously created using mw_new_wtrans2d, in order to receive an orthonormal wavelet representation (spatial decimation, norient = 3). Each image images[l][r] for l = 1...nlevel, r = 0...norient is created and allocated to the right size. Previously allocations are deleted, if any.

The number of levels for the decomposition is given by level and the size of the original image is given by nrow (number of rows), ncol (number of columns).

The array images can be addressed after this call, if the allocation successed. There is no default values for the images. The type field of the Wtrans2d structure is set to mw_orthogonal.

The function mw_alloc_ortho_wtrans2d returns NULL if not enough memory is available to allocate one of the images. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans2d (see example below).




$ \bigcirc$Example

Wtrans2d Output; /* optional Output of the module */
Fimage Image;    /* needed Input of the module: original image */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition */
  if(mw_alloc_ortho_wtrans2d(Output, 8, Image->nrow, Image->ncol)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  Output->images[0][0] = Image;
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_delete_wtrans2d - Deallocate the wavelet transform space




$ \bigcirc$Summary


void mw_delete_wtrans2d(wtrans)

Wtrans2d wtrans;




$ \bigcirc$Description


This function deallocates the memory used by the wavelet transform space wtrans that is, all the memory used by the array of images images (if any), and the structure itself.

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




$ \bigcirc$Example

Wtrans2d wtrans=NULL; /* Internal use: no Input neither Output of module */

if  ( ((wtrans = mw_new_wtrans2d()) == NULL) ||  
       (mw_alloc_ortho_wtrans2d(wtrans, 6, 512, 512)==NULL) )
    mwerror(FATAL,1,"Not enough memory.\n");
.
.
.
mw_delete_wtrans2d(wtrans);
wtrans = NULL;

$ \bigcirc$Name


mw_new_wtrans2d - Create a new Wtrans2d




$ \bigcirc$Summary


Wtrans2d mw_new_wtrans2d();




$ \bigcirc$Description


This function creates a new Wtrans2d structure with empty array of images images. No image can be addressed at this time. The array of images should be allocated using one of the functions mw_alloc_X_wtrans2d where X depends of the type of the transformation.

You don't need this function for input/output of modules, since the MegaWave2 Compiler already created the structure for you if you need it (See Volume one: ``MegaWave2 User's Guide''). This function is used to create internal variables. Do not forget to deallocate the internal structures before the end of the module.

The function mw_new_wtrans2d 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.




$ \bigcirc$Example

Wtrans2d wtrans=NULL; /* Internal use: no Input neither Output of module */

if  ( ((wtrans = mw_new_wtrans2d()) == NULL) ||  
       (mw_alloc_dyadic_wtrans2d(wtrans, 6, 512, 512)) )
    mwerror(FATAL,1,"Not enough memory.\n");


next up previous contents index
Next: Geometrical structures : Point, Up: Two-dimensional wavelet Previous: Related file (external) types   Contents   Index
mw 2004-05-05