MImage_setBit


sets a single element of an MImage of MImage_Type_Bit type.

DetailsDetails

  • Used in C/C++ code in a library function called from Mathematica.
  • Uses the same numbering scheme as Mathematica parts, i.e. the first element is 1.
  • The array is assumed to have length at least equal to the rank of .
  • In 2D, the first two elements of are assumed to be .
  • In 3D, the first three elements of are assumed to be .
  • A nonzero error code value will be returned if the element does not exist or if is not an MImage of MImage_Type_Bit type.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

This sets the pixel at position 2,3 and channel 1 to be 1:

MImage I0;
mint pos[2];
int err;
...
pos[0] = 2;
pos[1] = 3;
err = libData->MImage_setBit(I0, pos, 1, 1);