00001 /** 00002 * @file CameraParameters.h 00003 * Declaration of class CameraParameters. 00004 * 00005 * @author <A href=mailto:bach@informatik.hu-berlin.de>Joscha Bach</A> 00006 */ 00007 00008 #ifndef _CameraParameters_h_ 00009 #define _CameraParameters_h_ 00010 00011 #include "Tools/Streams/InOut.h" 00012 00013 00014 /** 00015 * @class CameraParameters 00016 * Adjust parameters for built-in camera of Sony robot 00017 * 00018 * @author Joscha Bach 00019 */ 00020 class CameraParameters 00021 { 00022 public: 00023 CameraParameters(); 00024 00025 enum whiteBalance 00026 { 00027 wb_indoor_mode, wb_outdoor_mode, wb_fl_mode 00028 }; 00029 /** 00030 * Returns a description for an indexed whiteBalance. 00031 */ 00032 static const char* getWhiteBalanceName(whiteBalance whiteBalance) 00033 { 00034 switch (whiteBalance) 00035 { 00036 case wb_indoor_mode: return "wb_indoor_mode"; 00037 case wb_fl_mode: return "wb_fl_mode"; 00038 case wb_outdoor_mode: return "wb_outdoor_mode"; 00039 default: return "check available WhiteBalance types"; 00040 } 00041 } 00042 static const char* getShortWhiteBalanceName(whiteBalance whiteBalance) 00043 { 00044 switch (whiteBalance) 00045 { 00046 case wb_indoor_mode: return "indoor"; 00047 case wb_fl_mode: return "fluorescent"; 00048 case wb_outdoor_mode: return "outdoor"; 00049 default: return "check available WhiteBalance types"; 00050 } 00051 } 00052 enum gain 00053 { 00054 gain_low, gain_mid, gain_high 00055 }; 00056 /** 00057 * Returns a description for an indexed gain. 00058 */ 00059 static const char* getGainName(gain gain) 00060 { 00061 switch (gain) 00062 { 00063 case gain_low: return "gain_low"; 00064 case gain_mid: return "gain_mid"; 00065 case gain_high: return "gain_high"; 00066 default: return "check available gain types"; 00067 } 00068 } 00069 static const char* getShortGainName(gain gain) 00070 { 00071 switch (gain) 00072 { 00073 case gain_low: return "low"; 00074 case gain_mid: return "mid"; 00075 case gain_high: return "high"; 00076 default: return "check available gain types"; 00077 } 00078 } 00079 00080 enum shutterSpeed 00081 { 00082 shutter_slow, shutter_mid, shutter_fast 00083 }; 00084 /** 00085 * Returns a description for an indexed shutterSpeed. 00086 */ 00087 static const char* getShutterSpeedName(shutterSpeed shutterSpeed) 00088 { 00089 switch (shutterSpeed) 00090 { 00091 case shutter_slow: return "shutter_slow"; 00092 case shutter_mid: return "shutter_mid"; 00093 case shutter_fast: return "shutter_fast"; 00094 default: return "check available shutterSpeed types"; 00095 } 00096 } 00097 static const char* getShortShutterSpeedName(shutterSpeed shutterSpeed) 00098 { 00099 switch (shutterSpeed) 00100 { 00101 case shutter_slow: return "slow"; 00102 case shutter_mid: return "mid"; 00103 case shutter_fast: return "fast"; 00104 default: return "check available shutterSpeed types"; 00105 } 00106 } 00107 00108 whiteBalance theWhiteBalance; 00109 gain theGain; 00110 shutterSpeed theShutterSpeed; 00111 }; 00112 00113 /** 00114 * Streaming operator that reads CameraParameters from a stream. 00115 * @param stream The stream from which is read. 00116 * @param cameraParameters The CameraParameters object. 00117 * @return The stream. 00118 */ 00119 In& operator>>(In& stream,CameraParameters& cameraParameters); 00120 00121 /** 00122 * Streaming operator that writes CameraParameters to a stream. 00123 * @param stream The stream to write on. 00124 * @param cameraParameters The CameraParameters object. 00125 * @return The stream. 00126 */ 00127 Out& operator<<(Out& stream, const CameraParameters& cameraParameters); 00128 00129 00130 00131 00132 #endif // _CameraParameters_h_ 00133 00134 /* 00135 * Changelog: 00136 * 00137 * $Log: CameraParameters.h,v $ 00138 * Revision 1.1.1.1 2004/05/22 17:25:44 cvsadm 00139 * created new repository GT2004_WM 00140 * 00141 * Revision 1.2 2004/02/23 15:29:45 jhoffman 00142 * bug removed 00143 * 00144 * Revision 1.1 2003/10/07 10:09:36 cvsadm 00145 * Created GT2004 (M.J.) 00146 * 00147 * Revision 1.1.1.1 2003/07/02 09:40:22 cvsadm 00148 * created new repository for the competitions in Padova from the 00149 * tamara CVS (Tuesday 2:00 pm) 00150 * 00151 * removed unused solutions 00152 * 00153 * Revision 1.3 2002/12/16 14:54:03 dueffert 00154 * changelog added 00155 * 00156 */