// Demonstrates how to print out every pixel
// in the entire image buffer.
#include <iostream.h>
#include "CController.h"
using namespace std;
using namespace arc;
CController cController;
try {
// .... open driver, initialize, etc ....
unsigned short *pBuf = ( unsigned short * )cController.mapFd;
if ( pBuf == NULL )
throw std::runtime_error( "Invalid image buffer ( NULL )!" );
long lPixelCount = cController.mapFdBytes / sizeof( unsigned short );
for ( int pix=0; pix<lPixelCount; pix++ )
{
cout << "pBuf[ " << pix << " ]: " << pBuf[ pix ] << endl;
}
// .... do something else ....
}
catch ( std::exception &e )
{
cerr << "Exception Occurred: " << e.what() << endl;
}
© Astronomical Research Cameras, Inc.