MCPcopy Create free account
hub / github.com/andybarry/makerscanner / DisplayLaserPx

Method DisplayLaserPx

ScanThread.cpp:560–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560void ScanThread::DisplayLaserPx(vector<float> *laserPx)
561{
562 // create an image that we can use to display where we found the laser
563 CvSize sz = cvSize(noLaser->width & -2, noLaser->height & -2);
564
565 // allow for single-pixel access to the laserHitImage
566 RgbImage coveredImagePx(coveredImage);
567
568 // make the current laser line red
569 IplImage *outImage = cvCloneImage(coveredImage);
570 RgbImage outImagePx(outImage);
571
572 for (int h=0;h<int(laserPx->size());h++)
573 {
574 // add this point to our display image for where we found laser points (for the future)
575 coveredImagePx[h][int((*laserPx)[h])].r = 0;
576 coveredImagePx[h][int((*laserPx)[h])].g = 0;
577 coveredImagePx[h][int((*laserPx)[h])].b = 255;
578
579 // add the laser line in red for display right now
580 outImagePx[h][int((*laserPx)[h])].r = 255;
581 outImagePx[h][int((*laserPx)[h])].g = 0;
582 outImagePx[h][int((*laserPx)[h])].b = 0;
583
584 }
585
586 // display the image (SendFrame copies the image, so we can release it here).
587 //captureThread->SendFrame(pDstImg);
588 captureThread->SendFrame(outImage);
589
590 // release images used for display image
591 cvReleaseImage(&outImage);
592
593}

Callers

nothing calls this directly

Calls 1

SendFrameMethod · 0.80

Tested by

no test coverage detected