char * pcSource;
INT nIDSource;
is_AllocImageMem (hCam, 256, 256, 24, &pcSource, &nIDSource);
int nX, nY, nBits, nPitch;
is_InquireImageMem (hCam, pcSource, nIDSource, &nX ,&nY, &nBits,
&nPitch);
//Create RGB test image
for (int j = 0; j < nY; j++)
{
for (int i = 0; i < nX*3; i += 3)
{
pcSource[i + j*nPitch] = 0; // Blue pixels
pcSource[i + j*nPitch + 1] = i/3; // Green pixels
pcSource[i + j*nPitch + 2] = 255; // Red pixels
}
}
// Create memory for RGB histogram
DWORD bgrBuffer [256*3];
//Create pointer for each histogram colour
DWORD * pBlueHisto = bgrBuffer;
DWORD *pGreenHisto = bgrBuffer + 256;
DWORD * pRedHisto = bgrBuffer + 512;
//Retrieve histogram and release memory
is_GetImageHistogram (hCam, nIDSource, IS_SET_CM_RGB24, bgrBuffer);
is_FreeImageMem (hCam, pcSource, nIDSource);