gz_msgs/ign_msgs8/
camerasensor.rs

1// This file is generated by rust-protobuf 3.7.2. Do not edit
2// .proto file is parsed by protoc 3.21.12
3// @generated
4
5// https://github.com/rust-lang/rust-clippy/issues/702
6#![allow(unknown_lints)]
7#![allow(clippy::all)]
8
9#![allow(unused_attributes)]
10#![cfg_attr(rustfmt, rustfmt::skip)]
11
12#![allow(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_results)]
19#![allow(unused_mut)]
20
21//! Generated file from `ignition/msgs/camerasensor.proto`
22
23/// Generated files are compatible only with the same version
24/// of protobuf runtime.
25const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
26
27#[derive(::gz_msgs_common::IgnMessage)]
28// @@protoc_insertion_point(message:ignition.msgs.CameraSensor)
29#[derive(PartialEq,Clone,Default,Debug)]
30pub struct CameraSensor {
31    // message fields
32    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.header)
33    pub header: ::protobuf::MessageField<super::header::Header>,
34    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.horizontal_fov)
35    pub horizontal_fov: f64,
36    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.image_size)
37    pub image_size: ::protobuf::MessageField<super::vector2d::Vector2d>,
38    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.image_format)
39    pub image_format: ::std::string::String,
40    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.near_clip)
41    pub near_clip: f64,
42    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.far_clip)
43    pub far_clip: f64,
44    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.save_enabled)
45    pub save_enabled: bool,
46    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.save_path)
47    pub save_path: ::std::string::String,
48    // @@protoc_insertion_point(field:ignition.msgs.CameraSensor.distortion)
49    pub distortion: ::protobuf::MessageField<super::distortion::Distortion>,
50    // special fields
51    // @@protoc_insertion_point(special_field:ignition.msgs.CameraSensor.special_fields)
52    pub special_fields: ::protobuf::SpecialFields,
53}
54
55impl<'a> ::std::default::Default for &'a CameraSensor {
56    fn default() -> &'a CameraSensor {
57        <CameraSensor as ::protobuf::Message>::default_instance()
58    }
59}
60
61impl CameraSensor {
62    pub fn new() -> CameraSensor {
63        ::std::default::Default::default()
64    }
65
66    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
67        let mut fields = ::std::vec::Vec::with_capacity(9);
68        let mut oneofs = ::std::vec::Vec::with_capacity(0);
69        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::header::Header>(
70            "header",
71            |m: &CameraSensor| { &m.header },
72            |m: &mut CameraSensor| { &mut m.header },
73        ));
74        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
75            "horizontal_fov",
76            |m: &CameraSensor| { &m.horizontal_fov },
77            |m: &mut CameraSensor| { &mut m.horizontal_fov },
78        ));
79        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::vector2d::Vector2d>(
80            "image_size",
81            |m: &CameraSensor| { &m.image_size },
82            |m: &mut CameraSensor| { &mut m.image_size },
83        ));
84        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
85            "image_format",
86            |m: &CameraSensor| { &m.image_format },
87            |m: &mut CameraSensor| { &mut m.image_format },
88        ));
89        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
90            "near_clip",
91            |m: &CameraSensor| { &m.near_clip },
92            |m: &mut CameraSensor| { &mut m.near_clip },
93        ));
94        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
95            "far_clip",
96            |m: &CameraSensor| { &m.far_clip },
97            |m: &mut CameraSensor| { &mut m.far_clip },
98        ));
99        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
100            "save_enabled",
101            |m: &CameraSensor| { &m.save_enabled },
102            |m: &mut CameraSensor| { &mut m.save_enabled },
103        ));
104        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
105            "save_path",
106            |m: &CameraSensor| { &m.save_path },
107            |m: &mut CameraSensor| { &mut m.save_path },
108        ));
109        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::distortion::Distortion>(
110            "distortion",
111            |m: &CameraSensor| { &m.distortion },
112            |m: &mut CameraSensor| { &mut m.distortion },
113        ));
114        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<CameraSensor>(
115            "CameraSensor",
116            fields,
117            oneofs,
118        )
119    }
120}
121
122impl ::protobuf::Message for CameraSensor {
123    const NAME: &'static str = "CameraSensor";
124
125    fn is_initialized(&self) -> bool {
126        true
127    }
128
129    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
130        while let Some(tag) = is.read_raw_tag_or_eof()? {
131            match tag {
132                10 => {
133                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?;
134                },
135                17 => {
136                    self.horizontal_fov = is.read_double()?;
137                },
138                26 => {
139                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.image_size)?;
140                },
141                34 => {
142                    self.image_format = is.read_string()?;
143                },
144                41 => {
145                    self.near_clip = is.read_double()?;
146                },
147                49 => {
148                    self.far_clip = is.read_double()?;
149                },
150                56 => {
151                    self.save_enabled = is.read_bool()?;
152                },
153                66 => {
154                    self.save_path = is.read_string()?;
155                },
156                74 => {
157                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.distortion)?;
158                },
159                tag => {
160                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
161                },
162            };
163        }
164        ::std::result::Result::Ok(())
165    }
166
167    // Compute sizes of nested messages
168    #[allow(unused_variables)]
169    fn compute_size(&self) -> u64 {
170        let mut my_size = 0;
171        if let Some(v) = self.header.as_ref() {
172            let len = v.compute_size();
173            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
174        }
175        if self.horizontal_fov != 0. {
176            my_size += 1 + 8;
177        }
178        if let Some(v) = self.image_size.as_ref() {
179            let len = v.compute_size();
180            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
181        }
182        if !self.image_format.is_empty() {
183            my_size += ::protobuf::rt::string_size(4, &self.image_format);
184        }
185        if self.near_clip != 0. {
186            my_size += 1 + 8;
187        }
188        if self.far_clip != 0. {
189            my_size += 1 + 8;
190        }
191        if self.save_enabled != false {
192            my_size += 1 + 1;
193        }
194        if !self.save_path.is_empty() {
195            my_size += ::protobuf::rt::string_size(8, &self.save_path);
196        }
197        if let Some(v) = self.distortion.as_ref() {
198            let len = v.compute_size();
199            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
200        }
201        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
202        self.special_fields.cached_size().set(my_size as u32);
203        my_size
204    }
205
206    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
207        if let Some(v) = self.header.as_ref() {
208            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
209        }
210        if self.horizontal_fov != 0. {
211            os.write_double(2, self.horizontal_fov)?;
212        }
213        if let Some(v) = self.image_size.as_ref() {
214            ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
215        }
216        if !self.image_format.is_empty() {
217            os.write_string(4, &self.image_format)?;
218        }
219        if self.near_clip != 0. {
220            os.write_double(5, self.near_clip)?;
221        }
222        if self.far_clip != 0. {
223            os.write_double(6, self.far_clip)?;
224        }
225        if self.save_enabled != false {
226            os.write_bool(7, self.save_enabled)?;
227        }
228        if !self.save_path.is_empty() {
229            os.write_string(8, &self.save_path)?;
230        }
231        if let Some(v) = self.distortion.as_ref() {
232            ::protobuf::rt::write_message_field_with_cached_size(9, v, os)?;
233        }
234        os.write_unknown_fields(self.special_fields.unknown_fields())?;
235        ::std::result::Result::Ok(())
236    }
237
238    fn special_fields(&self) -> &::protobuf::SpecialFields {
239        &self.special_fields
240    }
241
242    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
243        &mut self.special_fields
244    }
245
246    fn new() -> CameraSensor {
247        CameraSensor::new()
248    }
249
250    fn clear(&mut self) {
251        self.header.clear();
252        self.horizontal_fov = 0.;
253        self.image_size.clear();
254        self.image_format.clear();
255        self.near_clip = 0.;
256        self.far_clip = 0.;
257        self.save_enabled = false;
258        self.save_path.clear();
259        self.distortion.clear();
260        self.special_fields.clear();
261    }
262
263    fn default_instance() -> &'static CameraSensor {
264        static instance: CameraSensor = CameraSensor {
265            header: ::protobuf::MessageField::none(),
266            horizontal_fov: 0.,
267            image_size: ::protobuf::MessageField::none(),
268            image_format: ::std::string::String::new(),
269            near_clip: 0.,
270            far_clip: 0.,
271            save_enabled: false,
272            save_path: ::std::string::String::new(),
273            distortion: ::protobuf::MessageField::none(),
274            special_fields: ::protobuf::SpecialFields::new(),
275        };
276        &instance
277    }
278}
279
280impl ::protobuf::MessageFull for CameraSensor {
281    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
282        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
283        descriptor.get(|| file_descriptor().message_by_package_relative_name("CameraSensor").unwrap()).clone()
284    }
285}
286
287impl ::std::fmt::Display for CameraSensor {
288    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
289        ::protobuf::text_format::fmt(self, f)
290    }
291}
292
293impl ::protobuf::reflect::ProtobufValue for CameraSensor {
294    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
295}
296
297static file_descriptor_proto_data: &'static [u8] = b"\
298    \n\x20ignition/msgs/camerasensor.proto\x12\rignition.msgs\x1a\x1cignitio\
299    n/msgs/vector2d.proto\x1a\x1eignition/msgs/distortion.proto\x1a\x1aignit\
300    ion/msgs/header.proto\"\xf2\x02\n\x0cCameraSensor\x12-\n\x06header\x18\
301    \x01\x20\x01(\x0b2\x15.ignition.msgs.HeaderR\x06header\x12%\n\x0ehorizon\
302    tal_fov\x18\x02\x20\x01(\x01R\rhorizontalFov\x126\n\nimage_size\x18\x03\
303    \x20\x01(\x0b2\x17.ignition.msgs.Vector2dR\timageSize\x12!\n\x0cimage_fo\
304    rmat\x18\x04\x20\x01(\tR\x0bimageFormat\x12\x1b\n\tnear_clip\x18\x05\x20\
305    \x01(\x01R\x08nearClip\x12\x19\n\x08far_clip\x18\x06\x20\x01(\x01R\x07fa\
306    rClip\x12!\n\x0csave_enabled\x18\x07\x20\x01(\x08R\x0bsaveEnabled\x12\
307    \x1b\n\tsave_path\x18\x08\x20\x01(\tR\x08savePath\x129\n\ndistortion\x18\
308    \t\x20\x01(\x0b2\x19.ignition.msgs.DistortionR\ndistortionB'\n\x11com.ig\
309    nition.msgsB\x12CameraSensorProtosb\x06proto3\
310";
311
312/// `FileDescriptorProto` object which was a source for this generated file
313fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
314    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
315    file_descriptor_proto_lazy.get(|| {
316        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
317    })
318}
319
320/// `FileDescriptor` object which allows dynamic access to files
321pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
322    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
323    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
324    file_descriptor.get(|| {
325        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
326            let mut deps = ::std::vec::Vec::with_capacity(3);
327            deps.push(super::vector2d::file_descriptor().clone());
328            deps.push(super::distortion::file_descriptor().clone());
329            deps.push(super::header::file_descriptor().clone());
330            let mut messages = ::std::vec::Vec::with_capacity(1);
331            messages.push(CameraSensor::generated_message_descriptor_data());
332            let mut enums = ::std::vec::Vec::with_capacity(0);
333            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
334                file_descriptor_proto(),
335                deps,
336                messages,
337                enums,
338            )
339        });
340        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
341    })
342}