AVTPikeCam.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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                 // AbstractColorCamera interface implementation
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);             //speichert die Parameter in das File
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                 // Camera specific functions
00176                 //*******************************************************************************
00177 
00178 };
00179 
00182 __DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam();
00183 
00184 } // end namespace ipa_CameraSensors
00185 
00186 #endif //__IPA_AVTPIKECAM_H__
00187 
00188 


cob_camera_sensors
Author(s): Jan Fischer , Richard Bormann
autogenerated on Sat Jun 8 2019 21:02:02