Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bumblebee2.h
1 
2 /***************************************************************************
3  * bumblebee2.h - Point Grey Bumblebee 2 camera
4  *
5  * Generated: Sat Apr 14 20:49:20 2007 (watching Ghostbusters)
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_CAMS_BUMBLEBEE2_H_
25 #define __FIREVISION_CAMS_BUMBLEBEE2_H_
26 
27 #include <fvcams/firewire.h>
28 #include <fvutils/color/bayer.h>
29 
30 namespace firevision {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
35 class Bumblebee2CameraData;
36 
38 {
39  public:
40 
41  static const unsigned int ORIGINAL;
42  static const unsigned int DEINTERLACED;
43  static const unsigned int RGB_IMAGE;
44 
46  virtual ~Bumblebee2Camera();
47 
48  virtual void open();
49  virtual void close();
50  virtual void capture();
51 
52  virtual unsigned char* buffer();
53 
54  virtual void set_image_number(unsigned int image_num);
55 
56  bool is_bumblebee2();
57  void write_triclops_config_from_camera_to_file(const char *filename);
58 
59  void deinterlace_stereo();
60  void decode_bayer();
61 
62  virtual void print_info();
63  virtual uint32_t serial_no() const;
64  virtual bool verify_guid(uint64_t ver_guid) const;
65 
66  static void deinterlace_stereo(unsigned char *raw16, unsigned char *deinterlaced,
67  unsigned int width, unsigned int height);
68  static void decode_bayer(unsigned char *deinterlaced, unsigned char *rgb,
69  unsigned int width, unsigned int height,
70  bayer_pattern_t bayer_pattern);
71 
72  private:
73  void get_triclops_context_from_camera();
74  void get_bayer_tile();
75  void deinterlace_green( unsigned char* src, unsigned char* dest,
76  unsigned int width, unsigned int height);
77 
78 
79  /** Bayer pattern */
80  dc1394color_filter_t __bayer_pattern;
81 
82  unsigned int __image_num;
83  unsigned char *__buffer;
84  unsigned char *__buffer_deinterlaced;
85  unsigned char *__buffer_rgb;
86 };
87 
88 } // end namespace firevision
89 
90 #endif