LibraryLink`
LibraryLink`

MImage_getBitData (C Function)

gets an array of the data elements of an MImage of MImage_Type_Bit 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_Bit type.

Examples

Basic Examples  (1)

This iterates over the data elements of an MImage:

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