Fawkes API  Fawkes Development Version
sony_evid100p.h
1 
2 /***************************************************************************
3  * sony_evid100p_control.h - Controller for Sony EVI-D100P
4  *
5  * Created: Tue Jun 07 15:52:46 2005
6  * Copyright 2005-2009 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_CONTROL_SONYEVID100P_H_
25 #define __FIREVISION_CONTROL_SONYEVID100P_H_
26 
27 #include <fvcams/control/pantilt.h>
28 #include <fvcams/control/zoom.h>
29 #include <fvcams/control/effect.h>
30 
31 namespace firevision {
32 #if 0 /* just to make Emacs auto-indent happy */
33 }
34 #endif
35 
36 class CameraArgumentParser;
37 class ViscaControl;
38 
40 : public CameraControlPanTilt,
41  public CameraControlZoom,
42  public CameraControlEffect
43 {
44 
45  public:
46 
47  static const unsigned int EFFECT_PASTEL;
48  static const unsigned int EFFECT_NEGATIVE;
49  static const unsigned int EFFECT_SEPIA;
50  static const unsigned int EFFECT_BW;
51  static const unsigned int EFFECT_SOLARIZE;
52  static const unsigned int EFFECT_MOSAIC;
53  static const unsigned int EFFECT_SLIM;
54  static const unsigned int EFFECT_STRETCH;
55 
57  SonyEviD100PControl(const char *tty_port);
58  virtual ~SonyEviD100PControl();
59 
60  void open();
61  void close();
62  void process_pantilt();
63 
64  // pan/tilt
65  bool supports_pan();
66  bool supports_tilt();
67  void set_pan(int pan);
68  void set_tilt(int tilt);
69  void set_pan_tilt(int pan, int tilt);
70  void set_pan_tilt_rad(float pan, float tilt);
71  int pan();
72  int tilt();
73  void start_get_pan_tilt();
74  void pan_tilt(int &pan, int &tilt);
75  void pan_tilt_rad(float &pan, float &tilt);
76  int min_pan();
77  int max_pan();
78  int min_tilt();
79  int max_tilt();
80  void reset_pan_tilt();
81  void set_pan_tilt_limit(int pan_left, int pan_right,
82  int tilt_up, int tilt_down);
83  void reset_pan_tilt_limit();
84 
85  // zoom
86  void reset_zoom();
87  void set_zoom(unsigned int zoom);
88  unsigned int zoom();
89  unsigned int zoom_max();
90  unsigned int zoom_min();
91  void set_zoom_speed_tele(unsigned int speed);
92  void set_zoom_speed_wide(unsigned int speed);
93  void set_zoom_digital_enabled(bool enabled);
94 
95  unsigned int white_balance_mode();
96 
97  // effect
98  bool supports_effect(unsigned int effect);
99  void set_effect(unsigned int effect);
100  unsigned int effect();
101  void reset_effect();
102 
103 
104  static const int MAX_PAN;
105  static const int MIN_PAN;
106  static const int MAX_TILT;
107  static const int MIN_TILT;
108 
109  static const float MAX_PAN_DEG;
110  static const float MIN_PAN_DEG;
111  static const float MAX_TILT_DEG;
112  static const float MIN_TILT_DEG;
113 
114  static const float MAX_PAN_RAD;
115  static const float MIN_PAN_RAD;
116  static const float MAX_TILT_RAD;
117  static const float MIN_TILT_RAD;
118 
119  static const float PAN_STEPS_PER_DEG;
120  static const float TILT_STEPS_PER_DEG;
121 
122  static const float PAN_STEPS_PER_RAD;
123  static const float TILT_STEPS_PER_RAD;
124 
125  private:
126  ViscaControl *visca;
127  char *tty_port;
128  bool opened;
129 
130  int pan_target;
131  int tilt_target;
132 
133  unsigned int _effect;
134 
135 };
136 
137 } // end namespace firevision
138 
139 #endif
static const float TILT_STEPS_PER_DEG
Tilt steps per degree.
static const float MAX_PAN_RAD
Max pan in rad.
static const unsigned int EFFECT_MOSAIC
Mosaic effect.
Definition: sony_evid100p.h:52
Sony Evi D100P pan/tilt control.
Definition: sony_evid100p.h:39
int max_pan()
Get maximum pan value.
void set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down)
Set pan/tilt limits.
virtual ~SonyEviD100PControl()
Destructor.
bool supports_tilt()
Check whether this controller supports tilting.
void reset_pan_tilt_limit()
Reset pan/tilt limits.
static const unsigned int EFFECT_SEPIA
Sepia effect.
Definition: sony_evid100p.h:49
Camera zoom control interface.
Definition: zoom.h:35
unsigned int zoom_min()
Minimum zoom value.
void reset_pan_tilt()
Bring camera into home position.
static const unsigned int EFFECT_SOLARIZE
Solarize effect.
Definition: sony_evid100p.h:51
static const int MIN_TILT
Min tilt .
static const float PAN_STEPS_PER_DEG
Pan steps per degree.
static const float MIN_TILT_DEG
Min tilt in degrees.
static const int MAX_TILT
Max Tilt.
unsigned int zoom_max()
Maximum zoom value.
void set_zoom(unsigned int zoom)
Set new camera-specific zoom value.
Camera argument parser.
Definition: camargp.h:38
void set_effect(unsigned int effect)
Enable effect.
static const float MIN_PAN_RAD
Min pan in rad.
void process_pantilt()
Process pan/tilt information.
static const float MAX_PAN_DEG
Max pan in degrees.
static const unsigned int EFFECT_NEGATIVE
Negative effect.
Definition: sony_evid100p.h:48
static const unsigned int EFFECT_STRETCH
Stretch effect.
Definition: sony_evid100p.h:54
int max_tilt()
Get maximum tilt value.
unsigned int zoom()
Get current zoom value.
void set_tilt(int tilt)
Set tilt value.
Visca control protocol implementation over a serial line.
Definition: visca.h:56
SonyEviD100PControl(const CameraArgumentParser *cap)
Constructor.
unsigned int effect()
Current effect.
static const int MIN_PAN
Minimum pan.
static const int MAX_PAN
Maximum pan.
void set_zoom_speed_wide(unsigned int speed)
Set speed in wide range.
static const float MIN_TILT_RAD
Min tilt in rad.
void reset_effect()
Reset effect.
static const float MIN_PAN_DEG
Min pan in degrees.
bool supports_effect(unsigned int effect)
Check if camera control supports desired effect.
static const unsigned int EFFECT_PASTEL
Pastel effect.
Definition: sony_evid100p.h:47
static const unsigned int EFFECT_SLIM
Slim effect.
Definition: sony_evid100p.h:53
Camera effect control interface.
Definition: effect.h:35
void set_zoom_speed_tele(unsigned int speed)
Set speed in tele range.
void set_pan_tilt(int pan, int tilt)
Set pan and tilt in one go.
static const float MAX_TILT_RAD
Max tilt in rad.
unsigned int white_balance_mode()
Get current white balance mode.
int min_pan()
Get minimum pan value.
int min_tilt()
Get minimum tilt value.
void pan_tilt_rad(float &pan, float &tilt)
Get pan and tilt at the same time in radiant.
void open()
Open visca device.
static const float MAX_TILT_DEG
Max tilt in degrees.
static const float TILT_STEPS_PER_RAD
Tilt steps per rad.
void pan_tilt(int &pan, int &tilt)
Get pan and tilt at the same time.
void close()
Close Visca device.
Camera pan/tilt control interface.
Definition: pantilt.h:35
bool supports_pan()
Check whether this controller supports panning.
static const unsigned int EFFECT_BW
B/W effect.
Definition: sony_evid100p.h:50
void start_get_pan_tilt()
Start asynchronous fetch operation for pan and tilt values.
static const float PAN_STEPS_PER_RAD
Pan steps per rad.
void set_pan(int pan)
Set pan value.
void set_pan_tilt_rad(float pan, float tilt)
Set pan and tilt as float value.
void set_zoom_digital_enabled(bool enabled)
Set if digital zoom may be used.