Changeset 4174
- Timestamp:
- 05/25/04 14:13:57 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.cpp
r3401 r4174 94 94 windowPainter->drawImage( 0,0, *m_pImage ); 95 95 96 // Overlay camera center if it was determined from the LEDs 97 if( m_iCenterX != -1 ) 98 windowPainter->setPen( Qt::white ); 99 windowPainter->drawEllipse( m_iCenterX-2, m_iCenterY-2, 5, 5); 100 windowPainter->drawEllipse( m_iCenterX-4, m_iCenterY-4, 9, 9); 96 // Overlay camera center if it was determined from the LEDs 97 if( m_iCenterX > 1 ) 98 { 99 windowPainter->setPen( Qt::white ); 100 windowPainter->drawEllipse( m_iCenterX-2, m_iCenterY-2, 5, 5); 101 windowPainter->drawEllipse( m_iCenterX-4, m_iCenterY-4, 9, 9); 102 } 101 103 102 104 // Overlay Spots … … 149 151 { 150 152 windowPainter->setPen( Qt::green ); 151 windowPainter->drawRect( m_iRefX-4, m_iRefY-4, 9, 9 ); 153 if( m_iCenterX > 1 ) 154 { 155 // Adapt spot for shift of camera center. 156 int iDx, iDy; 157 iDx = m_iCenterX - CAMERA_X; 158 iDy = m_iCenterY - CAMERA_Y; 159 windowPainter->drawRect( m_iRefX+iDx-4, m_iRefY+iDy-4, 9, 9 ); 160 } else 161 windowPainter->drawRect( m_iRefX-4, m_iRefY-4, 9, 9 ); 152 162 } 153 163 … … 200 210 } 201 211 } 202 212 203 213 } 204 214 } … … 249 259 m_qrROI.setRight( x ); 250 260 else 251 { 261 { 252 262 if( x == m_qrROI.left() ) 253 263 m_qrROI.setRight( event->x() -1 ); … … 258 268 m_qrROI.setBottom( y ); 259 269 else 260 { 270 { 261 271 if( y == m_qrROI.bottom() ) 262 272 m_qrROI.setBottom( event->y() -1 ); … … 265 275 } 266 276 if ( m_qrROI.isValid() ); 267 m_pSpotThread->setROI( m_qrROI ); 277 m_pSpotThread->setROI( m_qrROI ); 268 278 } 269 279 … … 277 287 m_qrROI.setTop( event->y() ); 278 288 m_qrROI.setBottom( event->y() -1 ); 279 m_pSpotThread->setROI( m_qrROI ); 289 m_pSpotThread->setROI( m_qrROI ); 280 290 } 281 291 if( event->button() == MidButton ) … … 365 375 // Check if this spot is compatible with the spot of the 366 376 // upper left LED 367 if ( pActualSpot->contains ( LED1_X, LED1_Y ) )368 { 369 dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X); 377 if ( pActualSpot->contains2( LED1_X, LED1_Y ) ) 378 { 379 dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X); 370 380 dY1 = pActualSpot->getY() + (CAMERA_Y - LED1_Y); 371 381 dX += dX1; dY += dY1; 372 382 m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) ); 373 383 iNumLEDs++; 374 } 384 } 375 385 // Check if this spot is compatible with the spot of the 376 386 // upper right LED 377 else if ( pActualSpot->contains ( LED2_X, LED2_Y ) )378 { 379 dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X); 387 else if ( pActualSpot->contains2( LED2_X, LED2_Y ) ) 388 { 389 dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X); 380 390 dY2 = pActualSpot->getY() + (CAMERA_Y - LED2_Y); 381 391 dX += dX2; dY += dY2; 382 392 m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) ); 383 393 iNumLEDs++; 384 } 394 } 385 395 // Check if this spot is compatible with the spot of the 386 396 // lower left LED 387 else if ( pActualSpot->contains ( LED3_X, LED3_Y ) )388 { 389 dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X); 397 else if ( pActualSpot->contains2( LED3_X, LED3_Y ) ) 398 { 399 dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X); 390 400 dY3 = pActualSpot->getY() + (CAMERA_Y - LED3_Y); 391 401 dX += dX3; dY += dY3; 392 402 m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) ); 393 403 iNumLEDs++; 394 } 404 } 395 405 // Check if this spot is compatible with the spot of the 396 406 // lower right LED 397 else if ( pActualSpot->contains ( LED4_X, LED4_Y ) )398 { 399 dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X); 407 else if ( pActualSpot->contains2( LED4_X, LED4_Y ) ) 408 { 409 dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X); 400 410 dY4 = pActualSpot->getY() + (CAMERA_Y - LED4_Y); 401 411 dX += dX4; dY += dY4; … … 408 418 if( iNumLEDs != 0) 409 419 { 410 m_iCenterX = (int) rint(dX / iNumLEDs); 420 m_iCenterX = (int) rint(dX / iNumLEDs); 411 421 m_iCenterY = (int) rint(dY / iNumLEDs); 412 // qDebug("Center %d %d", m_iCenterX, m_iCenterY); 422 // qDebug("Center %d %d", m_iCenterX, m_iCenterY); 413 423 } 414 424 qDebug("Center at: %d %d -- with %d LEDs",m_iCenterX, m_iCenterY, iNumLEDs );
Note:
See TracChangeset
for help on using the changeset viewer.