本文整理汇总了C++中Profile::addCentral方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::addCentral方法的具体用法?C++ Profile::addCentral怎么用?C++ Profile::addCentral使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::addCentral方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: afficheLineDetection
void ExtractionWidget::afficheLineDetection ()
{
augmentedImage = loadedImage;
QPainter painter (&augmentedImage);
drawStraightLine (p1, p2, Qt::red, painter);
//cout << "P1 = (" << p1.x () << "," << p1.y ()
// << ") et P2 = (" << p2.x () << "," << p2.y () << ")" << endl;
if (manualModeOn)
{
/** ZZZ
DirectionalScan dirScan = DirectionalScan (p1, p2);
dirScan.computeAllScans (0, 0, width, height);
*/
DirectionalScan dirScan = DirectionalScan (p1, p2, 0, 0, width, height);
vector<Pixel> pointsLineOrigin = dirScan.getLeftScan (0);
drawListPixels (pointsLineOrigin, Qt::white, painter);
Profile *pr = prof->profile ();
pr->clear ();
pr->addCentral (p1, p2);
for (int i = 0; i < dirScan.getNbRightScan (); i++)
pr->addToRight (vector<Pixel> (dirScan.getRightScan (i)));
for (int i = 0; i < dirScan.getNbLeftScan (); i++)
pr->addToLeft (vector<Pixel> (dirScan.getLeftScan (i)));
update (QRect (QPoint (0, 0), QPoint (width, height)));
prof->scene()->update ();
prof->show ();
return;
}
BlurredSegment *bs = detector.detect (p1, p2);
vector<Pixel> vpoints;
if (bs != NULL) vpoints = bs->getPrintedPoints ();
if (vpoints.size () < 6)
{
return;
}
if (supportLinesDisplayOn)
{
drawListPixels (vpoints, Qt::blue, painter);
}
lastDetectedSegment.vectPoints = vpoints;
lastDetectedSegment.p1 = p1;
lastDetectedSegment.p2 = p2;
painter.setPen (QPen (Qt::red, myPenWidth, Qt::SolidLine,
Qt::RoundCap, Qt::RoundJoin));
painter.drawText (100, 20,
tr ("E : width = ") + QString::number (segmentMaxWidth));
painter.drawText (100, 40,
tr ("Z : # pixels missing = ") + QString::number (detectionLacks));
update (QRect (QPoint (0, 0), QPoint (width, height)));
}