SliceO_Buffer::Matrix_New

 

This method create a data matrix of X*Y values.  Each value is dim bits.

 

 

Syntax

 

void ** Matrix_New(

          unsigned short x,

          unsigned short y,

          unsigned short dim

) ;

 

 

Parameters

 

x

          Number of columns in the matrix.

 

y

          Number of rows in the matrix.

 

dim

          Dimension of each element of the matrix (in bytes)

 

 

Return value

 

This method return a pointer to the newly created data matrix, or NULL if a problem occurred.

 

 

Remarks

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

SliceO_Buffer *buf_test = frame->User_Get( 165 ) ;

 

if ( buf_test ) {

 

          unsigned short x = 100 ;

          unsigned short Y = 100 ;

          unsigned short dim = 32 ;

 

          void ** mat = buf_test->Matrix_New( x, y, dim ) ;

 

          for ( int j=0; j < y; j++ )

                    for ( int i=0; i < y; i++ )

                              unsigned int val = ((unsigned int **) mat)[j][i] ;

}

 

See also