Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VideoSource_DCAM.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #ifndef __BIASVIDEOSOURCE_DCAM_HH__
26 #define __BIASVIDEOSOURCE_DCAM_HH__
27 
28 #include <bias_config.h>
29 #include <string>
30 
31 #if defined(WIN32) && !defined(BIAS_HAVE_1394CAMERACMU)
32 # error You need 1394CAMERACMU for BIAS Videosource_DCAM. Please recompile BIAS with USE_1394CAMERACMU.
33 #endif
34 
35 #if !defined(WIN32) && !defined(BIAS_HAVE_DC1394)
36 # error You need DC1394 for BIAS Videosource_DCAM. Please recompile BIAS with USE_DC1394.
37 #endif
38 
39 // consistency check, DCAM is set if one of the above is set
40 #if !defined(BIAS_HAVE_1394CAMERACMU) && !defined(BIAS_HAVE_DC1394)
41 # error You need either DC1394 or 1394CameraCMU for BIAS Videosource_DCAM. Please recompile BIAS with one of them.
42 #endif
43 
44 
45 
46 
47 #include <Base/Common/W32Compat.hh>
48 
49 #ifndef WIN32
50 # include <sys/time.h>
51 #endif
52 #ifdef BIAS_HAVE_PTHREADS
53 # include <pthread.h>
54 #endif
55 
56 #include <Image/Camera.hh>
57 
58 #ifdef WIN32
59 # include <1394Camera.h>
60 //typedef unsigned long long int u_int64_t;
61 typedef unsigned long long int uint64_t;
62 #else
63 # include <dc1394/control.h>
64 # include <dc1394/utils.h>
65 #endif
66 
67 #include <VideoSource/VideoSource_Base.hh>
68 
69 // only this number of cards are probed
70 #ifndef MAX_1394_CARDS
71 #define MAX_1394_CARDS 2
72 #endif
73 
74 #define MAX_1394_SOURCES 16
75 #ifndef MAX_1394_CHANNELS
76 #define MAX_1394_CHANNELS 256
77 #endif
78 
79 #define MAX_DMABUFFERS 10
80 
81 
82 
83 
84 namespace BIAS {
85 
86 #ifdef WIN32
87  enum dc_videomode;
88  typedef dc_videomode dc1394video_mode_t;
89 #endif
90 
91 /**
92  * \struct CameraParameter_s
93  * \brief Stores the camera parameters such as Shutter, Gain, etc.
94  * Only used internally in VideoSource_DCAM
95  */
96 typedef struct CameraParameter_s
97 {
98  // these are the real parameters
99  float Shutter;
100  float Gain;
101  unsigned int WhiteBalance;
103  bool AutoGain;
105  unsigned char Sharpen;
106  unsigned char GammaMode;
107  unsigned char OpticalFilter;
108 
109  // these bools describe active changes
119 
120  // one-push action
122 
124 
125 /**
126  * \struct CameraInfo_s
127  * \brief Stores camera information such as model, vendor, framerates.
128  * Only used internally in VideoSource_DCAM
129  */
130 typedef struct CameraInfo_s
131 {
132  int camid;
133  std::string vendor;
134  std::string model;
135  std::vector<std::vector<float> > framerates;
136  bool b_capable;
138 #ifdef WIN32
139  BIAS::dc1394video_mode_t bestMode;
140  std::vector<BIAS::dc1394video_mode_t> videoModes;
141  std::vector<BIAS::dc1394video_mode_t> f7_modes;
142  LARGE_INTEGER guid;
143 #else
144  dc1394video_mode_t bestMode;
145  std::vector<dc1394video_mode_t> videoModes;
146  std::vector<dc1394video_mode_t> f7_modes;
147  uint64_t guid;
148 #endif
149  std::vector<unsigned int> f7_maxWidth;
150  std::vector<unsigned int> f7_maxHeight;
151  std::vector<unsigned int> f7_unitWidth;
152  std::vector<unsigned int> f7_unitHeight;
153  std::vector<unsigned int> f7_MinBpP;
154  std::vector<unsigned int> f7_MaxBpP;
155  std::vector<unsigned int> f7_bestBpP;
156 }CameraInfo;
157 
158 
159 /// support function to get the number of cameras and IDs of all cameras on one bus
160 extern int BIASVideoSource_EXPORT ScanBus(std::stringstream &ofs);
161 extern int BIASVideoSource_EXPORT ScanBus(std::vector<CameraInfo> &camInfos);
162 /**
163  * \enum CameraModel_e
164  * \brief Enumeration for the known IEEE1394 camera models
165  * Only used internally in VideoSource_DCAM
166  */
167 typedef enum CameraModel_e
168 {
169  CAMERA_SONY_DFW_X700 = 0, //IEEE1394
181  CAMERA_SONY_EVID31, //analog via frame grabber, PTZ-camera
188 } CameraModel;
189 
190 /**
191  * \enum LensModel_e
192  * \brief Enumeration for the known lenses for IEEE1394 cameras
193  * Only used internally in VideoSource_DCAM
194  */
195 typedef enum LensModel_e{
202 } LensModel;
203 
204 
205 #ifdef WIN32
206  /**\enum dc1394feature_t
207  * \brief only define these values in windows. In linux they are defined
208  * in dc1394/control.h (NOT in namespace BIAS) */
209  typedef enum dc1394feature_t{
210  DC1394_FEATURE_BRIGHTNESS,
211  DC1394_FEATURE_EXPOSURE,
212  DC1394_FEATURE_SHARPNESS,
213  DC1394_FEATURE_WHITE_BALANCE,
214  DC1394_FEATURE_HUE,
215  DC1394_FEATURE_SATURATION,
216  DC1394_FEATURE_GAMMA,
217  DC1394_FEATURE_SHUTTER,
218  DC1394_FEATURE_GAIN,
219  DC1394_FEATURE_IRIS,
220  DC1394_FEATURE_FOCUS,
221  DC1394_FEATURE_TEMPERATURE,
222  DC1394_FEATURE_TRIGGER,
223  DC1394_FEATURE_ZOOM,
224  DC1394_FEATURE_PAN,
225  DC1394_FEATURE_TILT,
226  DC1394_FEATURE_OPTICAL_FILTER,
227  DC1394_FEATURE_CAPTURE_SIZE,
228  DC1394_FEATURE_CAPTURE_QUALITY
229  } ;
230 
231  /**\enum dc1394feature_mode_t
232  * \brief only define these values in windows. In linux they are defined
233  * in dc1394/control.h (NOT in namespace BIAS) */
234  typedef enum dc1394feature_mode_t{
235  DC1394_FEATURE_MODE_AUTO,
236  DC1394_FEATURE_MODE_MANUAL
237  };
238 
239  /**\enum dc1394color_coding_t
240  * \brief only define these values in windows. In linux they are defined
241  * in dc1394/control.h (NOT in namespace BIAS) */
242  typedef enum dc1394color_coding_t{
243  DC1394_COLOR_CODING_MONO8= 352,
244  DC1394_COLOR_CODING_YUV411,
245  DC1394_COLOR_CODING_YUV422,
246  DC1394_COLOR_CODING_YUV444,
247  DC1394_COLOR_CODING_RGB8,
248  DC1394_COLOR_CODING_MONO16,
249  DC1394_COLOR_CODING_RGB16,
250  DC1394_COLOR_CODING_MONO16S,
251  DC1394_COLOR_CODING_RGB16S,
252  DC1394_COLOR_CODING_RAW8,
253  DC1394_COLOR_CODING_RAW16
254  } ;
255 
256 #define FEATURE_MIN FEATURE_BRIGHTNESS
257 #define FEATURE_MAX FEATURE_CAPTURE_QUALITY
258 #define NUM_FEATURES (FEATURE_MAX - FEATURE_MIN + 1)
259 
260 
261  /**\enum dc_videomode
262  * \brief Enumeration of video modes. Only define these values in windows.
263  * In linux they are defined in dc1394/control.h (NOT in namespace BIAS) */
264  typedef enum dc_videomode{
265  DC1394_VIDEO_MODE_160x120_YUV444= 64,
266  DC1394_VIDEO_MODE_320x240_YUV422,
267  DC1394_VIDEO_MODE_640x480_YUV411,
268  DC1394_VIDEO_MODE_640x480_YUV422,
269  DC1394_VIDEO_MODE_640x480_RGB8,
270  DC1394_VIDEO_MODE_640x480_MONO8,
271  DC1394_VIDEO_MODE_640x480_MONO16,
272  DC1394_VIDEO_MODE_800x600_YUV422,
273  DC1394_VIDEO_MODE_800x600_RGB8,
274  DC1394_VIDEO_MODE_800x600_MONO8,
275  DC1394_VIDEO_MODE_1024x768_YUV422,
276  DC1394_VIDEO_MODE_1024x768_RGB8,
277  DC1394_VIDEO_MODE_1024x768_MONO8,
278  DC1394_VIDEO_MODE_800x600_MONO16,
279  DC1394_VIDEO_MODE_1024x768_MONO16,
280  DC1394_VIDEO_MODE_1280x960_YUV422,
281  DC1394_VIDEO_MODE_1280x960_RGB8,
282  DC1394_VIDEO_MODE_1280x960_MONO8,
283  DC1394_VIDEO_MODE_1600x1200_YUV422,
284  DC1394_VIDEO_MODE_1600x1200_RGB8,
285  DC1394_VIDEO_MODE_1600x1200_MONO8,
286  DC1394_VIDEO_MODE_1280x960_MONO16,
287  DC1394_VIDEO_MODE_1600x1200_MONO16,
288  DC1394_VIDEO_MODE_EXIF,
289  DC1394_VIDEO_MODE_FORMAT7_0,
290  DC1394_VIDEO_MODE_FORMAT7_1,
291  DC1394_VIDEO_MODE_FORMAT7_2,
292  DC1394_VIDEO_MODE_FORMAT7_3,
293  DC1394_VIDEO_MODE_FORMAT7_4,
294  DC1394_VIDEO_MODE_FORMAT7_5,
295  DC1394_VIDEO_MODE_FORMAT7_6,
296  DC1394_VIDEO_MODE_FORMAT7_7
297  };
298 
299  //typedef video_mode dc1394video_mode_t;
300 
301  #define DC1394_VIDEO_MODE_MIN DC1394_VIDEO_MODE_160x120_YUV444
302  #define DC1394_VIDEO_MODE_MAX DC1394_VIDEO_MODE_FORMAT7_7
303  #define DC1394_VIDEO_MODE_NUM (DC1394_VIDEO_MODE_MAX - DC1394_VIDEO_MODE_MIN + 1)
304 
305  // Special min/max are defined for Format_7
306  #define DC1394_VIDEO_MODE_FORMAT7_MIN DC1394_VIDEO_MODE_FORMAT7_0
307  #define DC1394_VIDEO_MODE_FORMAT7_MAX DC1394_VIDEO_MODE_FORMAT7_7
308  #define DC1394_VIDEO_MODE_FORMAT7_NUM (DC1394_VIDEO_MODE_FORMAT7_MAX - DC1394_VIDEO_MODE_FORMAT7_MIN + 1)
309 
310 #endif // WIN32
311 
312  /**
313  \class VideoSource_DCAM
314  \ingroup g_videosource
315  \author evers/angerer
316 
317  \brief This class VideoSource_DCAM implements access to IEEE1394 (Firewire, iLink)
318  cameras following the DCam 2.0 standard protocol.
319  */
320  class BIASVideoSource_EXPORT VideoSource_DCAM : public VideoSource{
321 
322  public:
323  /**
324  @brief Activates the timestamp for PointGrey Scorpion SCOR-20SO
325  */
326  void ActivateScorpionTimestamp();
328 
329  /**
330  @brief Constructor with IEEE1394 card
331  @param Card The IEEE1394 card on which the camera is
332  */
333  VideoSource_DCAM(int Card = 0);
334 
335  /**
336  @brief Destructor
337  */
338  ~VideoSource_DCAM();
339 
340  /**
341  @brief Opens a dc1394 device
342  @return int, <0 on failure, 0 on success
343  */
344  int OpenDevice();
345  /**
346  @brief Opens a dc1394 device with id camid
347  @param camid The camera id of the camera to open
348  @return int, <0 on failure, 0 on success
349  */
350  int OpenDevice(int camid);
351 
352  /**
353  @brief this a special function to by-pass all automatic initializations and
354  Use only in conjuction with SetSize() and SetLeftTop() !
355  */
356  int SetFormat7(int mode, int bpp, dc1394color_coding_t colorCoding = DC1394_COLOR_CODING_MONO8);
357 
358  /**
359  * @brief set's the id of a camera manually, has to be called before OpenDevice()
360  * @param manualcamid_ the unique id of the camera
361  */
362  void SetCam_ID(int manualcamid_);
363 
364  /**
365  @brief closes a camera device and cleans up
366 
367  */
368  int CloseDevice();
369 
370  // evil hack, fixme, please fixme !!! (I forgot the TODO)
371  void SetBinning(bool b) {UseBinning_ = b;};
372 
373 // /**
374 // @brief Select the port (bus-id) to use, only valid before OpenDevice()
375 // @param channel The port (bus-id) to use
376 // @return int, <0 on failure, 0 on success
377 // */
378 // int UsePort(int channel);
379 
380  /**
381  * @brief fetches one image from the camera and writes it int a Camera structure
382  * @param &image the Camera structure to write the image from the camera in
383  * @return int, <0 on failure, 0 on success
384  */
385  int GrabSingle(BIAS::Camera <unsigned char> &image);
386 #ifdef BUILD_IMAGE_USHORT
387  int GrabSingle(BIAS::Camera <unsigned short> &image);
388 #endif
389 #ifdef WIN32
390  /**
391  * @brief make GrabSingle faster, include the converts
392  * @param image
393  * @return int, <0 on failure, 0 on success
394  */
395  int GrabSingleAndConvert(BIAS::Image <unsigned char> *dest, enum ImageBase::EColorModel targetColorModel);
396  /**
397  * @brief make GrabSingle more faster for grey, no Bayer conversation
398  * @param image
399  * @return int, <0 on failure, 0 on success
400  */
401  int GrabSingleAndConvertForGrey(BIAS::Image <unsigned char> *dest);
402 
403 #endif
404  /**
405  * @brief initializes the iso transmission of a camera. this has to be called
406  * before capturing any image
407  *
408  * @return int, <0 on failure, 0 on success
409  */
410  int PreGrab();
411 
412  /**
413  * @brief stops iso transmission of a camera. this has to be called
414  * after capturing any image
415  *
416  * @return int, <0 on failure, 0 on success
417  */
418  int PostGrab();
419 
420  //int ShowCapabilities();
421  /**
422  * @brief set the shutter to auto or manual mode
423  * @param b true if the shutter should be set to auto mode, false if not
424  */
425  void SetAutoShutter(bool b);
426 
427  /**
428  * @return returns true if the shutter is set to automode, false if not
429  */
430  bool GetAutoShutter();
431 
432  /**
433  * @brief set the gain to auto or manual mode
434  * @param b true if the gain should be set to auto mode, false if not
435  */
436  void SetAutoGain(bool b);
437 
438 
439  void SetAutoBrightness(bool b);
440 
441  bool GetAutoBrightness();
442 
443  /**
444  * @return returns true if the gain is set to automode, false if not
445  */
446  bool GetAutoGain();
447 
448  /**
449  @brief Set a camera feature to auto or to manual mode
450  @param feature the feature to set
451  @param mode the mode to set as enum, use DC1394_FEATURE_MODE_AUTO for auto mode
452  or DC1394_FEATURE_MODE_MANUAL for manual mode
453  @return int, <0 on failure, 0 on success;
454  */
455  int AutoMode( dc1394feature_t feature, dc1394feature_mode_t mode);
456 
457  /**
458  @brief Set a camera feature by hand
459  @param feature the feature to set
460  @param value the value to be set for the feature feature
461  @return int, <0 on failure, 0 on success
462  */
463  int SetFeature(dc1394feature_t feature, unsigned int value);
464 
465  /**
466  @brief get the value of a specific feature
467  @param feature the feature of which the value should be requested
468  @return unsigned int, the value of the feature
469  */
470  unsigned int GetFeature( dc1394feature_t feature);
471 
472  /**
473  @brief
474  @param feature the feature to set one push automode for
475  @return int, <0 on failure, 0 on success
476  */
477  int OnePushAuto(dc1394feature_t feature);
478 
479 #ifndef WIN32
480  /**
481  * @brief is a feature available at OnePush?
482  * @return returns true, if the feature is available at OnePush mode
483  */
484  bool OnePushRunning(dc1394feature_t feature);
485 
486  /**
487  * @brief selects the colormodel for a specific mode
488  * @param videoMode the videomode to find the colormodel for
489  * @return int, <0 on failure, 0 on success
490  */
491  int SetColorFromMode_(dc1394video_mode_t videoMode);
492 #else
493  int SetColorFromMode_();
494  dc1394video_mode_t FormatAndModeToEnum(int Format, int Mode);
495 #endif
496 
497  bool HasControlShutter(){return true;};
498  bool HasControlGain(){return true;};
499  bool HasControlBrightness(){return true;};
500  bool HasControlWhiteBalance(){return true;};
501 
502  /**
503  * @brief set value for shutter
504  * @param exptime Exposuretime in milliseconds
505  * @return int <0 on failure, 0 on success
506  */
507  int SetShutter(float exptime);
508 
509  /**
510  * @brief get the value of the shutter feature
511  * @return float returns the shutter value
512  */
513  float GetShutter();
514 
515  /**
516  * @brief set value for gain
517  * @param g gain in dB
518  * @return int, <0 on failure, 0 on success
519  */
520  int SetGain(float g);
521 
522  /**
523  * @brief get the value of the gain feature
524  * @return float returns the gain value
525  */
526  float GetGain();
527 
528 
529  /**
530  * @brief set value for brightness
531  * @param b brightness
532  * @return int, <0 on failure, 0 on success
533  */
534  int SetBrightness(float b);
535 
536  /**
537  * @brief get the value of the brightness feature
538  * @return float returns the brightness value
539  */
540  float GetBrightness();
541 
542  /**
543  * @brief sets the white balance of the camera,
544  * rvalue and bvalue are in range -0.5 to 0.5
545  * @param rvalue
546  * @param bvalue
547  * @return int, <0 on failure, 0 on success
548  */
549  int SetWhiteBalance(float rvalue,float bvalue);
550 
551 
552  /**
553  * @brief set Gamma Mode
554  * @param g the gamma mode as unsigned char
555  * @return int, <0 on failure, 0 on success
556  */
557  int SetGammaMode(int g);
558 
559 
560  /**
561  * @brief set External Trigger mode, overrides Base class function
562  * @param trigger, bool to activate or deactivate trigger
563  */
564  void SetExternalTrigger(bool trigger = true);
565 
566  /**
567  * @brief get the value of Gamma Mode
568  * @return unsigned char, returns the value of Gamma Mode
569  */
570  int GetGammaMode();
571 
572 
573  // format7 specific methods
574  inline unsigned int GetTop(){return Top_;};
575  inline unsigned int GetLeft(){return Left_;};
576 
577 
578  /**
579  * @brief set the topleft corner for partitial scan
580  * @param left distance from left
581  * @param top distance from top
582  * @return int, <0 on failure, 0 on success
583  */
584  int SetLeftTop(unsigned int left, unsigned int top);
585 
586  inline int GetTransmissionTime(){return TransmissionTime_;};
587 
588  /**
589  * @brief set camera to parameters specified in complete set
590  * @param camparam the CameraParameterSet with the camera parameters to be set
591  * @return int, <0 on failure, 0 on success
592  */
593  int SetCamera(CameraParameterSet camparam);
594 
595  virtual void SetCameraID(int /*id*/){
596  BIASERR("Can not set camera id for DCams, they are identified automatically");
597  };
598 
599  // void WriteFeatureDetails(int feature, bool *SuppFeatDetails_[])
600 
601  /**
602  * @brief this choses f7 mode even for standard resolution
603  * @param forcef7 true if format 7 should be forced, false if not
604  */
605  void ForceFormat7(bool forcef7) {ForceF7_ =forcef7;}
606 
607  /**
608  * @brief sets the bytes per packet used for format 7
609  * @param b the bytes per packet
610  */
611  void SetBytesPerPacket(const int b){BytesPerPacket_ = b;}
612 
613  void SetModeAndFramerate(dc1394video_mode_t mode, float framerate);
614 
615  void SetFirewireB(bool on);
616 
617  /**
618  * @brief selects the default framerate for a cam
619  * @return int, <0 on failure, 0 on success
620  */
621  int SelectDefault();
622  void EnsureLatestFrame(const bool ensure) {
623  bEnsureLatestFrame_ = ensure;
624  }
625 
626  void GetFormat7ImageDimensions(int &maxWidth, int &maxHeight,
627  int &minBpP, int &maxBpP){
628  maxWidth = MaxWidth_;
629  maxHeight = MaxHeight_;
630  minBpP = MinBpP_;
631  maxBpP = MaxBpP_;
632  };
633 
634  /**
635  * @brief returns min and max bytes per packet for a specified resolution in format 7
636  * @param camid the id of the cam
637  * @param mode the format 7 mode
638  * @param width of the resulting picture
639  * @param height of the resulting picture
640  * @param bppmin here the minimum bytes per packet are stored
641  * @parma bppmax here the maximum bytes per packet are stored
642  */
643  void GetBytesPerPacketForFormat7(int camid, dc1394video_mode_t mode, int width, int height, unsigned int& bppmin, unsigned int& bppmax);
644  /**
645  Sets the Camera model
646  */
647  void SetCameraModel( CameraModel model);
648 
649  /** \brief returns a string from a IEEE1394 video mode*/
650  static std::string VideoModeToString(dc1394video_mode_t mode);
651 
652 
653 
654  protected:
655 
656 
657  /**
658  * @brief if external triggering is true, activate it here in Opendevice
659  * @param trigger true if external trigger should be acticated, false if deactivated
660  * @return int, <0 on failure, 0 on success
661  */
662  int ActivateExternalTrigger_(bool trigger = true);
663 
664  /**
665  * @brief initializes the camera and tries to set the optimal settings for the camera if no settings are specified
666  * @return int, <0 on failure, 0 on success
667  */
668  int InitCam();
669  //int StartIso();
670  //int StopIso();
671 
672  /**
673  * @brief querys the cam for available modes, framerates and features
674  * @return int, <0 on failure, 0 on success
675  */
676  int QueryCam();
677 
678  /**
679  * @brief tries to find a camera mode from user given width and height
680  * @return int, <0 on failure, 0 on success
681  */
682  int UserSizeToMode();
683 
684  /**
685  * @brief for all formats with 16bit per pixel per channel (aka short int)
686  * @return int, <0 on failure, 0 on success
687  */
688  int UserSizeToMode_16bit_();
689 
690  /**
691  * @brief for all formats with standard 8bpp per channel (unsigned char image)
692  * @return int, <0 on failure, 0 on success
693  */
694  int UserSizeToMode_8bit_();
695 
696  /**
697  * @brief if user requested format 7
698  * @return int, <0 on failure, 0 on success
699  */
700  int UserSizeToFormat7_();
701  //void PrintFormatAndMode_();
702 
703  /**
704  * @brief Set this value and read back what really happend.
705  * @return int, <0 on failure, 0 on success
706  */
707  int ApplyBytesPerPacket();
708 
709  /**
710  * @brief Evaluate Min and Max BpP, framesize and fps, then calc BpP
711  * @return unsigned int, returns the bytesperpackage calculated from
712  * Min and Max BpPm, framesize and fps
713  */
714  unsigned int CalcBytesPerPacket();
715 
716  // write file with camera infos and features
717  //void WriteCamInfos_();
718  //void WriteFeatureDetails(int feature, std::ofstream *fout);
719 
720  int ShowCapabilities();
721 
722  // there is only one handle per bus for multiple devices
723 #ifdef WIN32
724  C1394Camera camera;
725  CameraModel GetModelForEuid(LARGE_INTEGER euid);
726  unsigned long DcamFps_;
727  unsigned long DcamMode_;
728 #else // WIN32
729 
730  static int InstancesTotal_;
731 
732  /**
733  * @brief searches for the correct cammodel by means of the euid of a camera
734  * @return CameraModel, returns the CameraModel specified by the euid out of an enum
735  */
736  CameraModel GetModelForEuid(const u_int64_t euid);
737  int camid;
738 
739  dc1394error_t err;
740  dc1394camera_t * camera;
741  dc1394camera_list_t *cameraList;
742  dc1394_t *dcbus;
743  uint32_t numCamsOnBus;
744  dc1394video_modes_t CameraModes_;
745  dc1394framerates_t CameraFramerates_[DC1394_VIDEO_MODE_NUM];
746  dc1394featureset_t DcamFeatures_;
747  dc1394video_mode_t DcamMode_;
748  dc1394framerate_t DcamFps_;
749  dc1394trigger_mode_t Trigger_;
750 #endif // WIN32
751 
752  dc1394color_coding_t f7ColorCoding_;
753 
754  int NumCams_;
757 
760 
761  bool ForceF7_;
762  bool DirectF7_;
763  bool UseDMA_;
767  bool UserMode_;
768 
769  // used to set Format 7 Scalabel Image Size
770  unsigned int MaxWidth_, MaxHeight_, Left_,Top_;
771  unsigned int UnitWidth_, UnitHeight_;
774  unsigned int MaxBpP_, MinBpP_;
776  // time it lasts to transmit one image in usec
778 
779  unsigned char Shift16_; // uses this to shift bits down to normal
783 
784 #ifdef BIAS_HAVE_PTHREADS
785  // guarantee exclusive usage of GrabSingle
786  // (needed for example in SoftwareWhiteBalance)
787  pthread_mutex_t grabMutex_;
788 #endif
789 
790  };
791 
792 
793 } // namespace BIAS
794 
795 
796 #endif // __BIASVIDEOSOURCE_DCAM_HH__
EColorModel
These are the most often used color models.
Definition: ImageBase.hh:127
Stores the camera parameters such as Shutter, Gain, etc.
dc1394video_mode_t DcamMode_
Defines a common interface to different devices.
CameraModel_e
Enumeration for the known IEEE1394 camera models Only used internally in VideoSource_DCAM.
std::vector< std::vector< float > > framerates
std::vector< unsigned int > f7_unitWidth
std::vector< unsigned int > f7_MaxBpP
int BIASVideoSource_EXPORT ScanBus(std::stringstream &ofs)
support function to get the number of cameras and IDs of all cameras on one bus
dc1394trigger_mode_t Trigger_
Stores camera information such as model, vendor, framerates.
void ForceFormat7(bool forcef7)
this choses f7 mode even for standard resolution
enum BIAS::CameraModel_e CameraModel
This class VideoSource_DCAM implements access to IEEE1394 (Firewire, iLink) cameras following the DCa...
Image< unsigned char > * imageintern_
std::vector< unsigned int > f7_unitHeight
void GetFormat7ImageDimensions(int &maxWidth, int &maxHeight, int &minBpP, int &maxBpP)
std::vector< dc1394video_mode_t > videoModes
std::vector< unsigned int > f7_bestBpP
virtual void SetCameraID(int)
std::vector< unsigned int > f7_MinBpP
dc1394color_coding_t f7ColorCoding_
dc1394featureset_t DcamFeatures_
struct BIAS::CameraInfo_s CameraInfo
enum BIAS::LensModel_e LensModel
pthread_mutex_t grabMutex_
void EnsureLatestFrame(const bool ensure)
std::vector< dc1394video_mode_t > f7_modes
std::vector< unsigned int > f7_maxHeight
dc1394framerate_t DcamFps_
void SetBytesPerPacket(const int b)
sets the bytes per packet used for format 7
struct BIAS::CameraParameter_s CameraParameterSet
std::vector< unsigned int > f7_maxWidth
dc1394video_mode_t bestMode
dc1394camera_list_t * cameraList
dc1394video_modes_t CameraModes_
LensModel_e
Enumeration for the known lenses for IEEE1394 cameras Only used internally in VideoSource_DCAM.