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 #ifndef _PVIDEOIO1394DC
00034
00035 #define _PVIDEOIO1394DC
00036
00037 #ifdef __GNUC__
00038 #pragma interface
00039 #endif
00040
00041 #include <libraw1394/raw1394.h>
00042 #include <libdc1394/dc1394_control.h>
00043
00047 class PVideoInput1394DcDevice : public PVideoInputDevice
00048 {
00049 PCLASSINFO(PVideoInput1394DcDevice, PVideoInputDevice);
00050 public:
00053 PVideoInput1394DcDevice();
00054
00057 ~PVideoInput1394DcDevice();
00058
00061 BOOL Open(
00062 const PString & deviceName,
00063 BOOL startImmediate = TRUE
00064 );
00065
00068 BOOL IsOpen();
00069
00072 BOOL Close();
00073
00076 BOOL Start();
00077
00080 BOOL Stop();
00081
00084 BOOL IsCapturing();
00085
00088 static PStringList GetInputDeviceNames();
00089
00095 PINDEX GetMaxFrameBytes();
00096
00099 BOOL GetFrameData(
00100 BYTE * buffer,
00101 PINDEX * bytesReturned = NULL
00102 );
00103
00106 BOOL GetFrameDataNoDelay(
00107 BYTE * buffer,
00108 PINDEX * bytesReturned = NULL
00109 );
00110
00111
00114 int GetBrightness();
00115
00118 BOOL SetBrightness(unsigned newBrightness);
00119
00120
00123 int GetWhiteness();
00124
00127 BOOL SetWhiteness(unsigned newWhiteness);
00128
00129
00132 int GetColour();
00133
00136 BOOL SetColour(unsigned newColour);
00137
00138
00141 int GetContrast();
00142
00145 BOOL SetContrast(unsigned newContrast);
00146
00147
00150 int GetHue();
00151
00154 BOOL SetHue(unsigned newHue);
00155
00156
00159 BOOL GetParameters (int *whiteness, int *brightness,
00160 int *colour, int *contrast, int *hue);
00161
00164 BOOL GetFrameSizeLimits(
00165 unsigned & minWidth,
00166 unsigned & minHeight,
00167 unsigned & maxWidth,
00168 unsigned & maxHeight
00169 ) ;
00170
00171 void ClearMapping();
00172
00173 int GetNumChannels();
00174 BOOL SetChannel(
00175 int channelNumber
00176 );
00177 BOOL SetFrameRate(
00178 unsigned rate
00179 );
00180 BOOL SetVideoFormat(
00181 VideoFormat videoFormat
00182 );
00183 BOOL SetFrameSize(
00184 unsigned width,
00185 unsigned height
00186 );
00187 BOOL SetColourFormat(
00188 const PString & colourFormat
00189 );
00190
00191
00194 BOOL TestAllFormats();
00195
00201 BOOL SetFrameSizeConverter(
00202 unsigned width,
00203 unsigned height,
00204 BOOL bScaleNotCrop
00205 );
00206
00213 BOOL SetColourFormatConverter(
00214 const PString & colourFormat
00215 );
00216
00217
00218 protected:
00219 raw1394handle_t handle;
00220 BOOL is_capturing;
00221 BOOL UseDMA;
00222 nodeid_t * camera_nodes;
00223 int numCameras;
00224 dc1394_cameracapture camera;
00225 int capturing_duration;
00226 PString desiredColourFormat;
00227 unsigned desiredFrameWidth;
00228 unsigned desiredFrameHeight;
00229 };
00230
00231 #endif
00232
00233
00234