videoio1394dc.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PTLIB_VIDEOIO1394DC_H
00028 #define PTLIB_VIDEOIO1394DC_H
00029
00030 #ifdef __GNUC__
00031 #pragma interface
00032 #endif
00033
00034 #include <libraw1394/raw1394.h>
00035 #include <libdc1394/dc1394_control.h>
00036
00040 class PVideoInput1394DcDevice : public PVideoInputDevice
00041 {
00042 PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
00043 public:
00046 PVideoInput1394DcDevice();
00047
00050 ~PVideoInput1394DcDevice();
00051
00054 PBoolean Open(
00055 const PString & deviceName,
00056 PBoolean startImmediate = PTrue
00057 );
00058
00061 PBoolean IsOpen();
00062
00065 PBoolean Close();
00066
00069 PBoolean Start();
00070
00073 PBoolean Stop();
00074
00077 PBoolean IsCapturing();
00078
00081 static PStringList GetInputDeviceNames();
00082
00088 PINDEX GetMaxFrameBytes();
00089
00092 PBoolean GetFrameData(
00093 BYTE * buffer,
00094 PINDEX * bytesReturned = NULL
00095 );
00096
00099 PBoolean GetFrameDataNoDelay(
00100 BYTE * buffer,
00101 PINDEX * bytesReturned = NULL
00102 );
00103
00104
00107 int GetBrightness();
00108
00111 PBoolean SetBrightness(unsigned newBrightness);
00112
00113
00116 int GetWhiteness();
00117
00120 PBoolean SetWhiteness(unsigned newWhiteness);
00121
00122
00125 int GetColour();
00126
00129 PBoolean SetColour(unsigned newColour);
00130
00131
00134 int GetContrast();
00135
00138 PBoolean SetContrast(unsigned newContrast);
00139
00140
00143 int GetHue();
00144
00147 PBoolean SetHue(unsigned newHue);
00148
00149
00152 PBoolean GetParameters (int *whiteness, int *brightness,
00153 int *colour, int *contrast, int *hue);
00154
00157 PBoolean GetFrameSizeLimits(
00158 unsigned & minWidth,
00159 unsigned & minHeight,
00160 unsigned & maxWidth,
00161 unsigned & maxHeight
00162 ) ;
00163
00164 void ClearMapping();
00165
00166 int GetNumChannels();
00167 PBoolean SetChannel(
00168 int channelNumber
00169 );
00170 PBoolean SetFrameRate(
00171 unsigned rate
00172 );
00173 PBoolean SetVideoFormat(
00174 VideoFormat videoFormat
00175 );
00176 PBoolean SetFrameSize(
00177 unsigned width,
00178 unsigned height
00179 );
00180 PBoolean SetColourFormat(
00181 const PString & colourFormat
00182 );
00183
00184
00187 PBoolean TestAllFormats();
00188
00194 PBoolean SetFrameSizeConverter(
00195 unsigned width,
00196 unsigned height,
00197 PBoolean bScaleNotCrop
00198 );
00199
00206 PBoolean SetColourFormatConverter(
00207 const PString & colourFormat
00208 );
00209
00210
00211 protected:
00212 raw1394handle_t handle;
00213 PBoolean is_capturing;
00214 PBoolean UseDMA;
00215 nodeid_t * camera_nodes;
00216 int numCameras;
00217 dc1394_cameracapture camera;
00218 int capturing_duration;
00219 PString desiredColourFormat;
00220 unsigned desiredFrameWidth;
00221 unsigned desiredFrameHeight;
00222 };
00223
00224
00225 #endif // PTLIB_VIDEOIO1394DC_H
00226
00227
00228