featuresstereo.h
Go to the documentation of this file.
1 /* -*- mode: C++ -*- */
2 /* $Id: features.h 30221 2010-06-10 16:03:43Z joq $ */
3 
4 /*********************************************************************
5 * Software License Agreement (BSD License)
6 *
7 * Copyright (c) 2010 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 _FEATURES_H_
39 #define _FEATURES_H_
40 
41 #include <dc1394/dc1394.h>
42 #include "trigger.h"
43 #include "camera1394stereo/Camera1394StereoConfig.h"
44 typedef camera1394stereo::Camera1394StereoConfig Config;
45 
60 class Features
61 {
62 public:
63 
64  Features(dc1394camera_t *camera);
65  ~Features() {};
66  bool initialize(Config *newconfig);
67  void reconfigure(Config *newconfig);
68 
69  inline bool isTriggerPowered()
70  {
71  return trigger_->isPowered();
72  }
73 
74 private:
75  typedef int state_t;
76 
77  void configure(dc1394feature_t feature, int *control,
78  double *value, double *value2=NULL);
79  state_t getState(dc1394feature_info_t *finfo);
80  void getValues(dc1394feature_info_t *finfo,
81  double *value, double *value2);
82 
91  inline bool hasMode(dc1394feature_info_t *finfo, dc1394feature_mode_t mode)
92  {
93  for (uint32_t i = 0; i < finfo->modes.num; ++i)
94  {
95  if (finfo->modes.modes[i] == mode)
96  return true;
97  }
98  return false;
99  }
100 
106  inline bool hasTrigger(void)
107  {
108  return DC1394_TRUE == feature_set_.feature[DC1394_FEATURE_TRIGGER
109  - DC1394_FEATURE_MIN].available;
110  }
111 
112  // pointer to subordinate trigger class
114 
115  bool setMode(dc1394feature_info_t *finfo, dc1394feature_mode_t mode);
116  void setOff(dc1394feature_info_t *finfo);
117  void updateIfChanged(dc1394feature_t feature,
118  int old_control, int *control,
119  double old_value, double *value);
120  void updateIfChanged(dc1394feature_t feature,
121  int old_control, int *control,
122  double old_value, double *value,
123  double old_value2, double *value2);
124 
125  dc1394camera_t *camera_;
126  dc1394featureset_t feature_set_;
128 };
129 
130 #endif // _FEATURES_H_
boost::shared_ptr< Trigger > trigger_
state_t getState(dc1394feature_info_t *finfo)
dc1394featureset_t feature_set_
that camera&#39;s feature set
camera1394stereo::Camera1394StereoConfig Config
dc1394camera_t * camera_
current camera
bool isTriggerPowered()
void reconfigure(Config *newconfig)
void updateIfChanged(dc1394feature_t feature, int old_control, int *control, double old_value, double *value)
bool setMode(dc1394feature_info_t *finfo, dc1394feature_mode_t mode)
void getValues(dc1394feature_info_t *finfo, double *value, double *value2)
void configure(dc1394feature_t feature, int *control, double *value, double *value2=NULL)
bool initialize(Config *newconfig)
bool hasMode(dc1394feature_info_t *finfo, dc1394feature_mode_t mode)
libdc1394 triggering modes interface
bool hasTrigger(void)
Camera1394 Features class.
Features(dc1394camera_t *camera)
void setOff(dc1394feature_info_t *finfo)
int state_t
camera1394::Camera1394_* state values
Config oldconfig_
previous Config settings
camera1394stereo::Camera1394StereoConfig Config


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