Read
Reads the TIFF file image data.
Syntax
void* Read();
Parameters
None
Returns
void * - Pointer to the TIFF file image data. The user application should cast this pointer as an unsigned short ( 16-bit ).
Required Headers
CTiffFile.h
Namespace
arc
Throws
std::runtime_error
Remarks
This class only supports 16-bit image data.
Example
        // This code demonstrates how to read the image
        // data from a TIFF file and print it out.

        #include <iostream>
        #include "CTiffFile.h"

        using namespace std;
        using namespace arc;

        int main()
        {
            try {
                CTiffFile cTiff( "Image.tif", CTiffFile::READMODE );

                long lRows = cTiff.GetRows();
                long lCols = cTiff.GetCols();

                unsigned short *pBuf = ( unsigned short * )cTiff.Read();

                if ( pBuf != NULL )
                {
                    for ( long i=0; i<( lRows * lCols ); i++ )
                        cout << "pBuf[ " << i << " ]: " << pBuf[ i ] << endl;
                }
            }
            catch ( std::exception &e )
            {
                cerr << "Exception Occurred: " << e.what() << endl;
            }
            catch ( ... )
            {
                cerr << "System Exception Occurred!" << endl;
            }
        }

© Astronomical Research Cameras, Inc.