format7.h
Go to the documentation of this file.
1 /* -*- mode: C++ -*- */
2 /* $Id: format7.h 35691 2011-02-02 04:28:58Z joq $ */
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 "camera1394stereo/Camera1394StereoConfig.h"
47 typedef camera1394stereo::Camera1394StereoConfig 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  {};
75  ~Format7() {};
76 
78  bool active(void)
79  {
80  return active_;
81  }
82  bool start(dc1394camera_t *camera, dc1394video_mode_t mode,
83  Config &newconfig);
84  void stop(void);
85  void unpackData(sensor_msgs::Image &image, uint8_t *capture_buffer);
86  bool checkCameraInfo(const sensor_msgs::CameraInfo &cinfo);
87  void setOperationalParameters(sensor_msgs::CameraInfo &cinfo);
88 
89 private:
90 
91  bool active_;
92  dc1394color_coding_t coding_;
93  uint32_t maxWidth_;
94  uint32_t maxHeight_;
95 
97  sensor_msgs::RegionOfInterest roi_;
98 
100  uint32_t binning_x_;
101  uint32_t binning_y_;
102 
104  dc1394color_filter_t BayerPattern_;
105 };
106 
107 #endif // _FORMAT7_H_
void unpackData(sensor_msgs::Image &image, uint8_t *capture_buffer)
camera1394stereo::Camera1394StereoConfig Config
void stop(void)
uint32_t maxHeight_
Definition: format7.h:94
dc1394color_coding_t coding_
Definition: format7.h:92
bool start(dc1394camera_t *camera, dc1394video_mode_t mode, Config &newconfig)
uint32_t maxWidth_
Definition: format7.h:93
bool active(void)
Definition: format7.h:78
uint32_t binning_y_
Definition: format7.h:101
bool active_
Definition: format7.h:91
camera1394stereo::Camera1394StereoConfig Config
Definition: format7.h:47
dc1394color_filter_t BayerPattern_
Definition: format7.h:104
void setOperationalParameters(sensor_msgs::CameraInfo &cinfo)
uint32_t binning_x_
Definition: format7.h:100
bool checkCameraInfo(const sensor_msgs::CameraInfo &cinfo)
sensor_msgs::RegionOfInterest roi_
Definition: format7.h:97
~Format7()
Definition: format7.h:75
Format7()
Definition: format7.h:67


camera1394stereo
Author(s): Joan Pau Beltran
autogenerated on Mon Jun 10 2019 12:52:45