56 #include <1394Camera.h> 93 int i, number_of_cameras;
100 cam =
new C1394Camera();
102 if (!cam->CheckLink())
104 number_of_cameras = cam->GetNumberCameras();
139 if (cam->CheckLink())
147 cam->SelectCamera(i);
149 #ifndef CMU1394_Version_645 150 cam->m_cameraInitialized =
false;
153 #ifndef CMU1394_Version_645 154 cam->InquireControlRegisters();
163 for (format = 0; format < 3; format++)
167 for (rate = 5; rate >= 0; rate--)
169 #ifdef CMU1394_Version_645 170 if (cam->HasVideoFrameRate(format,
mode, rate))
172 if (cam->m_videoFlags[format][
mode][rate])
190 #ifdef CMU1394_Version_645 205 cam->SetVideoFormat(format);
206 cam->SetVideoMode(
mode);
207 cam->SetVideoFrameRate(rate);
209 if (cam->StartImageAcquisition() != CAM_SUCCESS)
215 #ifdef CMU1394_Version_645 216 cam->GetVideoFrameDimensions(&w, &h);
220 width = cam->m_width;
262 int i, num_dropped_frames = -1;
270 if (cam->AcquireImageEx(
true, &num_dropped_frames) == CAM_SUCCESS)
283 #ifndef CMU1394_Version_645 285 void CCMU1394Capture::SetFocus(
int nFocus,
int nCamera)
295 printf(
"error: parameter nCamera = %i is out of bounds (%i cameras available)\n", nCamera,
m_nNumberOfCameras);
308 C1394CameraControl *pFeature =
m_ppCameras[i]->GetCameraControl(FEATURE_GAIN);
311 pFeature->SetValue(nGain);
313 printf(
"error: feature 'gain' not available for camera %i in CCMU1394Capture::SetGain\n", i);
319 printf(
"error: parameter nCamera = %i is out of bounds (%i cameras available) in CCMU1394Capture::SetGain\n", nCamera,
m_nNumberOfCameras);
322 C1394CameraControl *pFeature =
m_ppCameras[nCamera]->GetCameraControl(FEATURE_GAIN);
325 pFeature->SetValue(nGain);
327 printf(
"error: feature 'gain' not available for camera %i in CCMU1394Capture::SetGain\n", nCamera);
340 C1394CameraControl *pFeature =
m_ppCameras[i]->GetCameraControl(FEATURE_GAIN);
343 pFeature->SetValue(nShutter);
345 printf(
"error: feature 'shutter' not available for camera %i in CCMU1394Capture::SetShutter\n", i);
351 printf(
"error: parameter nCamera = %i is out of bounds (%i cameras available) in CCMU1394Capture::SetShutter\n", nCamera,
m_nNumberOfCameras);
354 C1394CameraControl *pFeature =
m_ppCameras[nCamera]->GetCameraControl(FEATURE_SHUTTER);
357 pFeature->SetValue(nShutter);
359 printf(
"error: feature 'shutter' not available for camera %i in CCMU1394Capture::SetShutter\n", nCamera);
373 C1394CameraControl *pFeature =
m_ppCameras[i]->GetCameraControl((CAMERA_FEATURE) nFeature);
376 pFeature->SetValue(nValue);
378 printf(
"error: feature %i not available for camera %i in CCMU1394Capture::SetFeature\n", nFeature, i);
384 printf(
"error: parameter nCamera = %i is out of bounds (%i cameras available) in CCMU1394Capture::SetFeature\n", nCamera,
m_nNumberOfCameras);
387 C1394CameraControl *pFeature =
m_ppCameras[nCamera]->GetCameraControl((CAMERA_FEATURE) nFeature);
390 pFeature->SetValue(nValue);
392 printf(
"error: feature %i not available for camera %i in CCMU1394Capture::SetFeature\n", nFeature, nCamera);
void SetFeature(int nFeature, int nValue, int nCamera=-1)
bool CaptureImage(CByteImage **ppImages)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
void SetGain(int nGain, int nCamera=-1)
void SetShutter(int nShutter, int nCamera=-1)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLenum GLsizei GLsizei height
C1394Camera ** m_ppCameras
GLenum GLsizei GLenum format
GLubyte GLubyte GLubyte GLubyte w
CCMU1394Capture(int nFormat=-1, int nMode=-1, int nRate=-1, int nCameras=1)