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


C++ MyImage::getPointer方法代码示例

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


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

示例1: testImageCopyShort

bool testImageCopyShort()
{
  unsigned int nbok = 0;
  unsigned int nb = 0;

  trace.beginBlock ( "Testing smart copy of Image..." );
  typedef ImageContainerBySTLVector<Z2i::Domain, int> VImage;
  typedef Image<VImage > MyImage;
  BOOST_CONCEPT_ASSERT(( CImage< MyImage > ));

  Z2i::Point a(0,0);
  Z2i::Point b(32,32);
  Z2i::Point c(12, 14);

  Z2i::Domain domain(a,b);

  MyImage image(  new VImage(domain) );
  trace.info() << "Image constructed: "<< image <<std::endl;

  VImage myImageC( domain );
  MyImage imageFromConstRef ( myImageC );
  trace.info() << "Image constructed (from constRef): "<< imageFromConstRef <<std::endl;
  nbok += (imageFromConstRef.getPointer().count()== 2) ? 1 : 0;
  nb++;
  trace.info() << "(" << nbok << "/" << nb << ") "
         << "unique" << std::endl;

  MyImage image3;
  trace.info() << "Image constructed (degulat): "<< image3 <<std::endl;


  trace.info() <<  "default: "<< image3 <<std::endl;
  image3 = image;
  nbok += (image3.getPointer().count()== 3) ? 1 : 0;
  nb++;
  trace.info() << "(" << nbok << "/" << nb << ") "
         << "true == true" << std::endl;
  trace.info() <<  "assignment: "<< image3 <<std::endl;
  nbok += (image3.getPointer().count()== 3) ? 1 : 0;
  nb++;
  trace.info() << "(" << nbok << "/" << nb << ") "
        << "true == true" << std::endl;

  image3.setValue(Z2i::Point(1,1), 4);
  trace.info() <<  "setValue on assigned: "<< image3 <<std::endl;
  nbok += (image3.getPointer().count()== 2) ? 1 : 0;
  nb++;

  MyImage image4(image3);
  trace.info() << "Image constructed (copy): "<< image4 <<std::endl;
  nbok += (image4.getPointer().count()== 3) ? 1 : 0;
  nb++;


  trace.info() << "(" << nbok << "/" << nb << ") "
         << "true == true" << std::endl;

  return nbok == nb;
}
开发者ID:alinemartin,项目名称:DGtal,代码行数:59,代码来源:testImageSimple.cpp


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