bool FluxCalibrationInstance::CanExecuteOn( const View& view, pcl::String& whyNot ) const
{
   if ( view.Image().IsComplexSample() )
   {
      whyNot = "FluxCalibration cannot be executed on complex images.";
      return false;
   }

   if ( view.Image()->IsColor() )
   {
      whyNot = "FluxCalibration cannot be executed on color images.";
      return false;
   }

   FITSKeywordArray inputKeywords;
   view.Window().GetKeywords( inputKeywords );

   if ( FluxCalibrationEngine::KeywordExists( inputKeywords, "FLXMIN" ) ||
        FluxCalibrationEngine::KeywordExists( inputKeywords, "FLXRANGE" ) ||
        FluxCalibrationEngine::KeywordExists( inputKeywords, "FLX2DN" ) )
   {
      whyNot = "FluxCalibration cannot be executed on an already flux-calibrated image.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool CurvesTransformationInstance::CanExecuteOn( const View& view, pcl::String& whyNot ) const
{
   if ( view.Image().IsComplexSample() )
   {
      whyNot = "CurvesTransformation cannot be executed on complex images.";
      return false;
   }

   whyNot.Clear();
   return true;
}
示例#3
0
bool BinarizeInstance::CanExecuteOn( const View& view, pcl::String& whyNot ) const
{
   if ( view.Image().IsComplexSample() )
   {
      whyNot = "Binarize cannot be executed on complex images.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool ImageIdentifierInstance::CanExecuteOn( const View& v, pcl::String& whyNot ) const
{
   if ( !v.IsMainView() )
   {
      whyNot = "ImageIdentifier can only be executed on main views, not on previews.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool HDRCompositionInterface::ValidateProcess( const ProcessImplementation& p, pcl::String& whyNot ) const
{
   const HDRCompositionInstance* r = dynamic_cast<const HDRCompositionInstance*>( &p );
   if ( r == 0 )
   {
      whyNot = "Not an HDRComposition instance.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool ExponentialTransformationInterface::ValidateProcess( const ProcessImplementation& p, pcl::String& whyNot ) const
{
   const ExponentialTransformationInstance* r = dynamic_cast<const ExponentialTransformationInstance*>( &p );
   if ( r == 0 )
   {
      whyNot = "Not an ExponentialTransformation instance.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool GradientsMergeMosaicInterface::ValidateProcess( const ProcessImplementation& p, pcl::String& whyNot ) const
{
   const GradientsMergeMosaicInstance* r = dynamic_cast<const GradientsMergeMosaicInstance*>( &p );
   if ( r == 0 )
   {
      whyNot = "Not a GradientMergeMosaic instance.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool ExtractAlphaChannelsInterface::ValidateProcess( const ProcessImplementation& p, pcl::String& whyNot ) const
{
   const ExtractAlphaChannelsInstance* r = dynamic_cast<const ExtractAlphaChannelsInstance*>( &p );

   if ( r == 0 )
   {
      whyNot = "Not an ExtractAlphaChannels instance.";
      return false;
   }

   whyNot.Clear();
   return true;
}
bool ImageIdentifierInterface::ValidateProcess( const ProcessImplementation& p, pcl::String& whyNot ) const
{
   const ImageIdentifierInstance* r = dynamic_cast<const ImageIdentifierInstance*>( &p );

   if ( r == 0 )
   {
      whyNot = "Not an ImageIdentifier instance.";
      return false;
   }

   whyNot.Clear();
   return true;
}
示例#10
0
bool ConvertToGrayscaleInstance::CanExecuteOn( const View& view, pcl::String& whyNot ) const
{
   if ( view.Image().IsComplexSample() )
   {
      whyNot = "ConvertToGrayscale cannot be executed on complex images.";
      return false;
   }

   if ( view.Image().ColorSpace() == ColorSpace::Gray )
   {
      whyNot = "ConvertToGrayscale cannot be executed on grayscale images.";
      return false;
   }

   whyNot.Clear();
   return true;
}
示例#11
0
bool ImageIdentifierInstance::Validate( pcl::String& info )
{
   id.Trim();

   // The identifier can either be empty, meaning that a default image
   // identifier will be automatically assigned by the PixInsight core
   // application, or a valid C identifier.
   //
   // We only have to check validity of our identifier here. Uniqueness in any
   // particular naming context is enforced by the core application.

   if ( !id.IsEmpty() && !id.IsValidIdentifier() ) // String::IsValidIdentifier() does the job
   {
      info = '\'' + id + "' is not a valid identifier.";
      return false;
   }

   info.Clear();
   return true;
}
示例#12
0
bool CCDFrameInstance::CanExecuteGlobal( pcl::String& whyNot ) const
{
   whyNot.Clear();
   return true;
}
示例#13
0
bool INDIMountInstance::CanExecuteGlobal( pcl::String& whyNot ) const
{
   whyNot.Clear();
   return true;
}