• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ossimNotify函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ossimNotify函数的典型用法代码示例。如果您正苦于以下问题:C++ ossimNotify函数的具体用法?C++ ossimNotify怎么用?C++ ossimNotify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ossimNotify函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: png_get_sBIT

void ossimPngReader::setMaxPixelValue()
{
   ossim_uint32 band;
   m_maxPixelValue.resize(m_numberOfInputBands);
   for (band = 0; band < m_numberOfInputBands; ++band)
   {
      m_maxPixelValue[band] = 0.0;
   }
   
   if (png_get_valid(m_pngReadPtr, m_pngReadInfoPtr, PNG_INFO_sBIT ))
   {
      png_color_8p sig_bit;
      png_get_sBIT(m_pngReadPtr, m_pngReadInfoPtr, &sig_bit);
      if (traceDebug())
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "ossimPngReader::setMaxPixelValue DEBUG:"
            << "\nsig_bit->red:   " << int(sig_bit->red)
            << "\nsig_bit->green: " << int(sig_bit->green)
            << "\nsig_bit->blue:  " << int(sig_bit->blue)
            << "\nsig_bit->gray:  " << int(sig_bit->gray)            
            << "\nsig_bit->alpa:  " << int(sig_bit->alpha)
            << endl;
      }
      switch (m_pngColorType)
      {
         case PNG_COLOR_TYPE_RGB:           /* RGB */
            m_maxPixelValue[0] = pow(2.0, double(sig_bit->red))-1.0;
            m_maxPixelValue[1] = pow(2.0, double(sig_bit->green))-1.0;
            m_maxPixelValue[2] = pow(2.0, double(sig_bit->blue))-1.0;
            break;
         case PNG_COLOR_TYPE_RGB_ALPHA:     /* RGBA */
            m_maxPixelValue[0] = pow(2.0, double(sig_bit->red))-1.0;
            m_maxPixelValue[1] = pow(2.0, double(sig_bit->green))-1.0;
            m_maxPixelValue[2] = pow(2.0, double(sig_bit->blue))-1.0;
            m_maxPixelValue[3] = pow(2.0, double(sig_bit->alpha))-1.0;
            break;
         case PNG_COLOR_TYPE_GRAY:          /* Grayscale */
            m_maxPixelValue[0] = pow(2.0, double(sig_bit->gray))-1.0;
            break;
         case PNG_COLOR_TYPE_GRAY_ALPHA:    /* Grayscale + alpha */            
            m_maxPixelValue[0] = pow(2.0, double(sig_bit->gray))-1.0;
            m_maxPixelValue[1] = pow(2.0, double(sig_bit->alpha))-1.0;
            break;
         case PNG_COLOR_TYPE_PALETTE:       /* Indexed */
            m_maxPixelValue[0] = 255.0;
            m_maxPixelValue[1] = 255.0;
            m_maxPixelValue[2] = 255.0;
            break;
         default:                   /* Aie! Unknown type */
            break;
      }
   }

   // Sanity check.
   for (ossim_uint32 band = 0; band < m_numberOfInputBands; ++band)
   {
      if (m_maxPixelValue[band] == 0.0)
      {
         if (m_bitDepth <= 8)
         {
            m_maxPixelValue[band] = 255.0;
         }
         else
         {
            m_maxPixelValue[band] = 65535.0;
         }
      }
   }
}
开发者ID:Dukeke,项目名称:ossim,代码行数:70,代码来源:ossimPngReader.cpp


示例2: png_destroy_read_struct

