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


C++ DImage::splitRGB方法代码示例

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


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

示例1: filterImage_


//.........这里部分代码省略.........
        fprintf(stderr, "DMaxFilter::filterImage_() failed to spawn "
            "thread #%d. Exiting.\n", tnum);
        exit(1);
      }
    }
#endif
    maxFiltHuang_u8(imgDst, *pImgPad, _radiusX, _radiusY,
            wKern, hKern, rgKern, numKernPxls,
            rgRightEdge, pProg, 0, hUnpad+1, 0, _numThreads);
#ifndef D_NOTHREADS
    for(int tnum = 1; tnum < _numThreads; ++tnum){
      if(pthread_join(rgThreadID[tnum],NULL))
        fprintf(stderr, "DMaxFilter::filterImage_() failed to join "
            "thread %d\n", tnum);
    }
#endif
    if(NULL != pProg){
      pProg->reportStatus(hUnpad+1, 0, hUnpad+1);//report progress complete
    }	  
      }
      break;
    case DImage::DImage_RGB:
      {
    DImage imgR, imgG, imgB;
    DImage imgRDst, imgGDst, imgBDst;

    imgRDst.create(wUnpad, hUnpad, DImage::DImage_u8, 1,
               imgSrc.getAllocMethod());
    imgGDst.create(wUnpad, hUnpad, DImage::DImage_u8, 1,
               imgSrc.getAllocMethod());
    imgBDst.create(wUnpad, hUnpad, DImage::DImage_u8, 1,
               imgSrc.getAllocMethod());

    pImgPad->splitRGB(imgR, imgG, imgB);

#ifndef D_NOTHREADS
    for(int tnum = 1; tnum < _numThreads; ++tnum){
      rgParms[tnum].pImgDst = &imgRDst;
      rgParms[tnum].pImgSrc = &imgR;
      rgParms[tnum].radiusX = _radiusX;
      rgParms[tnum].radiusY = _radiusY;
      rgParms[tnum].wKern = wKern;
      rgParms[tnum].hKern = hKern;
      rgParms[tnum].rgKern = rgKern;
      rgParms[tnum].numKernPxls = numKernPxls;
      rgParms[tnum].rgRightEdge = rgRightEdge;
      rgParms[tnum].pProg = NULL;
      rgParms[tnum].progStart = 0;
      rgParms[tnum].progMax = 1;
      rgParms[tnum].threadNumber = tnum;
      rgParms[tnum].numThreads = _numThreads;

      if(0 != pthread_create(&rgThreadID[tnum], NULL,
                 DMaxFilter::DMaxFilter_Huang8threadWrap,
                 &rgParms[tnum])){
        fprintf(stderr, "DMaxFilter::filterImage_() failed to spawn "
            "thread #%d. Exiting.\n",tnum);
        exit(1);
      }
    }
#endif
    maxFiltHuang_u8(imgRDst, imgR, _radiusX, _radiusY,
            wKern, hKern, rgKern, numKernPxls,
            rgRightEdge, pProg, 0, 3 * hUnpad);
#ifndef D_NOTHREADS
    for(int tnum = 1; tnum < _numThreads; ++tnum){
开发者ID:Nikhil02,项目名称:handwriting,代码行数:67,代码来源:dmaxfilter.cpp


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