示例#1
0
void ossimLasReader::setProperty(ossimRefPtr<ossimProperty> property)
{
   if ( property.valid() )
   {
      if ( property->getName() == SCALE_KW )
      {
         ossimString s;
         property->valueToString(s);
         ossim_float64 d = s.toFloat64();
         if ( ossim::isnan(d) == false )
         {
            setScale( d );
         }
      }
      else if ( property->getName() == SCAN_KW )
      {
         ossimString s;
         property->valueToString(s);
         m_scan = s.toBool();
      }
      else
      {
         ossimImageHandler::setProperty(property);
      }
   }
}
示例#2
0
void ossimNitfFileHeaderV2_0::setProperty(ossimRefPtr<ossimProperty> property)
{
   const ossimString& name = property->getName();
   if(name == CLEVEL_KW)
   {
      setComplianceLevel(property->valueToString());
   }
   else if(name == FSDWNG_KW)
   {
      setSecurityDowngrade(property->valueToString());
   }
   else if(name == FSDEVT_KW)
   {
      setDowngradingEvent(property->valueToString());
   }
   else if(name == ONAME_KW)
   {
      setOriginatorsName(property->valueToString());
   }
   else if(name == OPHONE_KW)
   {
      setOriginatorsPhone(property->valueToString());
   }
   else
   {
      ossimNitfFileHeaderV2_X::setProperty(property);
   }
}
void ossimImageToPlaneNormalFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   ossimString name = property->getName();
   if(name == "smoothnessFactor")
   {
      theSmoothnessFactor = property->valueToString().toDouble();
      initialize();
   }
   else if(name == "xscale")
   {
      theXScale = property->valueToString().toDouble();
      initialize();
   }
   else if(name == "yscale")
   {
      theYScale = property->valueToString().toDouble();
      initialize();
   }
   else if(name == "autoTrackScaleFlag")
   {
      theTrackScaleFlag = property->valueToString().toDouble();
      initialize();
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
示例#4
0
void ossimBandSelector::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property) return;

   if(property->getName() == "bandSelection")
   {
     ossimString str = property->valueToString();
     std::vector<ossimString> str_vec;
     std::vector<ossim_uint32> int_vec;
     
     str.split( str_vec, " " );
     
     for ( ossim_uint32 i = 0; i < str_vec.size(); ++i )
     {
        if(!str_vec[i].empty())
        {
           int_vec.push_back( str_vec[i].toUInt32() );
        }
     }
     setOutputBandList( int_vec );
   }
   else if(property->getName() == "bands")
   {
      std::vector<ossim_uint32> selection;
      if(ossim::toSimpleVector(selection, property->valueToString()))
      {
         theOutputBandList = selection;
      }
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
示例#5
0
void ossimBumpShadeTileSource::setProperty(ossimRefPtr<ossimProperty> property)
{
   ossimString name = property->getName();
   if(name == "lightSourceElevationAngle")
   {
      m_lightSourceElevationAngle = property->valueToString().toDouble();
   }
   else if(name == "lightSourceAzimuthAngle")
   {
      m_lightSourceAzimuthAngle = property->valueToString().toDouble();
   }
   else
   {
      ossimImageCombiner::setProperty(property);
   }
}
void ossimIndexToRgbLutFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(property.valid())
   {
      ossimString value = property->valueToString();
      value = value.trim();

      if(property->getName() == "LUT file")
      {
         setLut(ossimFilename(property->valueToString()));
      }
      else
      {
         ossimImageSourceFilter::setProperty(property);
      }
   }
}
bool ossimOpjCompressor::setProperty(ossimRefPtr<ossimProperty> property)
{
   bool consumed = false;
   
   if ( property.valid() )
   {
      ossimString key = property->getName();

      if ( traceDebug() )
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "ossimOpjCompressor::setProperty DEBUG:"
            << "\nkey: " << key
            << " values: " << property->valueToString() << std::endl;
      }
      
      if (key == ossimKeywordNames::COMPRESSION_QUALITY_KW)
      {
         setQualityTypeString(property->valueToString());
         consumed = true;
      }
      else if ( (key == LEVELS_KW) || (key ==  "Clevels") )
      {
         m_levels = property->valueToString().toInt32();
         consumed = true;
      }
      else if( (key == REVERSIBLE_KW) || (key == "Creversible") )
      {
         setReversibleFlag(property->valueToString().toBool());
         consumed = true;
      }
      else if (key == ADD_ALPHA_CHANNEL_KW)
      {
         m_alpha = property->valueToString().toBool();
         consumed = true;
      }
      else if ( key == THREADS_KW)
      {
         m_threads = property->valueToString().toInt32();
         consumed = true;
      }
      else if ( (key == "Clayers") ||
                (key == "Cprecincts") )
      {
         // Generic options passed through kdu_params::parse_string.

         // Make in the form of "key=value" for kdu_params::parse_string.
         ossimString option = key;
         option += "=";
         option += property->valueToString();
         
         // Add to list.
         m_options.push_back(option);
         
         consumed = true;
      } 
   }

   return consumed;
}
示例#8
0
void ossimEdgeFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property) return;
   
   if(property->getName() == PROP_EDGE_FILTER)
   {
      theFilterType = property->valueToString();
   }
}
示例#9
0
void ossimNBandToIndexFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(property->getName() == ossimKeywordNames::FILENAME_KW)
   {
      ossimKeywordlist kwl;
      if(kwl.addFile(ossimFilename(property->valueToString())))
      {
         theLut = new ossimNBandLutDataObject;
         theLut->loadState(kwl);
      }
   }
   else if(property->getName() == KEEP_QUANTIZED_VALUE_FLAG_KW)
   {
      theKeepQuantizedValueFlag = property->valueToString().toBool();
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
void
ossimOutlierRejection::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property.valid()) return;
   
   ossimString name = property->getName();

   if(name == "inlier_output_filename")
   {
      theInlierOutputFilename = ossimFilename(property->valueToString());
   }
   else if(name =="inlier_ratio")
   {
      setInlierRatio(property->valueToString().toDouble());
   }
   else if(name == "inlier_image_accuracy")
   {
      setInlierImageAccuracy(property->valueToString().toDouble());
   }
   else {
      ossimModelOptimizer::setProperty(property);
   }
}
示例#11
0
void ossimMaskFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if( property.valid() )
   {
      if(property->getName() == MASK_FILTER_MASK_TYPE_KW)
      {
         setMaskType(property->valueToString());
      }
      else
      {
         ossimImageCombiner::setProperty(property);
      }
   }
}
示例#12
0
void ossimPngReader::setProperty(ossimRefPtr<ossimProperty> property)
{
   if ( property.valid() )
   {
      if ( property->getName().string() == USE_ALPHA_KW )
      {
         ossimString s;
         property->valueToString(s);
         m_useAlphaChannelFlag = s.toBool();
      }
      else
      {
         ossimImageHandler::setProperty(property);
      }
   }
}
示例#13
0
void ossimFftFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property) return;
   
   if(property->getName() == "FFT Direction")
   {
      if(theTile.valid())
      {
         theTile = NULL;
      }
      setDirectionType(property->valueToString());
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
void ossimCFARFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property) return;
   ossimString name = property->getName();

	if(name == "threshold")
	{
		theThreshold = property->valueToString().toDouble();
	}
   else if(name == "Kernel")
   {
      ossimMatrixProperty* matrixProperty = PTR_CAST(ossimMatrixProperty,
                                                     property.get());
      if(matrixProperty)
      {
      	for(ossim_int32 r = 0; r < 5; r++)
   		{
      		for(ossim_int32 c = 0; c < 5; c++)
      		{
      			theKernel[r][c] = (*matrixProperty)(r,c);
      		}
   		}
   		/*
         theKernel[0][0] = (*matrixProperty)(0,0);
         theKernel[1][0] = (*matrixProperty)(1,0);
         theKernel[2][0] = (*matrixProperty)(2,0);
         theKernel[0][1] = (*matrixProperty)(0,1);
         theKernel[1][1] = (*matrixProperty)(1,1);
         theKernel[2][1] = (*matrixProperty)(2,1);
         theKernel[0][2] = (*matrixProperty)(0,2);
         theKernel[1][2] = (*matrixProperty)(1,2);
         theKernel[2][2] = (*matrixProperty)(2,2);
			*/
      }
      else
      {
         ossimImageSourceFilter::setProperty(property);
      }
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
void ossimRangeDomeTileSource::setProperty(ossimRefPtr<ossimProperty> property)
{
   if (!property.valid())
      return;

   ossimString s;
   property->valueToString(s);
   if (s.empty())
      return;

   // The user should select either explicit GSD or relative GSD factor, never both:
   if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW )
   {
      ossim_float64 gsd = s.toFloat64();
      if (!ossim::isnan(gsd))
         setGSD(gsd);
   }
   else
   {
      ossimImageHandler::setProperty(property);
   }
}
示例#16
0
void ossimH5Reader::setProperty(ossimRefPtr<ossimProperty> property)
{
   if ( property.valid() )
   {
      if ( property->getName().string() == LAYER_KW )
      {
         ossimString s;
         property->valueToString(s);
         ossim_uint32 SIZE = (ossim_uint32)m_entries.size();
         for ( ossim_uint32 i = 0; i < SIZE; ++i )
         {
            if ( m_entries[i].getName() == s.string() )
            {
               setCurrentEntry( i );
            }
         }
      }
      else
      {
         ossimImageHandler::setProperty(property);
      }
   }
}
示例#17
0
void ossimWatermarkFilter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if (!property) return;

   ossimString os = property->valueToString();
   
   ossimString name = property->getName();
   if (name == ossimKeywordNames::FILENAME_KW)
   {
      setFilename(os);
   }
   else if  (name == WATERMARK_MODE_KW)
   {
      setMode(os);
   }
   else if  (name == WEIGHT_KW)
   {
      setWeight(os.toDouble());
   }
   else
   {
      ossimImageSourceFilter::setProperty(property);
   }
}
示例#18
0
void ossimNitfFileHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property.valid()) return;
   
   ossimString name = property->getName();
   if(name == FSCLASY_KW)
   {
     setSecurityClassificationSys(property->valueToString()); 
   }
   else if(name == FSDCTP_KW)
   {
      setDeclassificationType(property->valueToString());
   }
   else if(name == FSDCDT_KW)
   {
      setDeclassificationDate(property->valueToString());
   }
   else if(name == FSDCXM_KW)
   {
      setDeclassificationExemption(property->valueToString());
   }
   else if(name == FSDG_KW)
   {
      setDowngrade(property->valueToString());
   }
   else if(name == FSDGDT_KW)
   {
      setDowngradingDate(property->valueToString());
   }
   else if(name == FSCLTX_KW)
   {
      setClassificationText(property->valueToString());
   }
   else if(name == FSCATP_KW)
   {
      setClassificationAuthorityType(property->valueToString());
   }
   else if(name == FSCRSN_KW)
   {
      setClassificationReason(property->valueToString());
   }
   else if(name == FSSRDT_KW)
   {
      setSecuritySourceDate(property->valueToString());
   }
   else if(name == FBKGC_KW)
   {
      ossimString value = property->valueToString();
      std::vector<ossimString> splitString;
      value = value.trim();
      value.split(splitString, " ");
      if(splitString.size() == 3)
      {
         setFileBackgroundColor((ossim_uint8)splitString[0].toUInt32(), 
                                (ossim_uint8)splitString[1].toUInt32(), 
                                (ossim_uint8)splitString[2].toUInt32());
      }
   }
   else
   {
      ossimNitfFileHeaderV2_X::setProperty(property);
   }
}
示例#19
0
void ossimImageFileWriter::setProperty(ossimRefPtr<ossimProperty> property)
{
   if(!property) return;
   
   if(property->getName() == ossimKeywordNames::FILENAME_KW)
   {
      theFilename = property->valueToString();
   }
   else if (property->getName() == "create_envi_hdr")
   {
      theWriteEnviHeaderFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "create_ers_hdr")
   {
      theWriteErsHeaderFlag = property->valueToString().toBool();
   }
   else if (property->getName() ==
            ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW)
   {
      theWriteExternalGeometryFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "create_fgdc")
   {
      theWriteFgdcFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "create_jpeg_world_file")
   {
      theWriteJpegWorldFileFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "create_readme")
   {
      theWriteReadmeFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "create_tiff_world_file")
   {
      theWriteTiffWorldFileFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "create_world_file")
   {
      theWriteWorldFileFlag = property->valueToString().toBool();
   }
   else if (property->getName() == ossimKeywordNames::CREATE_IMAGE_KW)
   {
      theWriteImageFlag = property->valueToString().toBool();
   }
   else if (property->getName() == ossimKeywordNames::CREATE_OVERVIEW_KW)
   {
      theWriteOverviewFlag = property->valueToString().toBool();
   }
   else if (property->getName() == ossimKeywordNames::CREATE_HISTOGRAM_KW)
   {
      theWriteHistogramFlag = property->valueToString().toBool();
   }
   else if (property->getName() == SCALE_TO_EIGHT_BIT_KW)
   {
      theScaleToEightBitFlag = property->valueToString().toBool();
   }
   else if(property->getName() == AUTO_CREATE_DIRECTORY_KW)
   {
      theAutoCreateDirectoryFlag = property->valueToString().toBool();
   }
   else if (property->getName() == "linear_units")
   {
      theLinearUnits = (ossimUnitType)
         (ossimUnitTypeLut::instance()->
          getEntryNumber(property->valueToString()));
   }
   else if(property->getName() == ossimKeywordNames::IMAGE_TYPE_KW)
   {
      setOutputImageType(property->valueToString());
   }
   else if(property->getName() == ossimKeywordNames::PIXEL_TYPE_KW)
   {
      ossimStringProperty* stringProperty = PTR_CAST(ossimStringProperty,
                                                     property.get());
      if (stringProperty)
      {
         ossimString s;
         stringProperty->valueToString(s);
         setPixelType(s);
      }
   }
   else
   {
      ossimImageWriter::setProperty(property);
   }
}
示例#20
0
void ossimNitfImageHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
{
   ossimString name = property->getName();
   std::ostringstream out;
   
   if(!property) return;
   
   if(name.contains(ISCLSY_KW))
   {
      setSecurityClassificationSystem(property->valueToString());
   }
   else if(name.contains(ISCODE_KW))
   {
      setCodewords(property->valueToString());
   }
   else if(name.contains(ISCTLH_KW))
   {
      setControlAndHandling(property->valueToString());
   }
   else if(name.contains(ISREL_KW))
   {
      setReleasingInstructions(property->valueToString());
   }
   else if(name.contains(ISDCTP_KW))
   {
      setDeclassificationType(property->valueToString());
   }
   else if(name.contains(ISDCDT_KW))
   {
      setDeclassificationDate(property->valueToString());
   }
   else if(name.contains(ISDCXM_KW))
   {
      setDeclassificationExempt(property->valueToString());
   }
   else if(name.contains(ISDG_KW))
   {
      setDowngrade(property->valueToString());
   }
   else if(name.contains(ISDGDT_KW))
   {
      setDowngradeDate(property->valueToString());
   }
   else if(name.contains(ISCLTX_KW))
   {
      setClassificationText(property->valueToString());
   }
   else if(name.contains(ISCATP_KW))
   {
      setClassificationAuthorityType(property->valueToString());
   }
   else if(name.contains(ISCAUT_KW))
   {
      setClassificationAuthority(property->valueToString());
   }
   else if(name.contains(ISCRSN_KW))
   {
      setClassificationReason(property->valueToString());
   }
   else if(name.contains(ISSRDT_KW))
   {
      setSecuritySourceDate(property->valueToString());
   }
   else if(name.contains(ISCTLN_KW))
   {
      setSecurityControlNumber(property->valueToString());
   }
   else
   {
      ossimNitfImageHeaderV2_X::setProperty(property);
   }
}