Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00022
00023
00024 #ifndef __IPA_AVTPIKECAM_H__
00025 #define __IPA_AVTPIKECAM_H__
00026
00027 #include "StdAfx.h"
00028
00029 #ifdef __LINUX__
00030 #include "cob_camera_sensors/AbstractColorCamera.h"
00031 #else
00032 #include "cob_driver/cob_camera_sensors/common/include/cob_camera_sensors/AbstractColorCamera.h"
00033 #endif
00034
00035 #include <cstdlib>
00036
00037 #ifdef _WIN32
00038 #include <fgcamera.h>
00039 #ifdef __MINGW__
00040 typedef unsigned char UINT8;
00041 #endif
00042 #endif
00043
00044 #define UINT8P_CAST(x) reinterpret_cast<UINT8*>(x)
00045
00046 #ifdef __LINUX__
00047 #include <dc1394/dc1394.h>
00048 typedef struct
00049 {
00050 unsigned long Low;
00051 unsigned long High;
00052 }UINT32HL;
00053 #define UINT32 unsigned long
00054 #define _UINT32HL
00055 #endif
00056
00057 #ifdef SWIG
00058 %module Sensors
00059 %include "Source/Vision/CameraSensors/AbstractColorCamera.h"
00060
00061 %{
00062 #include "AVTPikeCam.h"
00063 %}
00064 #endif
00065
00066 using namespace std;
00067
00068 namespace ipa_CameraSensors {
00069
00073 class __DLL_LIBCAMERASENSORS__ AVTPikeCam : public AbstractColorCamera
00074 {
00080 class AVTPikeCamDeleter
00081 {
00082 public:
00083 ~AVTPikeCamDeleter()
00084 {
00085 #ifndef __LINUX__
00086 FGExitModule();
00087 #endif
00088 };
00089 };
00090
00091 private:
00093 bool m_operationMode_B;
00094 UINT32HL m_GUID;
00095 static bool m_OpenExecuted;
00096 static AVTPikeCamDeleter m_Deleter;
00097
00098 #ifdef __LINUX__
00099 dc1394video_frame_t* m_Frame;
00100 dc1394_t* m_IEEE1394Info;
00101 dc1394camera_list_t* m_IEEE1394Cameras;
00102 dc1394camera_t* m_cam;
00103 dc1394video_modes_t m_availableVideoModes;
00104
00105 dc1394speed_t m_IsoSpeed;
00106 dc1394framerate_t m_FrameRate;
00107 dc1394video_mode_t m_VideoMode;
00108 dc1394color_coding_t m_ColorCoding;
00109 #endif
00110
00111 #ifdef _WIN32
00112 CFGCamera m_cam;
00113 FGNODEINFO m_nodeInfo[5];
00114 UINT32 m_NodeCnt;
00115 FGFRAME m_Frame;
00116 #endif
00117
00118
00119
00120
00121
00122 unsigned long LoadParameters(const char* filename, int cameraIndex);
00123
00127 unsigned long SetParameters();
00128
00129 public:
00130
00132 AVTPikeCam ();
00134 ~AVTPikeCam ();
00135
00136
00137
00138
00139
00140 unsigned long Init(std::string directory, int cameraIndex = 0);
00141
00142 unsigned long Open();
00143 unsigned long Close();
00144
00145 unsigned long GetColorImage(char* colorImageData, bool getLatestFrame);
00146 unsigned long GetColorImage(cv::Mat* colorImage, bool getLatestFrame);
00147
00148 unsigned long SaveParameters(const char* filename);
00149
00165 unsigned long SetProperty(t_cameraProperty* cameraProperty);
00166 unsigned long SetPropertyDefaults();
00167 unsigned long GetProperty(t_cameraProperty* cameraProperty);
00168
00171 unsigned long PrintCameraInformation();
00172 unsigned long TestCamera(const char* filename);
00173
00174
00175
00176
00177
00178 };
00179
00182 __DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam();
00183
00184 }
00185
00186 #endif //__IPA_AVTPIKECAM_H__
00187
00188