/camera/camlib

To get this branch, use:
bzr branch http://suren.me/webbzr/camera/camlib

« back to all changes in this revision

Viewing changes to include/pfConfig.h

  • Committer: Suren A. Chilingaryan
  • Date: 2011-02-13 01:33:37 UTC
  • Revision ID: csa@dside.dyndns.org-20110213013337-ibm4w4n5a3hu4k7u
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** \file PFConfig.h
 
2
  */
 
3
 
 
4
 
 
5
/*!
 
6
 * \mainpage PFConfig DLL Documentation
 
7
 * \version 1.0.2
 
8
 * \author Photonfocus AG
 
9
 * \date 01/2010
 
10
 *
 
11
 * \section intro   Introduction
 
12
 * The software package that comes with a Photonfocus camera contains an 
 
13
 * application and a SDK to evaluate the camera. With PFRemote, all camera 
 
14
 * parameters can be configured. Next to the pflib SDK for C++ application 
 
15
 * development there is also a PFConfig DLL for an independent integration
 
16
 * in several 3rd party application like Labview, Mathlab, VB, C#, etc.
 
17
 *
 
18
 * The PFConfig DLL is a software development kit as well as for the  
 
19
 * Photonfocus USB camera as for the camealink camera. With the PFConfig, 
 
20
 * all camera parameters such as exposure time, ROI, etc. can be configured.
 
21
 * The PFConfig DLL is based on the pflib library and also on the fglib2.2.lib 
 
22
 * display_lib.lib for USB cameras.
 
23
 *
 
24
 * Most of the functions return an error code in the case the function fails.
 
25
 * Please refer to the documentation of the pflib for a detailed description
 
26
 * of the error codes. You can also call the function pfGetErrorMsg() which
 
27
 * returns the latest error message. This function should be called if the
 
28
 * return code of any function is unlike 0.
 
29
 * 
 
30
 * 
 
31
 * There are examples available about how to use the PFConfig DLL.
 
32
 *
 
33
 *
 
34
 */
 
35
 
 
36
/**
 
37
 * \example PFConfig_Example.vbproj
 
38
 * VB 2008 - Example shows how to configure (read/write) the camera.
 
39
 */
 
40
 
 
41
/**
 
42
 * \example PFConfig_Example.vcproj
 
43
 * VC 2008 - Example shows how to configure (read/write) the camera.
 
44
 */
 
45
 
 
46
#ifdef PFCONFIG_EXPORTS
 
47
#ifdef __cplusplus
 
48
extern "C"
 
49
#define PFCONFIG_API  extern "C" __declspec(dllexport)
 
50
#else
 
51
#define PFCONFIG_API __declspec(dllexport)
 
52
#endif
 
53
 
 
54
#else
 
55
#ifdef __cplusplus
 
56
#define PFCONFIG_API extern "C" __declspec(dllimport)
 
57
#else
 
58
#define PFCONFIG_API __declspec(dllimport)
 
59
#endif
 
60
#endif
 
61
 
 
62
#include <stdio.h>
 
63
#include <string>
 
64
using namespace std;
 
65
 
 
66
///
 
67
/// \brief Get the version of the PFConfig Dll.
 
68
/// \param[in] iPort Port number [0...(NumPort-1)].
 
69
///
 
70
/// \return A pointer to a array of character containing a version.
 
71
///
 
72
PFCONFIG_API char* pfGetVersion(int iPort);
 
73
 
 
74
 
 
75
///
 
76
/// \brief Init of the USB camera frame grabber with a camera-dll.
 
77
///     This function is only needed when using a USB camera. 
 
78
/// \param[in] pDllName The name of the camera-dll, (i,e mv_d640_48_u2.dll, mv_d1024e_40_u2.dll)
 
79
///
 
80
/// \return Error code or 0 if DLL successfully loaded.
 
81
///
 
82
PFCONFIG_API int pfInitUsb(char* pDllName);
 
83
 
 
84
 
 
85
///
 
86
/// \brief Returns The number of available ports.
 
87
///
 
