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
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _PVIDEOIO1394DC
00037
00038 #define _PVIDEOIO1394DC
00039
00040 #ifdef __GNUC__
00041 #pragma interface
00042 #endif
00043
00044 #include <libraw1394/raw1394.h>
00045 #include <libdc1394/dc1394_control.h>
00046
00050 class PVideoInput1394DcDevice : public PVideoInputDevice
00051 {
00052 PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
00053 public:
00056 PVideoInput1394DcDevice();
00057
00060 ~PVideoInput1394DcDevice();
00061
00064 BOOL Open(
00065 const PString & deviceName,
00066 BOOL startImmediate = TRUE
00067 );
00068
00071 BOOL IsOpen();
00072
00075 BOOL Close();
00076
00079 BOOL Start();
00080
00083 BOOL Stop();
00084
00087 BOOL IsCapturing();
00088
00091 static PStringList GetInputDeviceNames();
00092
00098 PINDEX GetMaxFrameBytes();
00099
00102 BOOL GetFrameData(
00103 BYTE * buffer,
00104 PINDEX * bytesReturned = NULL
00105 );
00106
00109 BOOL GetFrameDataNoDelay(
00110 BYTE * buffer,
00111 PINDEX * bytesReturned = NULL
00112 );
00113
00114
00117 int GetBrightness();
00118
00121 BOOL SetBrightness(unsigned newBrightness);
00122
00123
00126 int GetWhiteness();
00127
00130 BOOL SetWhiteness(unsigned newWhiteness);
00131
00132
00135 int GetColour();
00136
00139 BOOL SetColour(unsigned newColour);
00140
00141
00144 int GetContrast();
00145
00148 BOOL SetContrast(unsigned newContrast);
00149
00150
00153 int GetHue();
00154
00157 BOOL SetHue(unsigned newHue);
00158
00159
00162 BOOL GetParameters (int *whiteness, int *brightness,
00163 int *colour, int *contrast, int *hue);
00164
00167 BOOL GetFrameSizeLimits(
00168 unsigned & minWidth,
00169 unsigned & minHeight,
00170 unsigned & maxWidth,
00171 unsigned & maxHeight
00172 ) ;
00173
00174 void ClearMapping();
00175
00176 int GetNumChannels();
00177 BOOL SetChannel(
00178 int channelNumber
00179 );
00180 BOOL SetFrameRate(
00181 unsigned rate
00182 );
00183 BOOL SetVideoFormat(
00184 VideoFormat videoFormat
00185 );
00186 BOOL SetFrameSize(
00187 unsigned width,
00188 unsigned height
00189 );
00190 BOOL SetColourFormat(
00191 const PString & colourFormat
00192 );
00193
00194
00197 BOOL TestAllFormats();
00198
00204 BOOL SetFrameSizeConverter(
00205 unsigned width,
00206 unsigned height,
00207 BOOL bScaleNotCrop
00208 );
00209
00216 BOOL SetColourFormatConverter(
00217 const PString & colourFormat
00218 );
00219
00220
00221 protected:
00222 raw1394handle_t handle;
00223 BOOL is_capturing;
00224 BOOL UseDMA;
00225 nodeid_t * camera_nodes;
00226 int numCameras;
00227 dc1394_cameracapture camera;
00228 int capturing_duration;
00229 PString desiredColourFormat;
00230 unsigned desiredFrameWidth;
00231 unsigned desiredFrameHeight;
00232 };
00233
00234 #endif
00235
00236
00237