Exemple #1
0
void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih)
{
   static const char M[] = "ossimImageUtil::createHistogram #1";
   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
   }
   
   if ( ih.valid() )
   {
      // Get the entry list:
      std::vector<ossim_uint32> entryList;
      ih->getEntryList(entryList);
      
      bool useEntryIndex = false;
      if ( entryList.size() )
      {
         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
      }

      for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
      {
         createHistogram(ih, entryList[idx], useEntryIndex);
      }
   }

   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
   }
}
Exemple #2
0
// Create overview for image:
void ossimImageUtil::createOverview(ossimRefPtr<ossimImageHandler>& ih,
                                    bool& consumedHistogramOptions,
                                    bool& /* consumedCmmOptions */)
{
   static const char M[] = "ossimImageUtil::createOverview #1";
   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
   }
    
   if ( ih.valid() )
   {
      // Get the entry list:
      std::vector<ossim_uint32> entryList;
      ih->getEntryList(entryList);
      
      bool useEntryIndex = false;
      if ( entryList.size() )
      {
         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
      }

      // Create the overview builder:
      ossimString overviewType;
      getOverviewType( overviewType.string() );
      ossimRefPtr<ossimOverviewBuilderBase> ob =
         ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(overviewType);
      if ( ob.valid() )
      {
         // Set up any overview builder options that don't involve histograms.
         ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>( ob.get() );
         if ( pi ) setProps(pi);
         
         ossim_uint32 stopDimension = getOverviewStopDimension();
         if ( stopDimension ) ob->setOverviewStopDimension(stopDimension);

         ob->setScanForMinMax( scanForMinMax() );
         
         ob->setScanForMinMaxNull( scanForMinMaxNull() );
         
         for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
         {
            createOverview(ih, ob, entryList[idx], useEntryIndex, consumedHistogramOptions);
         }
      }
      else
      {
        ossimNotify(ossimNotifyLevel_WARN)
           << "ERROR:\nCould not create builder for:  "<< overviewType << std::endl;
        outputOverviewWriterTypes();
      }
   }

   if(traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
   }
}