88
/// \return The number of available ports or error code.
 
89
///
 
90
PFCONFIG_API int pfGetNumPort(void);
 
91
 
 
92
 
 
93
///
 
94
/// \brief Returns the current port information of the given port. 
 
95
///     The port information is returned in the following structure:
 
96
///     "Portnumber, Manufactor, Portname, Version, Type". The  
 
97
///     parameters are summarized in a string and separated by a comma.
 
98
/// \param[in] iPort Port number [0...(NumPort-1)].
 
99
///
 
100
/// \return A pointer to a string containing the port description.
 
101
///
 
102
PFCONFIG_API const char* pfGetPortInfo(int iPort);
 
103
 
 
104
 
 
105
///
 
106
/// \brief Returns the current property description by the given token ID.  
 
107
/// A full list with all properties will be created when the pfOpenPort()  
 
108
/// gets called. Use the function pfGetNumProperties() to get the total 
 
109
/// number of available properties made available from the connected camera.
 
110
/// \param[in] iPort Port number [0...(NumPort-1)].
 
111
/// \param[out] iProperty Property token ID [0...(NumProperties-1)].
 
112
/// \param[out] iPropType The type of the property.
 
113
/// Following types are supported by Library
 
114
/// 2 : Integer
 
115
/// 3 : Float
 
116
/// 4 : Bool
 
117
/// 5 : Mode
 
118
/// 7 : String
 
119
/// 8 : Command
 
120
 
 
121
/// \param[in] iPropFlag The property flags.
 
122
/// These flags are queried via pfProperty_GetFlags().
 
123
/// 0 : Readable/Writeable
 
124
/// 2 : Property is private
 
125
/// 4 : Big endian, if Register node (not used)
 
126
/// 16 : Readonly
 
127
/// 32 : Writeonly
 
128
/// 64 : Property is currently inactive
 
129
 
 
130
///
 
131
/// \return A pointer to a string with the property description from the given ID.
 
132
///
 
133
PFCONFIG_API const char* pfGetPropertyInfo(int iPort, int iProperty, int* iPropType, int* iPropFlag);
 
134
 
 
135
 
 
136
///
 
137
/// \brief Returns The number of available camera properties.
 
138
/// \param[in] iPort Port number [0...(NumPort-1)].
 
139
///
 
140
/// \return The number of available camera properties or error code.
 
141
///
 
142
PFCONFIG_API int pfGetNumProperties(int iPort);
 
143
 
 
144
 
 
145
///
 
146
/// \brief Returns the latest error message. This function should be called
 
147
/// if the return code of any function is unlike 0. Please refer to the pflib
 
148
/// documentation for a detailed description of all error codes.
 
149
/// \param[in] iPort Port number [0...(NumPort-1)].
 
150
///
 
151
/// \return Pointer to the latest error message.
 
152
///
 
153
PFCONFIG_API const char* pfGetErrorMsg(int iPort);
 
154
 
 
155
 
 
156
///
 
157
/// \brief Close the camera port if there is any open port.
 
158
/// \param[in] iPort Port number [0...(NumPort-1)].
 
159
///
 
160
/// \return Error code or 0 if port successfully closed.
 
161
///
 
162
PFCONFIG_API int pfClosePort(int iPort);
 
163
 
 
164
 
 
165
///
 
166
/// \brief Open the camera port from the given port ID.
 
167
///
 
168
/// \param[in] iPort The camera port number to open for communicaton.
 
169
/// \param[in] iCheckHigherBaudrate Check if the camera supports a higher baudrate than 9600.
 
170
///  If the camera supports a higher baudrate switch to 57600bps.
 
171
/// \return Error code or 0 if port successfully opened.
 
172
///
 
173
PFCONFIG_API int pfOpenPort(int iPort, int iCheckHigherBaudrate=false);
 
174
 
 
175
 
 
176
///
 
177
/// \brief Sets the given camera property value.
 
178
/// \param[in] iPort Port number [0...(NumPort-1)].
 
179
/// \param[in] pProperty The camera property name to set.
 
