Mat_Alloc

 

Create a new matrix composed of an array of pointers ("y" elements) to arrays of cells ("x" elements) of "dim" bytes.

 

 

Syntax

 

void ** Mat_Alloc(

          int x,

          int y,

          char dim

) ;

 

 

Parameters

 

x

number of columns.

 

y

number of rows.

 

dim

size of each cell in the matrix (in bytes).

 

 

 

Return value

 

This function return a pointer to the newly created matrix.

 

 

Remarks

 

 

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

 

Library:

          sliceO_Structures.lib

 

 

 

Example

 

// --- Create the new buffer ---

unsigned short **res = (unsigned short **) Mat_Alloc( frame->m_x, frame->m_y, sizeof(unsigned short) ) ;

if ( ! res ) {

    Error_Fct( hwnd, ERROR_CODE_TRACE_4, "Morpho_Image_Transfert_1: failed in Mat_Alloc()" ) ;

    return( NULL ) ;

}

 

See also