rec::robotino::api2 C++ interface
CameraFormat.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_CAMERAFORMAT_H_
31 #define _REC_ROBOTINO_API2_CAMERAFORMAT_H_
32 
33 #include <string.h>
34 
35 namespace rec
36 {
37  namespace robotino
38  {
39  namespace api2
40  {
45  {
46  public:
51  : width( 0 )
52  , height( 0 )
53  , _name( NULL )
54  {
55  _name = new char[1];
56  _name[0] = '\0';
57  }
58 
66  CameraFormat( unsigned int width_, unsigned int height_, const char* name )
67  : width( width_ )
68  , height( height_ )
69  , _name( NULL )
70  {
71  setName( name );
72  }
73 
79  CameraFormat( const CameraFormat& other )
80  : width( other.width )
81  , height( other.height )
82  , _name( NULL )
83  {
84  setName( other._name );
85  }
86 
90  virtual ~CameraFormat()
91  {
92  delete [] _name;
93  }
94 
101  {
102  setName( other._name );
103  width = other.width;
104  height = other.height;
105  return *this;
106  }
107 
112  void setName( const char* str )
113  {
114  size_t len = strlen( str );
115  delete [] _name;
116  _name = new char[ len+1 ];
117  strncpy( _name, str, len+1 );
118  }
119 
124  const char* name() const
125  {
126  return _name;
127  }
128 
132  unsigned int width;
133 
137  unsigned int height;
138 
139  private:
140  char* _name;
141  };
142  }
143  }
144 }
145 
146 #endif //_REC_ROBOTINO_API2_CAMERAFORMAT_H_
CameraFormat()
Definition: CameraFormat.h:50
CameraFormat & operator=(const CameraFormat &other)
Definition: CameraFormat.h:100
unsigned int height
Definition: CameraFormat.h:137
CameraFormat(unsigned int width_, unsigned int height_, const char *name)
Definition: CameraFormat.h:66
Definition: AnalogInput.h:36
unsigned int width
Definition: CameraFormat.h:132
CameraFormat(const CameraFormat &other)
Definition: CameraFormat.h:79
void setName(const char *str)
Definition: CameraFormat.h:112
Camera format description.
Definition: CameraFormat.h:44
virtual ~CameraFormat()
Definition: CameraFormat.h:90
const char * name() const
Definition: CameraFormat.h:124