当前位置: 首页>>代码示例>>C++>>正文


C++ ImageWindow::IsNull方法代码示例

本文整理汇总了C++中ImageWindow::IsNull方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageWindow::IsNull方法的具体用法?C++ ImageWindow::IsNull怎么用?C++ ImageWindow::IsNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageWindow的用法示例。


在下文中一共展示了ImageWindow::IsNull方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: __SetToActiveImage_Click

void NewImageInterface::__SetToActiveImage_Click( Button& /*sender*/, bool /*checked*/ )
{
   ImageWindow w = ImageWindow::ActiveWindow();

   if ( !w.IsNull() )
   {
      ImageVariant v = w.MainView().Image();
      AbstractImage* img = v.AnyImage();

      if ( img != 0 )
      {
         if ( v.IsFloatSample() )
            switch ( v.BitsPerSample() )
            {
            case 32: instance.sampleFormat = NewImageSampleFormat::F32; break;
            case 64: instance.sampleFormat = NewImageSampleFormat::F64; break;
            }
         else
            switch ( v.BitsPerSample() )
            {
            case  8: instance.sampleFormat = NewImageSampleFormat::I8; break;
            case 16: instance.sampleFormat = NewImageSampleFormat::I16; break;
            case 32: instance.sampleFormat = NewImageSampleFormat::I32; break;
            }

         instance.colorSpace = img->IsColor() ? NewImageColorSpace::RGB : NewImageColorSpace::Gray;
         instance.width = img->Width();
         instance.height = img->Height();
         instance.numberOfChannels = img->NumberOfChannels();

         UpdateControls();
      }
   }
}
开发者ID:morserover,项目名称:PCL,代码行数:34,代码来源:NewImageInterface.cpp

示例2: FindPreviews

static void FindPreviews( StringList& items, const String& imageId, const String& previewId )
{
   if ( imageId.HasWildcards() )
   {
      Array<ImageWindow> W = ImageWindow::AllWindows();
      for ( size_type i = 0; i < W.Length(); ++i )
         if ( String( W[i].MainView().Id() ).WildMatch( imageId ) )
            FindPreviews( items, W[i], previewId );
   }
   else
   {
      ImageWindow w = ImageWindow::WindowById( IsoString( imageId ) );
      if ( w.IsNull() )
         throw ParseError( "Image not found", imageId );
      FindPreviews( items, w, previewId );
   }
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:17,代码来源:Arguments.cpp

示例3: ImportProcess

bool AnnotationInterface::ImportProcess( const ProcessImplementation& p )
{
   const AnnotationInstance* i = dynamic_cast<const AnnotationInstance*>( &p );

   if ( i == 0 )
      throw Error( "Not an Annotation instance." );

   if ( view == 0 )
   {
      ImageWindow w = ImageWindow::ActiveWindow();

      if ( w.IsNull() )
      {
         throw Error( "The Annotation interface requires an active image window to import a process instance." );
         return false;
      }

      view = new View( w.MainView() );

      view->AddToDynamicTargets();
   }

   ClearBitmaps();

   instance.Assign( *i );

   annotationPlaced = false;
   leaderPlaced = false;

   if ( view->Window().CurrentView() != *view )
      view->Window().SelectView( *view );

   UpdateControls();

   return true;
}
开发者ID:aleixpuig,项目名称:PCL,代码行数:36,代码来源:AnnotationInterface.cpp

示例4: ExtractArguments


//.........这里部分代码省略.........

         if ( recursiveSearchArgs && arg.Id() == s_recursiveSearchArg )
         {
            if ( arg.IsSwitch() )
               recursiveSearch = arg.SwitchState();
            else if ( arg.IsLiteral() )
               recursiveSearch = true;
            else
               arguments.Add( arg );
         }
         else
            arguments.Add( arg );
      }
      else
      {
         if ( noItems )
            throw ParseError( "Non-parametric arguments are not allowed", *i  );

         StringList items;

         if ( itemsAsFiles )
         {
            String fileName = *i;
            if ( fileName.StartsWith( '\"' ) )
               fileName.Delete( 0 );
            if ( fileName.EndsWith( '\"' ) )
               fileName.Delete( fileName.UpperBound() );

            fileName.Trim();
            if ( fileName.IsEmpty() )
               throw ParseError( "Empty path specification", *i );

            fileName = File::FullPath( fileName );

            if ( fileName.HasWildcards() )
            {
               if ( !allowWildcards )
                  throw ParseError( "Wildcards not allowed", fileName );

               items = SearchDirectory( fileName, recursiveSearch );
            }
            else
               items.Add( fileName );
         }
         else if ( itemsAsViews )
         {
            String viewId = *i;

            if ( !allowWildcards )
               if ( viewId.HasWildcards() )
                  throw ParseError( "Wildcards not allowed", viewId );

            size_type p = viewId.Find( "->" );

            if ( p != String::notFound )
            {
               if ( noPreviews )
                  throw ParseError( "Preview identifiers not allowed", viewId );

               String imageId = viewId.Left( p );
               if ( imageId.IsEmpty() )
                  throw ParseError( "Missing image identifier", viewId );

               String previewId = viewId.Substring( p+2 );
               if ( previewId.IsEmpty() )
                  throw ParseError( "Missing preview identifier", viewId );

               FindPreviews( items, imageId, previewId );
            }
            else
            {
               if ( viewId.HasWildcards() )
               {
                  Array<ImageWindow> W = ImageWindow::AllWindows();
                  for ( size_type i = 0; i < W.Length(); ++i )
                  {
                     View v = W[i].MainView();
                     if ( String( v.Id() ).WildMatch( viewId ) )
                        AddView( items, v );
                  }
               }
               else
               {
                  ImageWindow w = ImageWindow::WindowById( IsoString( viewId ) );
                  if ( w.IsNull() )
                     throw ParseError( "Image not found", viewId );
                  AddView( items, w.MainView() );
               }
            }
         }
         else
            items.Add( *i );

         Argument arg( *i, items );
         arguments.Add( arg );
      }
   }

   return arguments;
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:101,代码来源:Arguments.cpp


注:本文中的ImageWindow::IsNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。