CARLA
ros2/types/Image.h
Go to the documentation of this file.
1 // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 /*!
16  * @file Image.h
17  * This header file contains the declaration of the described types in the IDL file.
18  *
19  * This file was generated by the tool gen.
20  */
21 
22 #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_
23 #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_
24 
25 #include "Header.h"
26 
27 #include <fastrtps/utils/fixed_size_string.hpp>
28 
29 #include <stdint.h>
30 #include <array>
31 #include <string>
32 #include <vector>
33 #include <map>
34 #include <bitset>
35 
36 #if defined(_WIN32)
37 #if defined(EPROSIMA_USER_DLL_EXPORT)
38 #define eProsima_user_DllExport __declspec( dllexport )
39 #else
40 #define eProsima_user_DllExport
41 #endif // EPROSIMA_USER_DLL_EXPORT
42 #else
43 #define eProsima_user_DllExport
44 #endif // _WIN32
45 
46 #if defined(_WIN32)
47 #if defined(EPROSIMA_USER_DLL_EXPORT)
48 #if defined(Image_SOURCE)
49 #define Image_DllAPI __declspec( dllexport )
50 #else
51 #define Image_DllAPI __declspec( dllimport )
52 #endif // Image_SOURCE
53 #else
54 #define Image_DllAPI
55 #endif // EPROSIMA_USER_DLL_EXPORT
56 #else
57 #define Image_DllAPI
58 #endif // _WIN32
59 
60 namespace eprosima {
61 namespace fastcdr {
62 class Cdr;
63 } // namespace fastcdr
64 } // namespace eprosima
65 
66 namespace sensor_msgs {
67  namespace msg {
68  /*!
69  * @brief This class represents the structure Image defined by the user in the IDL file.
70  * @ingroup IMAGE
71  */
72  class Image
73  {
74  public:
75 
76  /*!
77  * @brief Default constructor.
78  */
80 
81  /*!
82  * @brief Default destructor.
83  */
84  eProsima_user_DllExport ~Image();
85 
86  /*!
87  * @brief Copy constructor.
88  * @param x Reference to the object sensor_msgs::msg::Image that will be copied.
89  */
91  const Image& x);
92 
93  /*!
94  * @brief Move constructor.
95  * @param x Reference to the object sensor_msgs::msg::Image that will be copied.
96  */
98  Image&& x) noexcept;
99 
100  /*!
101  * @brief Copy assignment.
102  * @param x Reference to the object sensor_msgs::msg::Image that will be copied.
103  */
104  eProsima_user_DllExport Image& operator =(
105  const Image& x);
106 
107  /*!
108  * @brief Move assignment.
109  * @param x Reference to the object sensor_msgs::msg::Image that will be copied.
110  */
111  eProsima_user_DllExport Image& operator =(
112  Image&& x) noexcept;
113 
114  /*!
115  * @brief Comparison operator.
116  * @param x sensor_msgs::msg::Image object to compare.
117  */
119  const Image& x) const;
120 
121  /*!
122  * @brief Comparison operator.
123  * @param x sensor_msgs::msg::Image object to compare.
124  */
126  const Image& x) const;
127 
128  /*!
129  * @brief This function copies the value in member header
130  * @param _header New value to be copied in member header
131  */
132  eProsima_user_DllExport void header(
133  const std_msgs::msg::Header& _header);
134 
135  /*!
136  * @brief This function moves the value in member header
137  * @param _header New value to be moved in member header
138  */
139  eProsima_user_DllExport void header(
140  std_msgs::msg::Header&& _header);
141 
142  /*!
143  * @brief This function returns a constant reference to member header
144  * @return Constant reference to member header
145  */
146  eProsima_user_DllExport const std_msgs::msg::Header& header() const;
147 
148  /*!
149  * @brief This function returns a reference to member header
150  * @return Reference to member header
151  */
153  /*!
154  * @brief This function sets a value in member height
155  * @param _height New value for member height
156  */
157  eProsima_user_DllExport void height(
158  uint32_t _height);
159 
160  /*!
161  * @brief This function returns the value of member height
162  * @return Value of member height
163  */
164  eProsima_user_DllExport uint32_t height() const;
165 
166  /*!
167  * @brief This function returns a reference to member height
168  * @return Reference to member height
169  */
170  eProsima_user_DllExport uint32_t& height();
171 
172  /*!
173  * @brief This function sets a value in member width
174  * @param _width New value for member width
175  */
176  eProsima_user_DllExport void width(
177  uint32_t _width);
178 
179  /*!
180  * @brief This function returns the value of member width
181  * @return Value of member width
182  */
183  eProsima_user_DllExport uint32_t width() const;
184 
185  /*!
186  * @brief This function returns a reference to member width
187  * @return Reference to member width
188  */
189  eProsima_user_DllExport uint32_t& width();
190 
191  /*!
192  * @brief This function copies the value in member encoding
193  * @param _encoding New value to be copied in member encoding
194  */
195  eProsima_user_DllExport void encoding(
196  const std::string& _encoding);
197 
198  /*!
199  * @brief This function moves the value in member encoding
200  * @param _encoding New value to be moved in member encoding
201  */
202  eProsima_user_DllExport void encoding(
203  std::string&& _encoding);
204 
205  /*!
206  * @brief This function returns a constant reference to member encoding
207  * @return Constant reference to member encoding
208  */
209  eProsima_user_DllExport const std::string& encoding() const;
210 
211  /*!
212  * @brief This function returns a reference to member encoding
213  * @return Reference to member encoding
214  */
215  eProsima_user_DllExport std::string& encoding();
216  /*!
217  * @brief This function sets a value in member is_bigendian
218  * @param _is_bigendian New value for member is_bigendian
219  */
220  eProsima_user_DllExport void is_bigendian(
221  uint8_t _is_bigendian);
222 
223  /*!
224  * @brief This function returns the value of member is_bigendian
225  * @return Value of member is_bigendian
226  */
227  eProsima_user_DllExport uint8_t is_bigendian() const;
228 
229  /*!
230  * @brief This function returns a reference to member is_bigendian
231  * @return Reference to member is_bigendian
232  */
233  eProsima_user_DllExport uint8_t& is_bigendian();
234 
235  /*!
236  * @brief This function sets a value in member step
237  * @param _step New value for member step
238  */
239  eProsima_user_DllExport void step(
240  uint32_t _step);
241 
242  /*!
243  * @brief This function returns the value of member step
244  * @return Value of member step
245  */
246  eProsima_user_DllExport uint32_t step() const;
247 
248  /*!
249  * @brief This function returns a reference to member step
250  * @return Reference to member step
251  */
252  eProsima_user_DllExport uint32_t& step();
253 
254  /*!
255  * @brief This function copies the value in member data
256  * @param _data New value to be copied in member data
257  */
258  eProsima_user_DllExport void data(
259  const std::vector<uint8_t>& _data);
260 
261  /*!
262  * @brief This function moves the value in member data
263  * @param _data New value to be moved in member data
264  */
265  eProsima_user_DllExport void data(
266  std::vector<uint8_t>&& _data);
267 
268  /*!
269  * @brief This function returns a constant reference to member data
270  * @return Constant reference to member data
271  */
272  eProsima_user_DllExport const std::vector<uint8_t>& data() const;
273 
274  /*!
275  * @brief This function returns a reference to member data
276  * @return Reference to member data
277  */
278  eProsima_user_DllExport std::vector<uint8_t>& data();
279 
280  /*!
281  * @brief This function returns the maximum serialized size of an object
282  * depending on the buffer alignment.
283  * @param current_alignment Buffer alignment.
284  * @return Maximum serialized size.
285  */
286  eProsima_user_DllExport static size_t getMaxCdrSerializedSize(
287  size_t current_alignment = 0);
288 
289  /*!
290  * @brief This function returns the serialized size of a data depending on the buffer alignment.
291  * @param data Data which is calculated its serialized size.
292  * @param current_alignment Buffer alignment.
293  * @return Serialized size.
294  */
295  eProsima_user_DllExport static size_t getCdrSerializedSize(
296  const sensor_msgs::msg::Image& data,
297  size_t current_alignment = 0);
298 
299 
300  /*!
301  * @brief This function serializes an object using CDR serialization.
302  * @param cdr CDR serialization object.
303  */
304  eProsima_user_DllExport void serialize(
305  eprosima::fastcdr::Cdr& cdr) const;
306 
307  /*!
308  * @brief This function deserializes an object using CDR serialization.
309  * @param cdr CDR serialization object.
310  */
311  eProsima_user_DllExport void deserialize(
312  eprosima::fastcdr::Cdr& cdr);
313 
314  /*!
315  * @brief This function returns the maximum serialized size of the Key of an object
316  * depending on the buffer alignment.
317  * @param current_alignment Buffer alignment.
318  * @return Maximum serialized size.
319  */
320  eProsima_user_DllExport static size_t getKeyMaxCdrSerializedSize(
321  size_t current_alignment = 0);
322 
323  /*!
324  * @brief This function tells you if the Key has been defined for this type
325  */
326  eProsima_user_DllExport static bool isKeyDefined();
327 
328  /*!
329  * @brief This function serializes the key members of an object using CDR serialization.
330  * @param cdr CDR serialization object.
331  */
332  eProsima_user_DllExport void serializeKey(
333  eprosima::fastcdr::Cdr& cdr) const;
334 
335  private:
337  uint32_t m_height;
338  uint32_t m_width;
339  std::string m_encoding;
340  uint8_t m_is_bigendian;
341  uint32_t m_step;
342  std::vector<uint8_t> m_data;
343  };
344  } // namespace msg
345 } // namespace sensor_msgs
346 
347 #endif // _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_
bool operator==(const Waypoint &lhs, const Waypoint &rhs)
std_msgs::msg::Header m_header
ImageTmpl< Color > Image
An image of 32-bit BGRA colors (8-bit channels, 4 bytes)
std::vector< uint8_t > m_data
This class represents the structure Header defined by the user in the IDL file.
Definition: Header.h:72
This class represents the structure Image defined by the user in the IDL file.
bool operator!=(const Waypoint &lhs, const Waypoint &rhs)
#define eProsima_user_DllExport