本文整理汇总了C++中DImage::drawLine方法的典型用法代码示例。如果您正苦于以下问题:C++ DImage::drawLine方法的具体用法?C++ DImage::drawLine怎么用?C++ DImage::drawLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImage
的用法示例。
在下文中一共展示了DImage::drawLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
if(numPeaks >= bestNumPeaks){
bestNumPeaks = numPeaks;
bestNumPeaksThresh = peaksThresh;
}
}
rgSmearThresh[i] = bestNumPeaksThresh;
#endif
}
// now get x-height estimate using profiles (or black runlengths of smears)
//debug: save an image with all of the profiles
{
DImage imgProfsAll;
DImage imgProfsRLAll;
imgProfsAll.create(w,h,DImage::DImage_u8);
stripW = (w + numStrips-1) / numStrips;
for(int i=0; i < numStrips*2-1; ++i){
DImage imgTmp;
imgTmp = rgProfs[i].toDImage(stripW/2,true);
imgProfsAll.pasteFromImage(i*stripW/2,0,imgTmp,0,0,stripW/2,h);
}
imgProfsAll = imgProfsAll.convertedImgType(DImage::DImage_RGB);
for(int i=0; i < numStrips*2-1; ++i){
int peakLineOffs;
// peakLineOffs = stripW/2 * rgPeakThresh[i] / rgProfs[i].max();
peakLineOffs = (int)(rgPeakLineOffs[i]*stripW/2);
// printf(" rgPeakLineOffs[%d]=%lf peakLineOffs=%d\n",i,rgPeakLineOffs[i],
// peakLineOffs);
imgProfsAll.drawLine(i*stripW/2 + peakLineOffs+1, 0,
i*stripW/2 + peakLineOffs+1, h-1, 255-i,0,0);
imgProfsAll.drawLine(i*stripW/2 + peakLineOffs, 0,
i*stripW/2 + peakLineOffs, h-1, 255-i,0,0);
imgProfsAll.drawLine(i*stripW/2, 0,
i*stripW/2, h-1, 0, 255-i,0);
}
sprintf(stTmp,"%s_allprofs.pgm",stDebugBaseName);
imgProfsAll.save(stTmp);
}
//debug: save an image with all of the smeared profiles
{
DImage imgProfsAll;
DImage imgProfsRLAll;
imgProfsAll.create(w,h,DImage::DImage_u8);
stripW = (w + numStrips-1) / numStrips;
for(int i=0; i < numStrips*2-1; ++i){
DImage imgTmp;
imgTmp = rgProfsSmear[i].toDImage(stripW/2,true);
imgProfsAll.pasteFromImage(i*stripW/2,0,imgTmp,0,0,stripW/2,h);
}
imgProfsAll = imgProfsAll.convertedImgType(DImage::DImage_RGB);
for(int i=0; i < numStrips*2-1; ++i){
for(int j=0; j < rgNumPeaks[i]; ++j){
int ypos;
ypos = rgPeakYs[i][j];
imgProfsAll.drawLine(i*stripW/2,ypos,(i+1)*stripW/2-1,ypos,255,0,0);
}
for(int j=0; j < rgNumValleys[i]; ++j){