void ProcessImage (RGBTRIPLE *pImage) // pass a pointer to a bitmap
{
uint8_t *ptrPixel;
int ImageSizeX = 1400; // default to color camera
int ImageSizeY = 980; // ditto
int PixSize= 3; // ditto
if (ImageIsMono) // change settings for grayscale camera
{
PixSize = 1;
ImageSizeX = 2040;
ImageSizeY = 1080;
}
// Examine every pixel in the image
for (int y=0; y<ImageSizeY; y++)
{
for (int x=0; x<ImageSizeX; x++)
{
ptrPixel = (uint8_t *) pImage;
ptrPixel = ptrPixel + ((x + (y * ImageSizeX)) * PixSize);
// pointer is now pointing at a pixel in the image.
// If grayscale image then pointing at one byte grayscale data
// If color image then it is pointing at the first color
// of the RGB triple. The other two color bytes will be right next door
// do something with pixel (Image Processing)
}
}
}