format7.h
Go to the documentation of this file.
1 /* -*- mode: C++ -*- */
2 /* $Id$ */
3 
4 /*********************************************************************
5 * Software License Agreement (BSD License)
6 *
7 * Copyright (c) 2010 Ken Tossell, Jack O'Quin
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials provided
19 * with the distribution.
20 * * Neither the name of the author nor other contributors may be
21 * used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *********************************************************************/
37 
38 #ifndef _FORMAT7_H_
39 #define _FORMAT7_H_
40 
41 #include <sensor_msgs/CameraInfo.h>
42 #include <sensor_msgs/Image.h>
43 
44 #include <dc1394/dc1394.h>
45 
46 #include "camera1394/Camera1394Config.h"
47 typedef camera1394::Camera1394Config Config;
48 
56 /*** @brief Camera1394 Format7 class
57  *
58  * Sets CameraInfo Format7 data from Config updates. Tracks values
59  * and ranges, modifying configured values to those supported by the
60  * device.
61  *
62  */
63 class Format7
64 {
65 public:
66 
68  active_(false),
69  coding_(DC1394_COLOR_CODING_MONO8),
70  maxWidth_(0),
71  maxHeight_(0),
72  binning_x_(0),
73  binning_y_(0),
74  BayerPattern_((dc1394color_filter_t) DC1394_COLOR_FILTER_NUM)
75  {};
76  ~Format7() {};
77 
79  bool active(void)
80  {
81  return active_;
82  }
83  bool start(dc1394camera_t *camera, dc1394video_mode_t mode,
84  Config &newconfig);
85  void stop(void);
86  void unpackData(sensor_msgs::Image &image, uint8_t *capture_buffer);
87  bool checkCameraInfo(const sensor_msgs::CameraInfo &cinfo);
88  void setOperationalParameters(sensor_msgs::CameraInfo &cinfo);
89 
90 private:
91  dc1394color_filter_t findBayerPattern(const char* bayer);
92 
93  bool active_;
94  dc1394color_coding_t coding_;
95  uint32_t maxWidth_;
96  uint32_t maxHeight_;
97 
99  sensor_msgs::RegionOfInterest roi_;
100 
102  uint32_t binning_x_;
103  uint32_t binning_y_;
104 
106  dc1394color_filter_t BayerPattern_;
107 };
108 
109 #endif // _FORMAT7_H_
void unpackData(sensor_msgs::Image &image, uint8_t *capture_buffer)
Definition: format7.cpp:319
void stop(void)
Definition: format7.cpp:310
uint32_t maxHeight_
Definition: format7.h:96
camera1394::Camera1394Config Config
Definition: format7.h:47
dc1394color_filter_t findBayerPattern(const char *bayer)
Definition: format7.cpp:507
dc1394color_coding_t coding_
Definition: format7.h:94
bool start(dc1394camera_t *camera, dc1394video_mode_t mode, Config &newconfig)
Definition: format7.cpp:59
uint32_t maxWidth_
Definition: format7.h:95
bool active(void)
Definition: format7.h:79
uint32_t binning_y_
Definition: format7.h:103
bool active_
Definition: format7.h:93
dc1394color_filter_t BayerPattern_
Definition: format7.h:106
void setOperationalParameters(sensor_msgs::CameraInfo &cinfo)
Definition: format7.cpp:464
uint32_t binning_x_
Definition: format7.h:102
camera1394::Camera1394Config Config
Definition: driver1394.h:53
bool checkCameraInfo(const sensor_msgs::CameraInfo &cinfo)
Definition: format7.cpp:430
sensor_msgs::RegionOfInterest roi_
Definition: format7.h:99
~Format7()
Definition: format7.h:76
Format7()
Definition: format7.h:67


camera1394
Author(s): Jack O'Quin, Ken Tossell, Patrick Beeson, Nate Koenig, Andrew Howard, Damien Douxchamps, Dan Dennedy
autogenerated on Mon Jun 10 2019 12:52:31