void ossimPngReader::restart()
{
   if ( m_str )
   {
      // Destroy the existing memory associated with png structs.
      if (m_pngReadPtr && m_pngReadInfoPtr)
      {
         png_destroy_read_struct(&m_pngReadPtr, &m_pngReadInfoPtr, NULL);
      }

      m_pngReadPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
                                            NULL,
                                            NULL,
                                            NULL);
      m_pngReadInfoPtr = png_create_info_struct(m_pngReadPtr);

      if ( setjmp( png_jmpbuf(m_pngReadPtr) ) )
      {
         ossimNotify(ossimNotifyLevel_WARN)
            << "Error while reading.  File corrupted?  "
            << theImageFile
            << std::endl;
      
         return;
      }

      // Reset the file pointer.
      m_str->seekg( m_restartPosition, std::ios_base::beg );
   
      //---
      // Pass the static read method to libpng to allow us to use our
      // c++ stream instead of doing "png_init_io (pp, ...);" with
      // c stream.
      //---
      png_set_read_fn( m_pngReadPtr,
                       (png_voidp)m_str,
                       (png_rw_ptr)&ossimPngReader::pngReadData );

      //---
      // Note we won't do png_set_sig_bytes(png_ptr, 8) here because we are not
      // rechecking for png signature.
      //---
      png_read_info(m_pngReadPtr, m_pngReadInfoPtr);

      //---
      // If png_set_expand used:
      // Expand data to 24-bit RGB, or 8-bit grayscale,
      // with alpha if available.
      //---
      bool expandFlag = false;

      if ( m_pngColorType == PNG_COLOR_TYPE_PALETTE )
      {
         expandFlag = true;
      }
      if ( (m_pngColorType == PNG_COLOR_TYPE_GRAY) && (m_bitDepth < 8) )
      {
         expandFlag = true;
      }
      if ( png_get_valid(m_pngReadPtr, m_pngReadInfoPtr, PNG_INFO_tRNS) )
      {
         expandFlag = true;
      }

      //---
      // If png_set_packing used:
      // Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
      //---
      bool packingFlag = false;

      if ( (m_bitDepth < 8) && (m_pngColorType == PNG_COLOR_TYPE_GRAY) )
      {
         packingFlag = true;
      }

      if (expandFlag)
      {
         png_set_expand(m_pngReadPtr);
      }
      if (packingFlag)
      {
         png_set_packing(m_pngReadPtr);
      }

      // Gamma correction.
      //    ossim_float64 gamma;
      //    if (png_get_gAMA(m_pngReadPtr, m_pngReadInfoPtr, &gamma))
      //    {
      //       png_set_gamma(m_pngReadPtr, display_exponent, gamma);
      //    }

      //---
      // Turn on interlace handling... libpng returns just 1 (ie single pass)
      //  if the image is not interlaced
      //---
      png_set_interlace_handling (m_pngReadPtr);

      //---
      // Update the info structures after the transformations take effect
      //---
//.........这里部分代码省略.........
开发者ID:Dukeke,项目名称:ossim,代码行数:101,代码来源:ossimPngReader.cpp


示例3: ossimNotify

void ossimTiledElevationDatabase::mapRegion(const ossimGrect& region)
{
   static const char M[] = "ossimTiledElevationDatabase::mapRegion";
   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << M << " entered...\n" << "region: " << region << "\n";
   }
   
   if ( m_connectionString.size() )
   {
      // Put these outside the try block so we can delete if exception thrown.
      ossimFileWalker* fw = 0;
      ossimCallback2wRet<const ossimFilename&, bool&, bool>* cb = 0;

      // Wrap in try catch block as excptions can be thrown under the hood.
      try
      {
         m_requestedRect = region;
         
         ossimFilename f = m_connectionString;
         if ( f.exists() )
         {
            // Walk the directory
            fw = new ossimFileWalker();
            fw->initializeDefaultFilterList();
            cb = new ProcessFileCB(this, &ossimTiledElevationDatabase::processFile);
            fw->registerProcessFileCallback(cb);
            fw->walk(f);

            mapRegion();
         }
         else
         {
            ossimNotify(ossimNotifyLevel_WARN)
               << M << " ERROR: Connection string does not exists: "
               << m_connectionString.c_str()  << endl;
         }
      }
      catch (const ossimException& e)
      {
         ossimNotify(ossimNotifyLevel_WARN)
            << "Caught exception: " << e.what() << endl;
         m_entries.clear();
      }

      // cleanup:
      if ( fw )
      {
         delete fw;
         fw = 0;
      }
      if ( cb )
      {
         delete cb;
         cb = 0;
      }
   }

   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
   }
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:64,代码来源:ossimTiledElevationDatabase.cpp


示例4: ossimOrthoImageMosaic