180
/// \param[in] pValue The string value to set.
 
181
///
 
182
/// \return Return 0 if property has been successfully write.
 
183
///                     Otherwise return Error code.            
 
184
///
 
185
PFCONFIG_API int pfSetCameraPropertyS(int iPort, const char* pProperty, const char* pValue);
 
186
 
 
187
 
 
188
///
 
189
/// \brief Gets the given camera property value.
 
190
/// \param[in] iPort Port number [0...(NumPort-1)].
 
191
/// \param[in] pProperty The camera property name to read.
 
192
/// \param[in] pValue The string (pointer) to save the property value.
 
193
/// \param[in] iSize The maximum memory size for the property to save.
 
194
///
 
195
/// \return Return 0 if property has been successfully read.
 
196
///                     Otherwise return Error code.
 
197
///
 
198
PFCONFIG_API int pfGetCameraPropertyS(int iPort, const char* pProperty, char* pValue, int iSize);
 
199
 
 
200
 
 
201
///
 
202
/// \brief Sets the given camera property value.
 
203
/// \param[in] iPort Port number [0...(NumPort-1)].
 
204
/// \param[in] pProperty The camera property name to set.
 
205
/// \param[in] fValue The floating value to set.
 
206
///
 
207
/// \return Return 0 if property has been successfully write.
 
208
///                     Otherwise return Error code.
 
209
///
 
210
PFCONFIG_API int pfSetCameraPropertyF(int iPort, const char* pProperty, float fValue);
 
211
 
 
212
 
 
213
///
 
214
/// \brief Gets the given camera property value.
 
215
/// \param[in] iPort Port number [0...(NumPort-1)].
 
216
/// \param[in] pProperty The camera property to set.
 
217
///
 
218
/// \return Property floating value if property has been successfully read.
 
219
///                     Otherwise return Error code.
 
220
///
 
221
PFCONFIG_API float pfGetCameraPropertyF(int iPort, const char* pProperty);
 
222
 
 
223
 
 
224
///
 
225
/// \brief Gets the given camera property value.
 
226
/// \param[in] iPort Port number [0...(NumPort-1)].
 
227
/// \param[in] pProperty The camera property to set.
 
228
/// \param[in] fValue Property floating value.
 
229
///
 
230
/// \return Return 0 if property has been successfully read.
 
231
///                     Otherwise return Error code.
 
232
///
 
233
PFCONFIG_API int pfGetCameraPropertyFloat(int iPort, const char* pProperty, float *fValue);
 
234
 
 
235
 
 
236
///
 
237
/// \brief Sets the given camera property value.
 
238
/// \param[in] iPort Port number [0...(NumPort-1)].
 
239
/// \param[in] pProperty The camera property name to set.
 
240
/// \param[in] iValue The integer value to set.
 
241
///
 
242
/// \return Return 0 if property has been successfully write.
 
243
///                     Otherwise return Error code.
 
244
///
 
245
PFCONFIG_API int pfSetCameraPropertyI(int iPort, const char* pProperty, int iValue);
 
246
 
 
247
 
 
248
///
 
249
/// \brief Gets the given camera property value.
 
250
/// \param[in] iPort Port number [0...(NumPort-1)].
 
251
/// \param[in] pProperty The camera property name to set.
 
252
///
 
253
/// \return Property integer value if property has been successfully read.
 
254
///                     Otherwise return Error code.
 
255
///
 
256
PFCONFIG_API int pfGetCameraPropertyI(int iPort, const char *pProperty);
 
257
 
 
258
 
 
259
///
 
260
/// \brief Gets the given camera property value.
 
261
/// \param[in] iPort Port number [0...(NumPort-1)].
 
262
/// \param[in] pProperty The camera property name to set.
 
263
/// \param[in] iValue Property integer value.
 
264
///
 
265
/// \return Return 0 if property has been successfully read.
 
266
///                     Otherwise return Error code.
 
267
///
 
268
PFCONFIG_API int pfGetCameraPropertyInt(int iPort, const char *pProperty, int *iValue);