| 3 | |
| 4 | |
| 5 | To enable trace in an ossim application it is a simple matter of doing an ossim initialize. Code snip: |
| 6 | |
| 7 | {{{ |
| 8 | #include <ossim/init/ossimInit.h> |
| 9 | int main(int argc, char* argv[]) |
| 10 | { |
| 11 | // Adding the call to initialize will enable your application to use trace. |
| 12 | ossimInit::instance()->initialize(argc, argv); |
| 13 | |
| 14 | // the rest of your application main: |
| 15 | |
| 16 | return 0; |
| 17 | } |
| 18 | }}} |
| 19 | [[BR]] |
| 20 | To use trace in a trace enabled application use the -T option followed by some regular expression. [[BR]] |
| 21 | [[BR]] |
| 22 | Examples:[[BR]] |
| 23 | [[BR]] |
| 24 | // A call to image_info with no trace. The -d option is to tell image_info to do a "dump" on the file.[[BR]] |
| 25 | image_info -d image.tif[[BR]] |
| 26 | [[BR]] |
| 27 | //---[[BR]] |
| 28 | // This will turn trace on for anything that starts with "ossim". Note the '-T ossim' option is being used.[[BR]] |
| 29 | // Note: Since almost all classes in ossim start with "ossim" this will dump a LOT of stuff.[[BR]] |
| 30 | //---[[BR]] |
| 31 | image_info -d -T ossim image.tif[[BR]] |
| 32 | |
| 33 | // This will turn trace on for anything matching ossimTiffInfo.[[BR]] |
| 34 | image_info -d -T ossimTiffInfo image.tif[[BR]] |
| 35 | |
| 36 | // This will turn trace on for anything matching ossimTiffInfo.[[BR]] |
| 37 | image_info -d -T ossimTiffInfo image.tif[[BR]] |
| 38 | |
| 39 | //---[[BR]] |
| 40 | // The ossimTiffInfo class has two separate traces "ossimTiffInfo:debug" and "ossimTiffInfo:dump"[[BR]] |
| 41 | // This will turn on just "debug"[[BR]] |
| 42 | //---[[BR]] |
| 43 | image_info -d -T ossimTiffInfo:debug image.tif[[BR]] |
| 44 | [[BR]] |
| 45 | //---[[BR]] |
| 46 | // This will turn on trace for ossimTiffInfo AND ossimGeoTiff:[[BR]] |
| 47 | // Note: The OR bar '|' and also the regular expression is quoted. Also the -i and -p options[[BR]] |
| 48 | // were added so that the code would go into the ossimGeoTiff class for this example.[[BR]] |
| 49 | //---[[BR]] |
| 50 | image_info -i -p -d -T "ossimTiffInfo|ossimGeoTiff" image.tif[[BR]] |
| 51 | [[BR]] |
| 52 | //---[[BR]] |
| 53 | // This is a snip of a real image_info output turning trace on for ossimTiffInfo and ossimGeoTiff.[[BR]] |
| 54 | // Note: This is not the whole dump just pieces for demo purposes.[[BR]] |
| 55 | //---[[BR]] |
| 56 | [[BR]] |
| 57 | $ image_info -i -p -d -T "ossimTiffInfo|ossimGeoTiff" imagery_HH.tif[[BR]] |
| 58 | DEBUG ossimGeoTiff::ossimGeoTiff: Entered...[[BR]] |
| 59 | DEBUG ossimGeoTiff::ossimGeoTiff: OSSIM_ID = $Id: ossimGeoTiff.cpp 14039 2009-0[[BR]] |
| 60 | 2-26 23:35:49Z dburken $[[BR]] |
| 61 | DEBUG ossimGeoTiff::setOssimDatumName: theDatumName: WGE[[BR]] |
| 62 | Need to add double param support for projection = ossimEquDistCylProjection[[BR]] |
| 63 | ossimGeoTiff::print[[BR]] |
| 64 | theScale is empty...[[BR]] |
| 65 | ossimGeoTiff::addImageGeometry: Creating a bilinear projection[[BR]] |
| 66 | tiff.version: 42(classic)[[BR]] |
| 67 | tiff.byte_order: big_endian[[BR]] |
| 68 | system_byte_order: little_endian[[BR]] |
| 69 | DEBUG ossimTiffInfo::readTags: Offset to first ifd: 212115324[[BR]] |
| 70 | tiff.directory_offset: 212115324[[BR]] |
| 71 | DEBUG ossimTiffInfo::readTags:[[BR]] |
| 72 | ifd: 212115324[[BR]] |
| 73 | tags in directory: 20[[BR]] |
| 74 | DEBUG ossimTiffInfo::print DEBUG:[[BR]] |
| 75 | tag[0]:256[[BR]] |
| 76 | type: 3[[BR]] |
| 77 | count: 1[[BR]] |
| 78 | array size in bytes: 2[[BR]] |
| 79 | tiff.image0.image_width: 10507[[BR]] |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |