コード例 #1
0
ossimRefPtr<ossimImageGeometry> ossimNdfTileSource::getImageGeometry()
{
   if ( !theGeometry )
   {
      // Check for external geom:
      theGeometry = getExternalImageGeometry();
      
      if ( !theGeometry )
      {
         theGeometry = new ossimImageGeometry();
         
         // Validate Header to ensure we support this data type
         ossimNdfHeader lnh(theHeaderFile);
         if(lnh.getErrorStatus() == ossimErrorCodes::OSSIM_OK)
         {
            // Get the projection info.
            ossimKeywordlist kwl;
            kwl.add(lnh.getGeom());
            
            // Create the projection.
            ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->
               createProjection(kwl);
            
            if ( proj.valid() )
            {
               // Assign projection to our ossimImageGeometry object.
               theGeometry->setProjection( proj.get() );
            }
         }
         
         // At this point it is assured theGeometry is set.

         //---
         // WARNING:
         // Must create/set theGeometry at this point or the next call to
         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
         //---         
         
         // Check for set projection.
         if ( !theGeometry->getProjection() )
         {
            // Try factories for projection.
            ossimImageGeometryRegistry::instance()->extendGeometry(this);
         }
      }
      
      // Set image things the geometry object should know about.
      initImageParameters( theGeometry.get() );
   }
   
   return theGeometry;
}
コード例 #2
0
ファイル: menu.c プロジェクト: chaoskagami/corbenik
};

static struct options_s config_opts[] = {
    { "Options",
      "Internal options for the CFW.\nThese are part of " FW_NAME " itself.",
      option, options, (void(*)(void*))show_menu, NULL, 0, 0 },
    { "Patches",
      "External bytecode patches found in `" PATH_PATCHES "` and `" PATH_AUX_PATCHES "` .\nYou can choose which to enable.",
      option, NULL, (void(*)(void*))show_menu, NULL, 0, 0 },

    // Sentinel.
    { NULL, NULL, 0, 0, NULL, NULL, 0, 0 }, // cursor_min and cursor_max are stored in the last two.
};

static struct options_s help_d[] = {
    lnh("About"),
    ln("  This is another 3DS CFW for power users."),
    ln("  It seeks to address some faults in other"),
    ln("  CFWs and is generally just another choice"),
    ln("  for users - but primarily is intended for"),
    ln("  developers. It is not for the faint of heart."),
    ln(""),
    lnh("Usage"),
    ln("  A         -> Select/Toggle/Increment"),
    ln("  B         -> Back/Boot"),
    ln("  X         -> Decrement"),
    ln("  Select    -> Help/Information"),
    ln("  Down      -> Down"),
    ln("  Right     -> Down five"),
    ln("  Up        -> Up"),
    ln("  Left      -> Up five"),
コード例 #3
0
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;
}
コード例 #4
0
bool ossimNdfTileSource::loadState(const ossimKeywordlist& kwl,
                                   const char* prefix)
{
   const char* lookup = kwl.find(prefix, "header_filename");
   if (lookup)
   {
      theHeaderFile = lookup;
      return ossimGeneralRasterTileSource::loadState(kwl, prefix);
   }

   theErrorStatus = ossimErrorCodes::OSSIM_ERROR;

   return false;

#if 0
   if(lookup)
   {
      // Validate Header to ensure we support this data type
      ossimNdfHeader lnh(lookup);
      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);
      }
      
      return open(generalRasterInfo);   
   }
   else
   {
      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
      return false;
   }
#endif
}