Changeset 102 in 3DVCSoftware for trunk/source/Lib/TAppCommon/TAppComCamPara.cpp


Ignore:
Timestamp:
11 Aug 2012, 14:39:19 (12 years ago)
Author:
tech
Message:

SAIT_VSO_EST_A0033 code improvement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TAppCommon/TAppComCamPara.cpp

    r100 r102  
    14561456}
    14571457
     1458#if SAIT_VSO_EST_A0033
     1459Void
     1460TAppComCamPara::xSetDispCoeff( UInt uiFrameId, Int iViewIdx )
     1461{
     1462  UInt uiFrame = m_uiFirstFrameId + uiFrameId;
     1463  Int  iSourceViewNum = m_aiBaseViews[ iViewIdx ];
     1464  Double dBaseLine = 0.0;
     1465  Double dFL1, dCS1, dCP1, dZN1, dZF1;
     1466  Bool bInterpolated;
     1467  double dPos[3];
     1468
     1469  if( m_iNumberOfBaseViews == 3 )
     1470  {
     1471    xGetGeometryData( m_aiBaseViews[0], uiFrame, dFL1, dPos[0], dCS1, bInterpolated );
     1472    xGetGeometryData( m_aiBaseViews[1], uiFrame, dFL1, dPos[1], dCS1, bInterpolated );
     1473    xGetGeometryData( m_aiBaseViews[2], uiFrame, dFL1, dPos[2], dCS1, bInterpolated );
     1474
     1475    xGetGeometryData( iSourceViewNum, uiFrame, dFL1, dCP1, dCS1, bInterpolated );
     1476    xGetZNearZFar   ( iSourceViewNum, uiFrame, dZN1, dZF1 );
     1477
     1478    dBaseLine = ( Max( dPos[0], Max( dPos[1], dPos[2] ) ) - Min( dPos[0], Min( dPos[1], dPos[2] ) ) ) / 2.0;
     1479  }
     1480  else if( m_iNumberOfBaseViews == 2 )
     1481  {
     1482    xGetGeometryData( m_aiBaseViews[0], uiFrame, dFL1, dPos[0], dCS1, bInterpolated );
     1483    xGetGeometryData( m_aiBaseViews[1], uiFrame, dFL1, dPos[1], dCS1, bInterpolated );
     1484
     1485    xGetGeometryData( iSourceViewNum, uiFrame, dFL1, dCP1, dCS1, bInterpolated );
     1486    xGetZNearZFar   ( iSourceViewNum, uiFrame, dZN1, dZF1 );
     1487
     1488    dBaseLine = dPos[0] - dPos[1];
     1489  }
     1490
     1491
     1492  m_dDispCoeff = fabs( dFL1 * ( dBaseLine / 2.0 ) / 255.0 * ( 1.0/dZN1 - 1.0/dZF1 ) );
     1493}
     1494#endif
    14581495
    14591496Bool
Note: See TracChangeset for help on using the changeset viewer.