MImage_new3D (C Function)

is a library callback function that creates a new 3D image.


  • Used in C/C++ code in a library function called from the Wolfram Language.
  • A nonzero error code value will be returned if any of the specified arguments are invalid, or related arguments are not compatible, or if there is not sufficient memory.
  • Data type type can be one of the MImage_Type_Bit, MImage_Type_Byte, MImage_Type_Bit16, MImage_Type_Real32, or MImage_Type_Real.
  • Color space cs can be one of the MImage_CS_Gray, MImage_CS_RGB, MImage_CS_HSB, MImage_CS_CMYK, MImage_CS_XYZ, MImage_CS_LAB, MImage_CS_LCH, MImage_CS_LUV, or MImage_CS_Automatic.
  • Pixel values in the returned MImage are not initialized. Use MImage_setByte etc. to set the pixel values.


Basic Examples  (1)

This creates a 5×5×3 grayscale MImage:

MImage I;
imagedata_t type = MImage_Type_Byte;
colorspace_t cs = MImage_CS_Gray;
mint slices = 3, width = 5, height = 5, channels = 1;
int err;
err = libData->MImage_new3D(slices, width, height, channels, type, cs, FALSE, &I);