rec::robotino::api2 C++ interface
CameraCapabilities.h
1 // Copyright (C) 2004-2008, Robotics Equipment Corporation GmbH
2 
3 //Copyright (c) ...
4 //
5 //REC Robotics Equipment Corporation GmbH, Planegg, Germany. All rights reserved.
6 //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 //1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8 //2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 //
10 //THIS SOFTWARE IS PROVIDED BY REC ROBOTICS EQUIPMENT CORPORATION GMBH �AS IS� AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
11 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL REC ROBOTICS EQUIPMENT CORPORATION GMBH
12 //BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
13 //GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
14 //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 //
16 //Copyright (c) ...
17 //
18 //REC Robotics Equipment Corporation GmbH, Planegg, Germany. Alle Rechte vorbehalten.
19 //Weiterverbreitung und Verwendung in nichtkompilierter oder kompilierter Form, mit oder ohne Ver�nderung, sind unter den folgenden Bedingungen zul�ssig:
20 //1) Weiterverbreitete nichtkompilierte Exemplare m�ssen das obige Copyright, diese Liste der Bedingungen und den folgenden Haftungsausschluss im Quelltext enthalten.
21 //2) Weiterverbreitete kompilierte Exemplare m�ssen das obige Copyright, diese Liste der Bedingungen und den folgenden Haftungsausschluss in der Dokumentation und/oder anderen Materialien, die mit dem Exemplar verbreitet werden, enthalten.
22 //
23 //DIESE SOFTWARE WIRD VON REC ROBOTICS EQUIPMENT CORPORATION GMBH OHNE JEGLICHE SPEZIELLE ODER IMPLIZIERTE GARANTIEN ZUR VERF�GUNG GESTELLT, DIE UNTER
24 //ANDEREM EINSCHLIESSEN: DIE IMPLIZIERTE GARANTIE DER VERWENDBARKEIT DER SOFTWARE FÜR EINEN BESTIMMTEN ZWECK. AUF KEINEN FALL IST REC ROBOTICS EQUIPMENT CORPORATION GMBH
25 //FÜR IRGENDWELCHE DIREKTEN, INDIREKTEN, ZUFÄLLIGEN, SPEZIELLEN, BEISPIELHAFTEN ODER FOLGESCHÄDEN (UNTER ANDEREM VERSCHAFFEN VON ERSATZGÜTERN ODER -DIENSTLEISTUNGEN;
26 //EINSCHRÄNKUNG DER NUTZUNGSFÄHIGKEIT; VERLUST VON NUTZUNGSFÄHIGKEIT; DATEN; PROFIT ODER GESCHÄFTSUNTERBRECHUNG), WIE AUCH IMMER VERURSACHT UND UNTER WELCHER VERPFLICHTUNG
27 //AUCH IMMER, OB IN VERTRAG, STRIKTER VERPFLICHTUNG ODER UNERLAUBTER HANDLUNG (INKLUSIVE FAHRLÄSSIGKEIT) VERANTWORTLICH, AUF WELCHEM WEG SIE AUCH IMMER DURCH DIE BENUTZUNG
28 //DIESER SOFTWARE ENTSTANDEN SIND, SOGAR, WENN SIE AUF DIE MÖGLICHKEIT EINES SOLCHEN SCHADENS HINGEWIESEN WORDEN SIND.
29 
30 #ifndef _REC_ROBOTINO_API2_CAMERACAPABILITIES_H_
31 #define _REC_ROBOTINO_API2_CAMERACAPABILITIES_H_
32 
33 #include "rec/robotino/api2/CameraFormat.h"
34 
35 namespace rec
36 {
37  namespace robotino
38  {
39  namespace api2
40  {
45  {
46  public:
51  : brightness( false )
52  , contrast( false )
53  , saturation( false )
54  , autoWhiteBalance( false )
55  , gain( false )
56  , whiteBalanceTemperature( false )
57  , backlightCompensation( false )
58  , autoExposure( false )
59  , exposure( false )
60  , autoFocus( false )
61  , focus( false )
62  , sharpness( false )
63  , _name( NULL )
64  , _formats( NULL )
65  , _numFormats( 0 )
66  {
67  _name = new char[1];
68  _name[0] = '\0';
69  }
70 
75  : brightness( other.brightness )
76  , contrast( other.contrast )
77  , saturation( other.saturation )
79  , gain( other.gain )
82  , autoExposure( other.autoExposure )
83  , exposure( other.exposure )
84  , autoFocus( other.autoFocus )
85  , focus( other.focus )
86  , sharpness( other.sharpness )
87  , _name( NULL )
88  , _formats( NULL )
89  , _numFormats( 0 )
90  {
91  setName( other._name );
92  for( unsigned int i=0; i<other._numFormats; ++i )
93  {
94  addFormat( other.format( i ) );
95  }
96  }
97 
102  {
103  delete [] _name;
104  delete [] _formats;
105  }
106 
111  {
112  setName( other._name );
113  delete [] _formats;
114  _formats = NULL;
115  _numFormats = 0;
116  for( unsigned int i=0; i<other._numFormats; ++i )
117  {
118  addFormat( other.format( i ) );
119  }
120 
121  brightness = other.brightness;
122  contrast = other.contrast;
123  saturation = other.saturation;
125  gain = other.gain;
128  autoExposure = other.autoExposure;
129  exposure = other.exposure;
130  autoFocus = other.autoFocus;
131  focus = other.focus;
132  sharpness = other.sharpness;
133  return *this;
134  }
135 
140  void setName( const char* name )
141  {
142  delete [] _name;
143  if ( 0 == name )
144  {
145  _name = new char[1];
146  _name[0] = '\0';
147  return;
148  }
149  size_t len = strlen( name );
150  _name = new char[ len+1 ];
151  strncpy( _name, name, len+1 );
152  }
153 
158  const char* name() const
159  {
160  return _name;
161  }
162 
169  {
170  if( 0 == _numFormats % 16 )
171  {
172  CameraFormat* old = _formats;
173 
174  _formats = new CameraFormat[_numFormats+16];
175 
176  for( unsigned int i=0; i<_numFormats; ++i )
177  {
178  _formats[i] = old[i];
179  }
180 
181  delete [] old;
182  }
183 
184  _formats[_numFormats] = format;
185 
186  ++_numFormats;
187  }
188 
195  CameraFormat format( unsigned int index ) const
196  {
197  if( index >= _numFormats )
198  {
199  return CameraFormat();
200  }
201  return _formats[index];
202  }
203 
208  unsigned int numFormats() const
209  {
210  return _numFormats;
211  }
212 
215 
217  bool contrast;
218 
221 
224 
226  bool gain;
227 
230 
233 
236 
238  bool exposure;
239 
241  bool autoFocus;
242 
244  bool focus;
245 
247  bool sharpness;
248 
249  private :
250  char* _name;
251  CameraFormat* _formats;
252  unsigned int _numFormats;
253  };
254  }
255  }
256 }
257 
258 #endif //_REC_ROBOTINO_API2_CAMERACAPABILITIES_H_
void addFormat(const CameraFormat &format)
Definition: CameraCapabilities.h:168
bool focus
Definition: CameraCapabilities.h:244
Capabilities of Robotino&#39;s camera.
Definition: CameraCapabilities.h:44
const char * name() const
Definition: CameraCapabilities.h:158
bool backlightCompensation
Definition: CameraCapabilities.h:232
bool brightness
Definition: CameraCapabilities.h:214
CameraCapabilities & operator=(const CameraCapabilities &other)
Definition: CameraCapabilities.h:110
bool sharpness
Definition: CameraCapabilities.h:247
bool saturation
Definition: CameraCapabilities.h:220
bool autoWhiteBalance
Definition: CameraCapabilities.h:223
Definition: AnalogInput.h:36
CameraCapabilities(const CameraCapabilities &other)
Definition: CameraCapabilities.h:74
CameraCapabilities()
Definition: CameraCapabilities.h:50
virtual ~CameraCapabilities()
Definition: CameraCapabilities.h:101
CameraFormat format(unsigned int index) const
Definition: CameraCapabilities.h:195
bool exposure
Definition: CameraCapabilities.h:238
unsigned int numFormats() const
Definition: CameraCapabilities.h:208
void setName(const char *name)
Definition: CameraCapabilities.h:140
Camera format description.
Definition: CameraFormat.h:44
bool contrast
Definition: CameraCapabilities.h:217
bool whiteBalanceTemperature
Definition: CameraCapabilities.h:229
bool autoFocus
Definition: CameraCapabilities.h:241
bool autoExposure
Definition: CameraCapabilities.h:235
bool gain
Definition: CameraCapabilities.h:226