The software application interface ( ARC_API ) consists of a set of C++ libraries ( .dll, .so ) that perform all camera, deinterlacing, and FITS file operations. In addition, the API contains libraries for image display ( when available ), calculating image statistics, and TIFF file operations. These libraries are the same libraries used by the Owl image aquisition program.
CController : All driver/PCI/controller communications CDeinterlace : Deinterlace image data CFitsFile : Create/Edit FITS files CTiffFile : Create/Edit TIFF files CDisplay : Display image data or FITS files in SAOImage DS9 CImage : Calculate basic image statistics CXLBuffer : Provides data type for single images > 4200x4200 pixels
NOTE: The CameraAPI library is the interface between Owl's java code and the API libraries. This library uses the java native interface (JNI) and should never be used in user applications.
Namespaces
Back To Main
Namespaces allow the grouping of classes, objects, functions, and variables under
a single name. Grouping entities this way prevents conflicts ( redefinition errors )
between entities with the same name in different or the same library. An entity
within a namespace can be accessed by prefixing it with the namespace name followed
by two colons. For example, [name]::[entity]. Namespaces can also be used globally
by including the following statement at the top of the source file:
using namespace [name].
The ARC API libraries are all contained within the arc namespace. Not using the namespace will result in compiler errors.
Exceptions
Back To Main
Nearly every method within all API libraries throw exceptions when an error occurs.
The way to catch an exception ( error ) is with a try/catch block, which can be
placed around any piece of code. Note that any variables declared within the
try/catch block are only accessible from within that block. To make a variable
visible in and out of a try/catch block, declare the variable outside the try/catch
block. A try/catch block has the following syntax:
try {
... your code here ...
}
catch ( std::exception e ) { ... your code here ... }
All API libraries throw the std::runtime_error exception. Other std class exceptions may also be thrown, so it's best to catch all subclasses using the std::exception base class.
Compiling
Back To Main
To compile one or more of the ARC_API libraries with your application you will
need to include the supplied static libraries ( .lib ). The only ARC_API
libraries that require additional libraries to be included at compile time are
CFitsFile and CTiffFile, as they use the third party libraries cfitsio and
libtiff respectively.
Compiling with CFitsFile?
Include CFitsFile.h and compile with both CFitsFile.lib and cfitsio.lib
Compiling with CTiffFile?
Include CTiffFile and compile with both CTiffFile.lib and libtiff.lib
Compiling CController, CDeinterlace, CDisplay, CImage, or CXLBuffer?
Include respective header file and compile with respective .lib file.
For example, include CController.h and compile with CController.lib when
using the CController library.
Example: Compiling on Linux or Solaris
g++ -o myapp -I /ARC_API/CController -L /ARC_API/CController/solaris myapp.cpp -lCController