void ossimTiledElevationDatabase::mapRegion()
{
   static const char M[] = "ossimTiledElevationDatabase::mapRegion";
   
   if ( m_entries.size() && ( m_requestedRect.isLonLatNan() == false ) )
   {
      ossimRefPtr<ossimOrthoImageMosaic> mosaic = new ossimOrthoImageMosaic();
      std::vector<ossimTiledElevationEntry>::iterator i = m_entries.begin();
      while ( i != m_entries.end() )
      {
         mosaic->connectMyInputTo( (*i).m_sic.get() );
         ++i;
      }

      // Compute the requested rectangle in view space.
      ossimRefPtr<ossimImageGeometry> geom = mosaic->getImageGeometry();
      if ( geom.valid() )
      {
         ossimDpt ulDpt;
         ossimDpt lrDpt;
         geom->worldToLocal(m_requestedRect.ul(), ulDpt);
         geom->worldToLocal(m_requestedRect.lr(), lrDpt);

         // Expand out to fall on even view coordinates.
         ulDpt.x = std::floor(ulDpt.x);
         ulDpt.y = std::floor(ulDpt.y);
         lrDpt.x = std::ceil(lrDpt.x);
         lrDpt.y = std::floor(lrDpt.y);

         // Get new(expanded) corners in ground space.
         ossimGpt ulGpt;
         ossimGpt lrGpt;
         geom->localToWorld(ulDpt, ulGpt);
         geom->localToWorld(lrDpt, lrGpt);
         theGroundRect = ossimGrect(ulGpt, lrGpt);
            
         // Expanded requested rect in view space.
         ossimIpt ulIpt = ulDpt;
         ossimIpt lrIpt = lrDpt;
         const ossimIrect VIEW_RECT(ulIpt, lrIpt);

         // Get the data.
         ossimRefPtr<ossimImageData> data = mosaic->getTile(VIEW_RECT, 0);
         if ( data.valid() )
         {
            // Initialize the grid:
            const ossimIpt SIZE( data->getWidth(), data->getHeight() );
            const ossimDpt ORIGIN(ulGpt.lon, lrGpt.lat); // SouthWest corner
            const ossimDpt SPACING( (lrGpt.lon-ulGpt.lon)/(SIZE.x-1),
                                    (ulGpt.lat-lrGpt.lat)/(SIZE.y-1) );
            if ( !m_grid ) m_grid = new ossimDblGrid();
            m_grid->initialize(SIZE, ORIGIN, SPACING, ossim::nan());

            if ( traceDebug() )
            {
               ossimNotify(ossimNotifyLevel_DEBUG)
                  << M
                  << "\nrequested view rect: " << VIEW_RECT
                  << "\nexpanded ground rect: " << theGroundRect
                  << "\norigin:  " << ORIGIN
                  << "\nsize:    " << SIZE
                  << "\nspacing: " << SPACING << std::endl;
            }

            // Fill the grid:
            switch( data->getScalarType() )
            {
               case OSSIM_SINT16:
               {
                  fillGrid(ossim_sint16(0), data);
                  break;
               }
               case OSSIM_SINT32:
               {
                  fillGrid(ossim_sint32(0), data);
                  break;
               }
               case OSSIM_FLOAT32:
               {
                  fillGrid(ossim_float32(0), data);
                  break;
               }
               case OSSIM_FLOAT64:
               {
                  fillGrid(ossim_float64(0), data);
                  break;
               }
               case OSSIM_UINT8:
               case OSSIM_SINT8:
               case OSSIM_USHORT11:
               case OSSIM_UINT16:
               case OSSIM_UINT32:
               case OSSIM_NORMALIZED_DOUBLE:
               case OSSIM_NORMALIZED_FLOAT:
               case OSSIM_SCALAR_UNKNOWN:
               default:
               {
                  std::string errMsg = M;
                  errMsg += " ERROR:\nUnhandled scalar type: ";
                  errMsg += data->getScalarTypeAsString().string();
//.........这里部分代码省略.........
开发者ID:loongfee,项目名称:ossim-svn,代码行数:101,代码来源:ossimTiledElevationDatabase.cpp


示例5: getNumberOfTiles

void ossimImageMpiSWriterSequenceConnection::slaveProcessTiles()
{
#ifdef OSSIM_HAS_MPI
#  if OSSIM_HAS_MPI
    ossimEndian endian;
    ossim_uint32 numberOfTiles    = getNumberOfTiles();
    long currentSendRequest = 0;
    long numberOfTilesSent  = 0;
    int errorValue= 0;
    MPI_Request *requests   = new MPI_Request[theNumberOfTilesToBuffer];
    for (int i = 0; i < theNumberOfTilesToBuffer; ++i)
    {
        requests[i] = MPI_REQUEST_NULL;
    }

    if(traceDebug())
    {
        ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): entering slave and will look at " << numberOfTiles << " tiles" << std::endl;
    }
    while(theCurrentTileNumber < numberOfTiles)
    {
        ossimRefPtr<ossimImageData> data = ossimImageSourceSequencer::getTile(theCurrentTileNumber);

        // if the current send requests have looped around
        // make sure we wait to see if it was sent
        //
        errorValue = MPI_Wait(&requests[currentSendRequest], MPI_STATUS_IGNORE);
        requests[currentSendRequest] = MPI_REQUEST_NULL;
        if(data.valid() &&
                (data->getDataObjectStatus()!=OSSIM_NULL)&&
                (data->getDataObjectStatus()!=OSSIM_EMPTY))
        {
            theOutputTile[currentSendRequest]->setImageRectangle(data->getImageRectangle());
            theOutputTile[currentSendRequest]->initialize();

            theOutputTile[currentSendRequest]->loadTile(data.get());
            theOutputTile[currentSendRequest]->setDataObjectStatus(data->getDataObjectStatus());

            if(traceDebug())
            {
                if(data->getDataObjectStatus() == OSSIM_EMPTY)
                {
                    ossimNotify(ossimNotifyLevel_DEBUG)
                            << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In salve = "
                            << theRank << " tile is empty" << std::endl;
                }
            }
        }
        else
        {
            if(traceDebug())
            {
                if(!data)
                {
                    ossimNotify(ossimNotifyLevel_DEBUG)
                            << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In slave = "
                            << theRank << " ptr is null " << std::endl;
                }
                else
                {
                    ossimNotify(ossimNotifyLevel_DEBUG)
                            << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In slave = " << theRank << " tile is empty" << std::endl;
                }
            }
            theOutputTile[currentSendRequest]->makeBlank();
        }

        void* buf = theOutputTile[currentSendRequest]->getBuf();
        if((endian.getSystemEndianType()!=OSSIM_BIG_ENDIAN)&&
                (theOutputTile[currentSendRequest]->getScalarType()!=OSSIM_UINT8))
        {
            endian.swap(theOutputTile[currentSendRequest]->getScalarType(),
                        buf,
                        theOutputTile[currentSendRequest]->getSize());
        }
        errorValue = MPI_Isend(buf,
                               theOutputTile[currentSendRequest]->getSizeInBytes(),
                               MPI_UNSIGNED_CHAR,
                               0,
                               0,
                               MPI_COMM_WORLD,
                               &requests[currentSendRequest]);
#if 0
        switch(theOutputTile[currentSendRequest]->getScalarType())
        {
        case OSSIM_UINT8:
        {
            errorValue = MPI_Isend(buf,
                                   theOutputTile[currentSendRequest]->getSize(),
                                   MPI_UNSIGNED_CHAR,
                                   0,
                                   0,
                                   MPI_COMM_WORLD,
                                   &requests[currentSendRequest]);
            break;
        }
        case OSSIM_SINT8:
        {
            errorValue = MPI_Isend(buf,
                                   theOutputTile[currentSendRequest]->getSize(),
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:star_ossim,代码行数:101,代码来源:ossimImageMpiSWriterSequenceConnection.cpp


示例6: sqlite3_prepare_v2

bool ossim_gpkg::getTableRows(
   sqlite3* db,
   const std::string& tableName,
   std::vector< ossimRefPtr<ossimGpkgDatabaseRecordBase> >& result )
{
   static const char M[] = "ossim_gpkg::getTableRows";

   bool status = false;
   
   if ( db && tableName.size() )
   {
      const char *zLeftover;      /* Tail of unprocessed SQL */
      sqlite3_stmt *pStmt = 0;    /* The current SQL statement */
      std::string sql = "SELECT * from ";
      sql += tableName;

      int rc = sqlite3_prepare_v2(db,           // Database handle
                                  sql.c_str(),  // SQL statement, UTF-8 encoded
                                  -1,           // Maximum length of zSql in bytes.
                                  &pStmt,       // OUT: Statement handle
                                  &zLeftover);  // OUT: Pointer to unused portion of zSql
      if ( rc == SQLITE_OK )
      {
         bool initStatus = true;
         
         int nCol = sqlite3_column_count( pStmt );
         if ( nCol )
         {
            while( 1 )
            {
               // Read the row:
               rc = sqlite3_step(pStmt);
               if ( rc == SQLITE_ROW )
               {
                  ossimRefPtr<ossimGpkgDatabaseRecordBase> row = getNewTableRecord( tableName );
                  if ( row.valid() )
                  {
                     if ( row->init( pStmt ) )
                     {
                        result.push_back(row);
                     }
                     else
                     {
                        ossimNotify(ossimNotifyLevel_WARN)
                           << M << " init failed!" << std::endl;
                        initStatus = false;
                        break;
                     }
                  }
                  else
                  {
                     ossimNotify(ossimNotifyLevel_WARN)
                        << M << " could not make object for table name: " << tableName
                        << std::endl;
                     initStatus = false;
                     break; 
                  }
               }
               else
               {
                  break;
               }
            }
         }
         if ( initStatus && result.size() )
         {
            status = true;
         }  
      }
      sqlite3_finalize(pStmt);
   }
   
   return status;
   
} // End: ossim_gpks::getTableRows(...)
开发者ID:bradh,项目名称:ossim-plugins,代码行数:75,代码来源:ossimGpkgUtil.cpp


示例7: while

void ossim_gpkg::getTileEntries( sqlite3* db, std::vector<ossimGpkgTileEntry>& entries )
{
   if ( db )
   {
      // Get all the tile matrix sets.  Each set can be concidered an entry.
      
      std::vector<ossimGpkgTileMatrixSetRecord> sets;
      ossim_gpkg::getGpkgRecords(
         db, sets, ossimGpkgTileMatrixSetRecord::getTableName() );

      if ( sets.size() )
      {
         // Get all the tile matrix rows.
         std::vector<ossimGpkgTileMatrixRecord> levels;
         ossim_gpkg::getGpkgRecords(
            db, levels, ossimGpkgTileMatrixRecord::getTableName() );

          // Get all the nsg tile matrix extent rows.
         std::vector<ossimGpkgNsgTileMatrixExtentRecord> extents;
         ossim_gpkg::getGpkgRecords(
            db, extents, ossimGpkgNsgTileMatrixExtentRecord::getTableName() );

         // Get all the srs rows.
         std::vector<ossimGpkgSpatialRefSysRecord> srs;
         ossim_gpkg::getGpkgRecords(
            db, srs, ossimGpkgSpatialRefSysRecord::getTableName() );

         // For each entry captue the tile matrix and srs that belong to entry.
         std::vector<ossimGpkgTileMatrixSetRecord>::const_iterator setIdx = sets.begin();
         while ( setIdx != sets.end() )
         {
            ossimGpkgTileEntry entry;
            entry.setTileMatrixSet(*setIdx);

            // Add tile matrix objects to entry if table_name matches.
            std::vector<ossimGpkgTileMatrixRecord>::const_iterator mIdx = levels.begin();
            while ( mIdx != levels.end() )
            {
               if ( entry.getTileMatrixSet().m_table_name == (*mIdx).m_table_name )
               {
                  // table_name matches...
                  entry.addTileMatrix( (*mIdx) );
               }
               ++mIdx;
            }

            // Add tile matrix extent objects to entry if table_name matches.
            std::vector<ossimGpkgNsgTileMatrixExtentRecord>::const_iterator extIdx = extents.begin();
            while ( extIdx != extents.end() )
            {
               if ( entry.getTileMatrixSet().m_table_name == (*extIdx).m_table_name )
               {
                  // table_name matches...
                  entry.addTileMatrixExtent( (*extIdx) );
               }
               ++extIdx;
            }

            std::vector<ossimGpkgSpatialRefSysRecord>::const_iterator srsIdx = srs.begin();
            while ( srsIdx != srs.end() )
            {
               if (entry.getTileMatrixSet().m_srs_id == (*srsIdx).m_srs_id)
               {
                  // srs id matches...
                  entry.setSrs( (*srsIdx) );
                  break;
               }
               ++srsIdx;
            }

            if ( entry.getTileMatrix().size() )
            {
               // The sort call puts the tile matrix entries in highest zoom to lowest order.
               entry.sortTileMatrix();
               entry.sortTileMatrixExtents();
               
               // Add the entry
               entries.push_back( entry );
            }
            else
            {
               ossimNotify(ossimNotifyLevel_WARN)
                  << "ossim_gpkg::getTileEntries WARNING No levels found for entry!"
                  << std::endl;
            }

            ++setIdx; // Next entry.
         }
      } 
      
   } // Matches: if ( sqlite3* db )
   
} // End: ossim_gpkg::getTileEntries( ... )
开发者ID:bradh,项目名称:ossim-plugins,代码行数:93,代码来源:ossimGpkgUtil.cpp


示例8: switch

int
ossimDDFSubfieldDefn::ExtractIntData( const char * pachSourceData,
                                 int nMaxBytes, int * pnConsumedBytes )

{
    switch( pszFormatString[0] )
    {
      case 'A':
      case 'I':
      case 'R':
      case 'S':
      case 'C':
        return atoi(ExtractStringData(pachSourceData, nMaxBytes,
                                      pnConsumedBytes));

      case 'B':
      case 'b':
      {
          unsigned char   abyData[8];

          if( nFormatWidth > nMaxBytes )
          {
              ossimNotify(ossimNotifyLevel_WARN)
                 << "Attempt to extract int subfield %s with format %s\n"
                 << "failed as only %d bytes available.  Using zero."
                 << pszName << pszFormatString << nMaxBytes << std::endl;
              return 0;
          }

          if( pnConsumedBytes != NULL )
              *pnConsumedBytes = nFormatWidth;

          // Byte swap the data if it isn't in machine native format.
          // In any event we copy it into our buffer to ensure it is
          // word aligned.
#ifdef CPL_LSB
          if( pszFormatString[0] == 'B' )
#else            
              if( pszFormatString[0] == 'b' )
#endif            
              {
                  for( int i = 0; i < nFormatWidth; i++ )
                      abyData[nFormatWidth-i-1] = pachSourceData[i];
              }
              else
              {
                  memcpy( abyData, pachSourceData, nFormatWidth );
              }

          // Interpret the bytes of data.
          switch( eBinaryFormat )
          {
            case UInt:
              if( nFormatWidth == 4 )
              {
                 ossim_uint32* ptr = (ossim_uint32*) abyData;
                 return *ptr;
              }
              else if( nFormatWidth == 1 )
              {
                 return( abyData[0] );
              }
              else if( nFormatWidth == 2 )
              {
                 ossim_uint16* ptr = (ossim_uint16*)abyData;
                 return *ptr;
              }
              else
              {
                 // CPLAssert( false );
                 return 0;
              }
              
             case SInt:
                if( nFormatWidth == 4 )
                {
                   ossim_int32* ptr = (ossim_int32 *) abyData;
                   return *ptr;
                }
                else if( nFormatWidth == 1 )
                {
                   signed char* ptr = (signed char *) abyData;
                   return *ptr;
                }
                else if( nFormatWidth == 2 )
                {
                   ossim_int16* ptr = (ossim_int16 *) abyData;
                   return *ptr;
                }
                else
                {
                   // CPLAssert( false );
                   return 0;
                }
                
             case FloatReal:
                if( nFormatWidth == 4 )
                {
                   float* ptr = (float *) abyData;
                   return (int) *ptr;
//.........这里部分代码省略.........
开发者ID:loongfee,项目名称:ossim-svn,代码行数:101,代码来源:ossimDdfsubfielddefn.cpp


示例9: ossimNotify

bool ossimHdfReader::open()
{
   static const char MODULE[] = "ossimHdfReader::open";

   if (traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << MODULE << " entered...\n"
         << "image: " << theImageFile << "\n";
   }

   bool result = false;

   if (!isSupportedExtension())
   {
      return false;
   }

   if (m_entryFileList.size() == 0)
   {
      if(isOpen())
      {
         close();
      }

      m_gdalTileSource = new ossimGdalTileSource;
      m_gdalTileSource->setFilename(theImageFile);

      if ( m_gdalTileSource->open() == false )
      {
         m_gdalTileSource = 0;
         return false;
      }

      std::vector<ossimString> entryStringList;
      if (m_gdalTileSource != 0)
      {
         m_gdalTileSource->getEntryNames(entryStringList);
      }
      
      // bool isSwathImage = false;
      if (entryStringList.size() > 0)
      {
         for (ossim_uint32 i = 0; i < entryStringList.size(); i++)
         {
            m_entryFileList.push_back(i);
         }
      }
      else
      {
        result = false;
      }
   }
      
   //set entry id for the gdal tile source
   if (m_currentEntryRender < m_entryFileList.size())
   {
      
      m_gdalTileSource->setCurrentEntry(m_currentEntryRender);
      m_numberOfBands = m_gdalTileSource->getNumberOfInputBands();

      m_tile = ossimImageDataFactory::instance()->create(this, this);
      m_tile->initialize();
      
      completeOpen();
      result = true;
   }
   else
   {
      result = false;
   }
   
   if (result == false)
   {
      close();
   }
   
   if (traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << MODULE << " exit status = " << (result?"true":"false\n")
         << std::endl;
   }
   
   return result;
}
开发者ID:bradh,项目名称:ossim-plugins,代码行数:86,代码来源:ossimHdfReader.cpp


示例10: free

int ossimDDFSubfieldDefn::SetFormat( const char * pszFormat )

{
    free( pszFormatString );
    pszFormatString = strdup( pszFormat );

/* -------------------------------------------------------------------- */
/*      These values will likely be used.                               */
/* -------------------------------------------------------------------- */
    if( pszFormatString[1] == '(' )
    {
        nFormatWidth = atoi(pszFormatString+2);
        bIsVariable = nFormatWidth == 0;
    }
    else
        bIsVariable = true;
    
/* -------------------------------------------------------------------- */
/*      Interpret the format string.                                    */
/* -------------------------------------------------------------------- */
    switch( pszFormatString[0] )
    {
      case 'A':
      case 'C':         // It isn't clear to me how this is different than 'A'
        eType = DDFString;
        break;

      case 'R':
        eType = DDFFloat;
        break;
        
      case 'I':
      case 'S':
        eType = DDFInt;
        break;

      case 'B':
      case 'b':
        // Is the width expressed in bits? (is it a bitstring)
        bIsVariable = false;
        if( pszFormatString[1] == '(' )
        {
           // CPLAssert( atoi(pszFormatString+2) % 8 == 0 );
            
            nFormatWidth = atoi(pszFormatString+2) / 8;
            eBinaryFormat = SInt; // good default, works for SDTS.

            if( nFormatWidth < 5 )
                eType = DDFInt;
            else
                eType = DDFBinaryString;
        }
        
        // or do we have a binary type indicator? (is it binary)
        else
        {
            eBinaryFormat = (DDFBinaryFormat) (pszFormatString[1] - '0');
            nFormatWidth = atoi(pszFormatString+2);

            if( eBinaryFormat == SInt || eBinaryFormat == UInt )
                eType = DDFInt;
            else
                eType = DDFFloat;
        }
        break;

      case 'X':
        // 'X' is extra space, and shouldn't be directly assigned to a
        // subfield ... I haven't encountered it in use yet though.
        ossimNotify(ossimNotifyLevel_WARN)
           << "Format type of `%c' not supported.\n"
           << pszFormatString[0] << std::endl;
        
        // CPLAssert( false );
        return false;
        
      default:
        ossimNotify(ossimNotifyLevel_WARN)
           << "Format type of `%c' not recognised.\n"
           << pszFormatString[0] << std::endl;
        
        // CPLAssert( false );
        return false;
    }
    
    return true;
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:87,代码来源:ossimDdfsubfielddefn.cpp


示例11: ossimNotify

bool ossimNdfTileSource::open()
{
   // Ensure header file exists
   if(!theHeaderFile.exists())
   {
      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
      if ( traceDebug() )
      {
         ossimNotify(ossimNotifyLevel_WARN)
            << "ERROR: Missing Header File ("
            << theHeaderFile << ")" << std::endl;
      }
      return false;
   }

   try
   {
      // Validate Header to ensure we support this data type
      ossimNdfHeader lnh(theHeaderFile);
      if(lnh.getErrorStatus())
      {
         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
         return false;
      }

      // Use General Raster classes to build NLAPS imagery
      ossimGeneralRasterInfo generalRasterInfo;
      if(lnh.getNumOfBands() == 1)
      {
         generalRasterInfo = ossimGeneralRasterInfo(lnh.getImageFileList(),
                                                    OSSIM_UINT8,
                                                    OSSIM_BSQ,
                                                    lnh.getNumOfBands(),
                                                    lnh.getLines(),
                                                    lnh.getSamples(),
                                                    0,
                                                    ossimGeneralRasterInfo::NONE,
                                                    0);
      }
      else
      {
         generalRasterInfo = ossimGeneralRasterInfo(lnh.getImageFileList(),
                                                    OSSIM_UINT8,
                                                    OSSIM_BSQ_MULTI_FILE,
                                                    lnh.getNumOfBands(),
                                                    lnh.getLines(),
                                                    lnh.getSamples(),
                                                    0,
                                                    ossimGeneralRasterInfo::NONE,
                                                    0);
      }
      
      theMetaData.clear();
      theMetaData.setScalarType(OSSIM_UINT8);
      theMetaData.setNumberOfBands(lnh.getNumOfBands());
      m_rasterInfo = generalRasterInfo;
      
      if(initializeHandler())
      {
         completeOpen();
      }
      else
      {
         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
         return false;
      }  
   }
   catch (const ossimException& e)
   {
      if ( traceDebug() )
      {
         ossimNotify(ossimNotifyLevel_WARN)
            << "ossimNdfTileSource::open caught exception:\n"
            << e.what() << std::endl;
      }
      return false;
   }
   
   return true;
}
开发者ID:ICODE-MDA,项目名称:AutomatedSARShipDetection,代码行数:80,代码来源:ossimNdfTileSource.cpp


示例12: main

int main(int argc, char* argv[])
{
    static const char MODULE[] = "icp:main";
    std::string tempString;
    ossimArgumentParser::ossimParameter stringParam(tempString);

    ossimArgumentParser ap(&argc, argv);
    ossimInit::instance()->addOptions(ap);
    ossimInit::instance()->initialize(ap);

    ossimApplicationUsage* au = ap.getApplicationUsage();

    au->setApplicationName(ap.getApplicationName());
    au->setDescription(ap.getApplicationName()+
                       " copies any supported input image format to any supported output image format format");
    au->setCommandLineUsage(ap.getApplicationName()+
                            " [options] <output_type> <input_file> <output_file>");
    au->addCommandLineOption("-h or --help",
                             "Display this information");
    au->addCommandLineOption("-a or --use-scalar-remapper",
                             "Uses scalar remapper, transforms to 8-bit");
    au->addCommandLineOption("-o or --create-overview",
                             "Creates and overview for the output image");
    au->addCommandLineOption("-b or --bands <n,n...>",
                             "uses the specified bands: ex. \"1, 2, 4\" will select bands 1 2 and 4 of the input image.  "
                             "Note: it is 1 based");
    au->addCommandLineOption("-c or --compression-type <type>",
                             "Uses compression.  Currently valid for only tiff output -c jpeg will use jpeg compression");
    au->addCommandLineOption("-e or --entry <n>",
                             "For multi image handlers which entry do you wish to extract");
    au->addCommandLineOption("-g", "Convert to grey scale.");
    au->addCommandLineOption("-q or --compression-quality <n>",
                             "Uses compression.  Valid for jpeg type. default is 75 where 100 is best and 1 is worst");
    au->addCommandLineOption("--pixel-type <type>",
                             "Valid values: area or point, this will determine if the tie point is upper left corner of "
                             "the upper left pixel (area) or the center of the upper left corner (point), default=point. "
                             "NOTE: This option will only affect the tiff writer.");
    au->addCommandLineOption("-r or --res-level <n>",
                             "Which res level to extract from the input: ex -r 1 will get res level 1");
    au->addCommandLineOption("-l or --start-line <n>",
                             "Which start line do you wish to copy from the input. If none is given then 0 is used");
    au->addCommandLineOption("-L or --end-line <n>",
                             "Which end line do you wish to copy from the input.  If none is given then max line is used");
    au->addCommandLineOption("-s or --start-sample <n>",
                             "Which start sample do you wish to copy from the input.  If none is given then 0 is used");
    au->addCommandLineOption("-p or --end-sample <n>",
                             "The end sample you wish to copy from the input. If none is given then max sample is used");
    au->addCommandLineOption("-t or --create-thumbnail <n>",
                             "Takes an argument which is the maximum pixel dimension desired.");
    au->addCommandLineOption("-w or --tile-width <n>",
                             "Defines the tile width for the handlers that support tiled output");

    au->addCommandLineOption("--reader-prop <string>",
                             "Adds a property to send to the reader. format is name=value");

    au->addCommandLineOption("--writer-prop <string>",
                             "Adds a property to send to the writer. format is name=value");

    au->addCommandLineOption("--filter-spec <fname>",
                             "This is an external file spec that describes a chain for filtering the input image.");
    au->addCommandLineOption("--use-mask [<fname>]",
                             "Optionally specify name of mask file to use for masking the input image. If no filename "
                             "given, then the default mask filename is used.");


    if (traceDebug()) CLOG << " Entered..." << std::endl;

    // Keyword list to initialize image writers with.
    ossimKeywordlist kwl;
    const char* PREFIX = "imagewriter.";

    bool        lineEndIsSpecified       = false;
    bool        sampEndIsSpecified       = false;
    bool        lineStartIsSpecified     = false;
    bool        sampStartIsSpecified     = false;
    bool        convert_to_greyscale     = false;
    bool        create_overview          = false;
    bool        create_thumbnail         = false;
    bool        use_band_selector        = false;
    bool        use_scalar_remapper      = false;
    bool        use_mask                 = false;
    ossim_int32 tile_width               = 0;
    ossim_int32 max_thumbnail_dimension  = 0;
    ossim_int32 rr_level                 = 0;
    ossim_int32 line_start               = 0;
    ossim_int32 line_stop                = 0;
    ossim_int32 sample_start             = 0;
    ossim_int32 sample_stop              = 0;
    ossim_int32 cibcadrg_entry           = 0;
    vector<ossimString> band_list(0);
    ossimFilename filterSpec, maskFile;
    std::map<ossimString, ossimString, ossimStringLtstr> readerPropertyMap;
    std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;

    if (ap.read("-h") ||
            ap.read("--help")||(ap.argc() < 2))
    {
        au->write(ossimNotify(ossimNotifyLevel_NOTICE));
        usage(); // for writer output types
        finalize(0);
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:star_ossim,代码行数:101,代码来源:ossim-icp.cpp


示例13: main

int main(int argc, char* argv[])
{
   
#ifdef OSSIM_HAS_MPI
#  if OSSIM_HAS_MPI
   ossimMpi::instance()->initialize(&argc, &argv);
   if (ossimMpi::instance()->getRank() == 0)
   {
      ossimNotify(ossimNotifyLevel_INFO)
         << "MPI running with "
         << ossimMpi::instance()->getNumberOfProcessors()
         << " processors..." << std::endl;
   }
#  endif
#endif
   
   std::string tempString;
   ossimArgumentParser::ossimParameter stringParam(tempString);
   ossimArgumentParser argumentParser(&argc, argv);
   ossimInit::instance()->addOptions(argumentParser);
   ossimInit::instance()->initialize(argumentParser);
   
   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" flips any null pixels to a valid pixel");
   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <output_type> <input_file> <output_file> <target_value> <replacement_value>");
   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overview", "Creates and overview for the output image");
   argumentParser.getApplicationUsage()->addCommandLineOption("-c or --clamp-value", "clamp values (any pixel with value larger than input will be clamped to input)");
   argumentParser.getApplicationUsage()->addCommandLineOption("-m",  "Replacement mode (see notes below)");
   argumentParser.getApplicationUsage()->addCommandLineOption("-w",  "output tile width(only valid with tiled output types).  Must be a multiply of 16");
   
 
   static const char MODULE[] = "pixelflip:main";
   if (traceDebug()) CLOG << " Entered..." << std::endl;
   ossimInit::instance()->initialize(argc, argv);
   // Keyword list to initialize image writers with.
   ossimKeywordlist kwl;
   const char* PREFIX = "imagewriter.";
   bool create_overview = false;
   ossim_int32 tile_width = 0;
   double clamp_value = 0.0;
   bool do_clamp = false;
   ossimPixelFlipper::ReplacementMode replacement_mode =
      ossimPixelFlipper::REPLACE_BAND_IF_TARGET;


   if(argumentParser.read("-h") || argumentParser.read("--help")||(argumentParser.argc() == 1))
   {
      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
      usage();
      exit(0);
   }
   while(argumentParser.read("-o") || argumentParser.read("--create-overview"))
   {
      create_overview = true;
   }
   while(argumentParser.read("-c", stringParam))
   {
      clamp_value = ossimString(tempString).toDouble();
      do_clamp = true;
   }
   while(argumentParser.read("-m", stringParam))
   {
      ossimString mode = tempString;
      mode.downcase();
      if (mode == "replace_band_if_target")
      {
         replacement_mode = ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
      }
      else if (mode == "replace_band_if_partial_target")
      {
         replacement_mode =
            ossimPixelFlipper::REPLACE_BAND_IF_PARTIAL_TARGET;
      }
      else if (mode == "replace_all_bands_if_partial_target")
      {
         replacement_mode = ossimPixelFlipper::REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
      }
      else if (mode != "replace_all_targets")
      {
         ossimNotify(ossimNotifyLevel_WARN)
            << "Invalid mode:  "
            << mode
            << "\nMode remains:  replace_band_if_target"
            << std::endl;
      }
   }
   while(argumentParser.read("-w", stringParam))
   {
      tile_width = ossimString(tempString).toInt32();
      if (tile_width % 16)
      {
         ossimNotify(ossimNotifyLevel_WARN)
            << MODULE
            << " NOTICE:"
            << "\nTile width must be a multiple of 16!"
            << "\nDefaulting to 128"
            << std::endl;
         tile_width = 0;
      }
//.........这里部分代码省略.........
开发者ID:BJangeofan,项目名称:ossim,代码行数:101,代码来源:ossim-pixelflip.cpp


示例14: main

int main(int argc, char* argv[])
{
   ossimString tempString1;
   ossimString tempString2;
   ossimString tempString3;
   ossimString tempString4;
   ossimArgumentParser::ossimParameter tempParam1(tempString1);
   ossimArgumentParser::ossimParameter tempParam2(tempString2);
   ossimArgumentParser::ossimParameter tempParam3(tempString3);
   ossimArgumentParser::ossimParameter tempParam4(tempString4);
   ossimArgumentParser argumentParser(&argc, argv);
   ossimInit::instance()->addOptions(argumentParser);
   ossimInit::instance()->initialize(argumentParser);
   bool rpcFlag       = false;
   bool cgFlag       = false;
   bool enableElevFlag = true;
   bool enableAdjustmentFlag = true;
   ossimDrect imageRect;
   double error = .1;

   imageRect.makeNan();
   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
   
   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName() + " takes an input geometry (or image) and creates a converted output geometry");
   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName() + " [options] <input file>");
   argumentParser.getApplicationUsage()->addCommandLineOption(&qu 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ossimString函数代码示例发布时间:2022-05-30
下一篇:
C++ oss函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap