Camera.cpp
Go to the documentation of this file.
00001 /*******************************************************************************
00002 *  Camera.cpp
00003 *
00004 *  (C) 2006 AG Aktives Sehen <agas@uni-koblenz.de>
00005 *           Universitaet Koblenz-Landau
00006 *
00007 *  Information on Code Review state:
00008 *  §Author:DG DevelTest: Reviewer: Review: Date: State: §
00009 *
00010 *  Additional information:
00011 *  $Id: Camera.cpp 44313 2011-04-06 22:46:28Z agas $
00012 ******************************************************************************/
00013 
00014 #include <stdlib.h>
00015 #include "Camera.h"
00016 
00017 #include "../../Workers/String/String.h"
00018 
00019 
00020 #include <sstream>
00021 #include <assert.h>
00022 #include <math.h>
00023 
00024 
00025 #define THIS Camera
00026 
00027 using namespace std;
00028 
00029 THIS::THIS( std::string deviceDescription, int formatId, int subFormatId, float horizontalViewAngle, std::string customProperties, bool rotateImage )
00030 {
00031     m_DeviceDescription=deviceDescription;
00032     m_FormatId=formatId;
00033     m_SubFormatId=subFormatId;
00034     m_HorizontalViewAngle = horizontalViewAngle;
00035                 m_RotateImage = rotateImage;
00036 
00037     std::vector<std::string> pairs=String::explode( customProperties, ";" );
00038     for ( unsigned i=0; i<pairs.size(); i++ )
00039     {
00040         vector<string> values=String::explode( pairs[i], "=" );
00041         assert( values.size() == 2 );
00042         string leftVal=values[0];
00043         double rightVal=atof( values[1].c_str() );
00044         m_CustomProperties[ leftVal ] = rightVal;
00045     }
00046 }
00047 
00048 float THIS::getHorizontalViewAngle(float diagonalViewAngle)
00049 {
00050     float x = 8 / 5 * tan(diagonalViewAngle / 2.0);
00051     float hViewAngle = 2.0 * atan( x / 2.0 );
00052     return hViewAngle;
00053 }
00054 
00055 #undef THIS


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43