mapFd
Syntax
void *mapFd
Type
void pointer
Required Headers
CController.h
Namespace
arc
Remarks
This is an extremely important data member, as it's the only way for an application to access the image buffer.

The pointer to the kernel image buffer that is returned on a call to the MapDriver method. Although the user may cast the void pointer to any data type, the standard is to use unsigned short ( since the data is generally 16-bit ). See the example below.
Example
        // 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.