== Using trace in ossim for debugging: == To enable trace in an ossim application it is a simple matter of doing an ossim initialize. Code snip: {{{ #include int main(int argc, char* argv[]) { // Adding the call to initialize will enable your application to use trace. ossimInit::instance()->initialize(argc, argv); // the rest of your application main: return 0; } }}} [[BR]] To use trace in a trace enabled application use the -T option followed by some regular expression. [[BR]] [[BR]] Examples:[[BR]] [[BR]] // A call to image_info with no trace. The -d option is to tell image_info to do a "dump" on the file.[[BR]] image_info -d image.tif[[BR]] [[BR]] //---[[BR]] // This will turn trace on for anything that starts with "ossim". Note the '-T ossim' option is being used.[[BR]] // Note: Since almost all classes in ossim start with "ossim" this will dump a LOT of stuff.[[BR]] //---[[BR]] image_info -d -T ossim image.tif[[BR]] // This will turn trace on for anything matching ossimTiffInfo.[[BR]] image_info -d -T ossimTiffInfo image.tif[[BR]] // This will turn trace on for anything matching ossimTiffInfo.[[BR]] image_info -d -T ossimTiffInfo image.tif[[BR]] //---[[BR]] // The ossimTiffInfo class has two separate traces "ossimTiffInfo:debug" and "ossimTiffInfo:dump"[[BR]] // This will turn on just "debug"[[BR]] //---[[BR]] image_info -d -T ossimTiffInfo:debug image.tif[[BR]] [[BR]] //---[[BR]] // This will turn on trace for ossimTiffInfo AND ossimGeoTiff:[[BR]] // Note: The OR bar '|' and also the regular expression is quoted. Also the -i and -p options[[BR]] // were added so that the code would go into the ossimGeoTiff class for this example.[[BR]] //---[[BR]] image_info -i -p -d -T "ossimTiffInfo|ossimGeoTiff" image.tif[[BR]] [[BR]] //---[[BR]] // This is a snip of a real image_info output turning trace on for ossimTiffInfo and ossimGeoTiff.[[BR]] // Note: This is not the whole dump just pieces for demo purposes.[[BR]] //---[[BR]] [[BR]] $ image_info -i -p -d -T "ossimTiffInfo|ossimGeoTiff" imagery_HH.tif[[BR]] DEBUG ossimGeoTiff::ossimGeoTiff: Entered...[[BR]] DEBUG ossimGeoTiff::ossimGeoTiff: OSSIM_ID = $Id: ossimGeoTiff.cpp 14039 2009-0[[BR]] 2-26 23:35:49Z dburken $[[BR]] DEBUG ossimGeoTiff::setOssimDatumName: theDatumName: WGE[[BR]] Need to add double param support for projection = ossimEquDistCylProjection[[BR]] ossimGeoTiff::print[[BR]] theScale is empty...[[BR]] ossimGeoTiff::addImageGeometry: Creating a bilinear projection[[BR]] tiff.version: 42(classic)[[BR]] tiff.byte_order: big_endian[[BR]] system_byte_order: little_endian[[BR]] DEBUG ossimTiffInfo::readTags: Offset to first ifd: 212115324[[BR]] tiff.directory_offset: 212115324[[BR]] DEBUG ossimTiffInfo::readTags:[[BR]] ifd: 212115324[[BR]] tags in directory: 20[[BR]] DEBUG ossimTiffInfo::print DEBUG:[[BR]] tag[0]:256[[BR]] type: 3[[BR]] count: 1[[BR]] array size in bytes: 2[[BR]] tiff.image0.image_width: 10507[[BR]]