I think the simplest solutions is
1. When you make code interface node, configure the parameters as follows
Type: Numeric
Data type: 32-bit unsigned integer
Pass: “Value” not “Pointer to value”
2. When you create C code, the prototype would be like this. In this example, I use an input image, an output image and dimensions as parameters.
/* Call Library source file */
#include "extcode.h"
long threshold2(unsigned long inputPtr, unsigned long outputPtr, unsigned short xsize, unsigned short ysize);
long threshold2(unsigned long inputPtr, unsigned long outputPtr, unsigned short xsize, unsigned short ysize)
{
/* Insert code here */
}
Do not believe it! If you use 8-bit unsigned integer, rewrite “unsigned long inputPtr” to “unsigned char* inputPtr". As the same manner, if you want to manipulate 32-bit unsigned integer for multi-color image, rewrite to “unsigned long* inputPtr”.
3.Write any code in /* Insert code here */ section. I recommend you to write this simple code first. This code makes all the pixels to white. Be careful that a LabVIEW image has border pixels. You have to skip as needed.
int i;
for(i=0; i inputPtr[i]=255; /* *(inputPtr+i)=255; will work*/
}
I hope this information will help you.
Yutaka