LibraryLink`
LibraryLink`

MImage_getRealData (C Function)

gets an array of the data elements of an MImage of MImage_Type_Real type.

Details

  • Used in C/C++ code in a library function called from the Wolfram Language.
  • The array has a length equal to the flattened length.
  • Will cause an error to be launched if the MImage is not of MImage_Type_Real type.

Examples

Basic Examples  (1)

This iterates over the data elements of an MImage:

MImage I0;
raw_t_real64* data;
mint i, len;
...
len = libData->MImage_getFlattenedLength(I0);
data = libData->MImage_getRealData(I0);
for (i = 0; i < len; i++) {
raw_t_real64 elem = data[i];
...
}