Пример #1
0
ossimDataObjectStatus ossimU11ImageData::validate() const
{
    if (m_dataBuffer.size() == 0)
    {
        setDataObjectStatus(OSSIM_NULL);
        return OSSIM_NULL;
    }

    ossim_uint32 count = 0;
    const ossim_uint32 SIZE = getSize();
    const ossim_uint32 BOUNDS = getSizePerBand();
    const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();

    for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
    {
        const ossim_uint16* p  = getUshortBuf(band);
        for (ossim_uint32 i=0; i<BOUNDS; ++i)
        {
            // check if the band is null
            if (p[i] != 0) ++count;
        }
    }

    if (!count)
        setDataObjectStatus(OSSIM_EMPTY);
    else if (count == SIZE)
        setDataObjectStatus(OSSIM_FULL);
    else
        setDataObjectStatus(OSSIM_PARTIAL);

    return getDataObjectStatus();
}
Пример #2
0
ossimDataObjectStatus ossimS16ImageData::validate() const
{
   if (getBuf() == NULL)
   {
      setDataObjectStatus(OSSIM_NULL);
      return OSSIM_NULL;
   }
   
   ossim_uint32 count = 0;
   const ossim_uint32 SIZE = getSize();
   const ossim_uint32 BOUNDS = getSizePerBand();
   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
   
   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
   {
      ossim_sint16 np = (ossim_sint16)m_nullPixelValue[band];
      const ossim_sint16* p  = getSshortBuf(band);
      for (ossim_uint32 i=0; i<BOUNDS; i++)
      {
         // check if the band is null
         if (p[i] != np) count++;         
      }
   }
   
   if (!count)
      setDataObjectStatus(OSSIM_EMPTY);
   else if (count == SIZE)
      setDataObjectStatus(OSSIM_FULL);
   else
      setDataObjectStatus(OSSIM_PARTIAL);

   return getDataObjectStatus();
}
void rspfRectilinearDataObject::initialize()
{
   if (m_dataBuffer.size() != getDataSizeInBytes())
   {
      m_dataBuffer.resize(getDataSizeInBytes());
      setDataObjectStatus(RSPF_STATUS_UNKNOWN);
   }
}
Пример #4
0
void ossimS16ImageData::fill(ossim_uint32 band, double value)
{
   void* s         = getBuf(band);

   if (s == NULL) return; // nothing to do...

   ossim_uint32 size_in_pixels = getSizePerBand();
   ossim_sint16* p = getSshortBuf(band);

   for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = (ossim_sint16)value;

   // Set the status to unknown since we don't know about the other bands.
   setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
}