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


C++ GeoImage::mergeInto方法代码示例

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


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

示例1: prepareResultImage

/** Prepare the result image with the given instantiated net and the corresponding label image tiles */
void Analysis::prepareResultImage()
{
  iNodeRoot_->setNewID(1);
  emit message("Preparing result map");
  if (!iNodeRoot_->labelImage()) {
    qDebug("Analysis::prepareResultImage: no labelimage");
    return;
  }
  int size_x =
    int ((geoImageList_->geoEast() -
          geoImageList_->geoWest()) / labelImageList_->maxResolution());
  int size_y =
    int ((geoImageList_->geoNorth() -
          geoImageList_->geoSouth()) / labelImageList_->maxResolution());
  GeoImage *img = new GeoImage("result.plm", "result", size_x, size_y,
                               geoImageList_->geoWest(),
                               geoImageList_->geoNorth(),
                               geoImageList_->geoEast(),
                               geoImageList_->geoSouth());
  if (!img->mergeInto(*(iNodeRoot_->labelImage()), 0,
                      iNodeRoot_->attributeInt("id"),
                      iNodeRoot_->attributeInt("IDStart"))) {
    iNodeRoot_->attribute("status", "deleted");
  }
  iNodeRoot_->mergeResultImage(*img);
  img->write();
  map_ = img;
  emit sigMapView(iNodeRoot_, map_);
#ifdef DEBUGMSG
  qDebug("Analysis::prepareResultImage: image=(%dx%d)", size_x, size_y);
#endif
}
开发者ID:BackupTheBerlios,项目名称:geoaida-svn,代码行数:33,代码来源:analysis.cpp

示例2: mergeResultImage

/** merge inodes labelimage into the result image */
void INode::mergeResultImage(GeoImage & resultImg, RunLengthLabelImage &rlelabelimage)
{
  qDebug("INode::mergeResultImage: name=%s", name_.latin1());
  QListIterator < INode > it = QListIterator < INode > (children());
  for (; it.current(); ++it)
  {
    INode *node = it.current();
    
    if (node->status() == TRASH)
      continue;
    
    RunLengthLabelImage copylabelimage = rlelabelimage;
    
    if (node->labelImage() && node->attributeInt("id"))
    {
      // id==0 is background and should not be merged into the result image
      if (!resultImg.mergeInto(*(node->labelImage()), attributeInt("IDStart"),
                                node->attributeInt("id"), node->attributeInt("IDStart"), copylabelimage))
        node->attribute("status", "deleted");
    }
    else
    {
      node->attribute("status", "no labelimage");
      qDebug("INode::mergeResultImage: %s ommitted", (const char *) node->name());
    }
    
    if (node->attributeInt("id"))
    {
      // id==0 is background and should not be merged into the result image
      node->mergeResultImage(resultImg, copylabelimage);
    }
    else
    {
      qDebug("INode::mergeResultImage: %s ommitted", (const char *) node->name());
    }
  }
}
开发者ID:BackupTheBerlios,项目名称:geoaida,代码行数:38,代码来源:inode.cpp


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