Exemple #1
0
bool buildChains(std::vector<ossimFilename>& fileList,
                 ossimConnectableObject::ConnectableObjectList& chains)
{
   bool result = true;
   chains.clear();

   for(ossim_int32 index = 0; index < (ossim_int32)fileList.size();++index)
   {
      ossimRefPtr<ossimImageSource> handler = ossimImageHandlerRegistry::instance()->open(fileList[index]);

      if(handler.valid())
      {
         ossimImageChain* imageChain = new ossimImageChain;
         imageChain->add(handler.get());
         chains.push_back(imageChain);
      }
      else
      {
         cerr << "Error: Unable to load image " << fileList[index] << endl;
         result = false;
      }
   }

   return result;
}