// Demonstrates how to print out every pixel
// in a 512x600 pixel image ( that is currently
// in the kernel 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 )!" );
for ( int row=0; row<512; row++ )
{
for ( int col=0; col<600; col++ )
{
cout << "pBuf[ "
<< ( col + row * 600 )
<< " ]: "
<< pBuf[ ( col + row * 600 ) ]
<< endl;
}
}
// .... do something else ....
}
catch ( std::exception &e )
{
cerr << "Exception Occurred: " << e.what() << endl;
}
© Astronomical Research Cameras, Inc.