fidl_fuchsia_accessibility__common/
fidl_fuchsia_accessibility__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// Specifies color correction mode.
12#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
13#[repr(u32)]
14pub enum ColorCorrectionMode {
15    /// No color correction.
16    Disabled = 0,
17    /// Color correction for protanomaly (red-green -- reduced sensitivity to red light).
18    CorrectProtanomaly = 1,
19    /// Color correction for deuteranomaly (red-green -- reduced sensitivity to green light).
20    CorrectDeuteranomaly = 2,
21    /// Color correction for tritanomaly (blue-yellow -- reduced sensitivity to blue light).
22    CorrectTritanomaly = 3,
23}
24
25impl ColorCorrectionMode {
26    #[inline]
27    pub fn from_primitive(prim: u32) -> Option<Self> {
28        match prim {
29            0 => Some(Self::Disabled),
30            1 => Some(Self::CorrectProtanomaly),
31            2 => Some(Self::CorrectDeuteranomaly),
32            3 => Some(Self::CorrectTritanomaly),
33            _ => None,
34        }
35    }
36
37    #[inline]
38    pub const fn into_primitive(self) -> u32 {
39        self as u32
40    }
41}
42
43#[derive(Clone, Debug, PartialEq)]
44pub struct ColorTransformHandlerSetColorTransformConfigurationRequest {
45    pub configuration: ColorTransformConfiguration,
46}
47
48impl fidl::Persistable for ColorTransformHandlerSetColorTransformConfigurationRequest {}
49
50#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
51pub struct MagnificationHandlerSetClipSpaceTransformRequest {
52    pub x: f32,
53    pub y: f32,
54    pub scale: f32,
55}
56
57impl fidl::Persistable for MagnificationHandlerSetClipSpaceTransformRequest {}
58
59/// The current configuration for accessibility color transforms, which includes color inversion and
60/// color correction. This always includes the matrix required to apply the appropriate transforms.
61/// Color correction and color inversion may be active simultaneously.
62///
63/// For original RGB value (r, g, b) (each component ranged between 0 and 1), the RGB value of
64/// corrected color (r', g', b') is
65///   (r', g', b') = color_adjustment_post_offset
66///                + color_adjustment_matrix . ((r, g, b) + color_adjustment_pre_offset).
67#[derive(Clone, Debug, Default, PartialEq)]
68pub struct ColorTransformConfiguration {
69    /// When color_inversion_enabled is true, certain colors are inverted across the entire screen.
70    /// If this field is omitted behavior should remain unchanged.
71    pub color_inversion_enabled: Option<bool>,
72    /// When color_correction is set to DISABLED, colors are displayed normally. When
73    /// color_correction has different value, colors are modified to correct for the specified type
74    /// of color blindness. If this field is omitted behavior should remain unchanged.
75    pub color_correction: Option<ColorCorrectionMode>,
76    /// 3x3 Matrix in row-major form which will be used by root presenter to apply color correction
77    /// and color inversion, or a combination fo the two. This field should always be set.
78    pub color_adjustment_matrix: Option<[f32; 9]>,
79    /// 3x1 vector which is used by root presenter as an offset added to the original RGB color,
80    /// before it multiplies with the |color_adjustment_matrix|. This field should always be set.
81    pub color_adjustment_pre_offset: Option<[f32; 3]>,
82    /// 3x1 vector which is used by root presenter as an offset added to the multiplied result
83    /// of |color_adjustment_matrix| and original RGB color. This field should always be set.
84    pub color_adjustment_post_offset: Option<[f32; 3]>,
85    #[doc(hidden)]
86    pub __source_breaking: fidl::marker::SourceBreaking,
87}
88
89impl fidl::Persistable for ColorTransformConfiguration {}
90
91pub mod color_transform_ordinals {
92    pub const REGISTER_COLOR_TRANSFORM_HANDLER: u64 = 0x49ff3b83fcb05b88;
93}
94
95pub mod color_transform_handler_ordinals {
96    pub const SET_COLOR_TRANSFORM_CONFIGURATION: u64 = 0x747ad9d676318dc6;
97}
98
99pub mod magnification_handler_ordinals {
100    pub const SET_CLIP_SPACE_TRANSFORM: u64 = 0x71e54bab8b9f7357;
101}
102
103pub mod magnifier_ordinals {
104    pub const REGISTER_HANDLER: u64 = 0x36559e34eb45d161;
105}
106
107mod internal {
108    use super::*;
109    unsafe impl fidl::encoding::TypeMarker for ColorCorrectionMode {
110        type Owned = Self;
111
112        #[inline(always)]
113        fn inline_align(_context: fidl::encoding::Context) -> usize {
114            std::mem::align_of::<u32>()
115        }
116
117        #[inline(always)]
118        fn inline_size(_context: fidl::encoding::Context) -> usize {
119            std::mem::size_of::<u32>()
120        }
121
122        #[inline(always)]
123        fn encode_is_copy() -> bool {
124            true
125        }
126
127        #[inline(always)]
128        fn decode_is_copy() -> bool {
129            false
130        }
131    }
132
133    impl fidl::encoding::ValueTypeMarker for ColorCorrectionMode {
134        type Borrowed<'a> = Self;
135        #[inline(always)]
136        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
137            *value
138        }
139    }
140
141    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
142        for ColorCorrectionMode
143    {
144        #[inline]
145        unsafe fn encode(
146            self,
147            encoder: &mut fidl::encoding::Encoder<'_, D>,
148            offset: usize,
149            _depth: fidl::encoding::Depth,
150        ) -> fidl::Result<()> {
151            encoder.debug_check_bounds::<Self>(offset);
152            encoder.write_num(self.into_primitive(), offset);
153            Ok(())
154        }
155    }
156
157    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorCorrectionMode {
158        #[inline(always)]
159        fn new_empty() -> Self {
160            Self::Disabled
161        }
162
163        #[inline]
164        unsafe fn decode(
165            &mut self,
166            decoder: &mut fidl::encoding::Decoder<'_, D>,
167            offset: usize,
168            _depth: fidl::encoding::Depth,
169        ) -> fidl::Result<()> {
170            decoder.debug_check_bounds::<Self>(offset);
171            let prim = decoder.read_num::<u32>(offset);
172
173            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
174            Ok(())
175        }
176    }
177
178    impl fidl::encoding::ValueTypeMarker
179        for ColorTransformHandlerSetColorTransformConfigurationRequest
180    {
181        type Borrowed<'a> = &'a Self;
182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
183            value
184        }
185    }
186
187    unsafe impl fidl::encoding::TypeMarker
188        for ColorTransformHandlerSetColorTransformConfigurationRequest
189    {
190        type Owned = Self;
191
192        #[inline(always)]
193        fn inline_align(_context: fidl::encoding::Context) -> usize {
194            8
195        }
196
197        #[inline(always)]
198        fn inline_size(_context: fidl::encoding::Context) -> usize {
199            16
200        }
201    }
202
203    unsafe impl<D: fidl::encoding::ResourceDialect>
204        fidl::encoding::Encode<ColorTransformHandlerSetColorTransformConfigurationRequest, D>
205        for &ColorTransformHandlerSetColorTransformConfigurationRequest
206    {
207        #[inline]
208        unsafe fn encode(
209            self,
210            encoder: &mut fidl::encoding::Encoder<'_, D>,
211            offset: usize,
212            _depth: fidl::encoding::Depth,
213        ) -> fidl::Result<()> {
214            encoder
215                .debug_check_bounds::<ColorTransformHandlerSetColorTransformConfigurationRequest>(
216                    offset,
217                );
218            // Delegate to tuple encoding.
219            fidl::encoding::Encode::<ColorTransformHandlerSetColorTransformConfigurationRequest, D>::encode(
220                (
221                    <ColorTransformConfiguration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
222                ),
223                encoder, offset, _depth
224            )
225        }
226    }
227    unsafe impl<
228        D: fidl::encoding::ResourceDialect,
229        T0: fidl::encoding::Encode<ColorTransformConfiguration, D>,
230    > fidl::encoding::Encode<ColorTransformHandlerSetColorTransformConfigurationRequest, D>
231        for (T0,)
232    {
233        #[inline]
234        unsafe fn encode(
235            self,
236            encoder: &mut fidl::encoding::Encoder<'_, D>,
237            offset: usize,
238            depth: fidl::encoding::Depth,
239        ) -> fidl::Result<()> {
240            encoder
241                .debug_check_bounds::<ColorTransformHandlerSetColorTransformConfigurationRequest>(
242                    offset,
243                );
244            // Zero out padding regions. There's no need to apply masks
245            // because the unmasked parts will be overwritten by fields.
246            // Write the fields.
247            self.0.encode(encoder, offset + 0, depth)?;
248            Ok(())
249        }
250    }
251
252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
253        for ColorTransformHandlerSetColorTransformConfigurationRequest
254    {
255        #[inline(always)]
256        fn new_empty() -> Self {
257            Self { configuration: fidl::new_empty!(ColorTransformConfiguration, D) }
258        }
259
260        #[inline]
261        unsafe fn decode(
262            &mut self,
263            decoder: &mut fidl::encoding::Decoder<'_, D>,
264            offset: usize,
265            _depth: fidl::encoding::Depth,
266        ) -> fidl::Result<()> {
267            decoder.debug_check_bounds::<Self>(offset);
268            // Verify that padding bytes are zero.
269            fidl::decode!(
270                ColorTransformConfiguration,
271                D,
272                &mut self.configuration,
273                decoder,
274                offset + 0,
275                _depth
276            )?;
277            Ok(())
278        }
279    }
280
281    impl fidl::encoding::ValueTypeMarker for MagnificationHandlerSetClipSpaceTransformRequest {
282        type Borrowed<'a> = &'a Self;
283        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
284            value
285        }
286    }
287
288    unsafe impl fidl::encoding::TypeMarker for MagnificationHandlerSetClipSpaceTransformRequest {
289        type Owned = Self;
290
291        #[inline(always)]
292        fn inline_align(_context: fidl::encoding::Context) -> usize {
293            4
294        }
295
296        #[inline(always)]
297        fn inline_size(_context: fidl::encoding::Context) -> usize {
298            12
299        }
300    }
301
302    unsafe impl<D: fidl::encoding::ResourceDialect>
303        fidl::encoding::Encode<MagnificationHandlerSetClipSpaceTransformRequest, D>
304        for &MagnificationHandlerSetClipSpaceTransformRequest
305    {
306        #[inline]
307        unsafe fn encode(
308            self,
309            encoder: &mut fidl::encoding::Encoder<'_, D>,
310            offset: usize,
311            _depth: fidl::encoding::Depth,
312        ) -> fidl::Result<()> {
313            encoder.debug_check_bounds::<MagnificationHandlerSetClipSpaceTransformRequest>(offset);
314            // Delegate to tuple encoding.
315            fidl::encoding::Encode::<MagnificationHandlerSetClipSpaceTransformRequest, D>::encode(
316                (
317                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
318                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
319                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
320                ),
321                encoder,
322                offset,
323                _depth,
324            )
325        }
326    }
327    unsafe impl<
328        D: fidl::encoding::ResourceDialect,
329        T0: fidl::encoding::Encode<f32, D>,
330        T1: fidl::encoding::Encode<f32, D>,
331        T2: fidl::encoding::Encode<f32, D>,
332    > fidl::encoding::Encode<MagnificationHandlerSetClipSpaceTransformRequest, D> for (T0, T1, T2)
333    {
334        #[inline]
335        unsafe fn encode(
336            self,
337            encoder: &mut fidl::encoding::Encoder<'_, D>,
338            offset: usize,
339            depth: fidl::encoding::Depth,
340        ) -> fidl::Result<()> {
341            encoder.debug_check_bounds::<MagnificationHandlerSetClipSpaceTransformRequest>(offset);
342            // Zero out padding regions. There's no need to apply masks
343            // because the unmasked parts will be overwritten by fields.
344            // Write the fields.
345            self.0.encode(encoder, offset + 0, depth)?;
346            self.1.encode(encoder, offset + 4, depth)?;
347            self.2.encode(encoder, offset + 8, depth)?;
348            Ok(())
349        }
350    }
351
352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
353        for MagnificationHandlerSetClipSpaceTransformRequest
354    {
355        #[inline(always)]
356        fn new_empty() -> Self {
357            Self {
358                x: fidl::new_empty!(f32, D),
359                y: fidl::new_empty!(f32, D),
360                scale: fidl::new_empty!(f32, D),
361            }
362        }
363
364        #[inline]
365        unsafe fn decode(
366            &mut self,
367            decoder: &mut fidl::encoding::Decoder<'_, D>,
368            offset: usize,
369            _depth: fidl::encoding::Depth,
370        ) -> fidl::Result<()> {
371            decoder.debug_check_bounds::<Self>(offset);
372            // Verify that padding bytes are zero.
373            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
374            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
375            fidl::decode!(f32, D, &mut self.scale, decoder, offset + 8, _depth)?;
376            Ok(())
377        }
378    }
379
380    impl ColorTransformConfiguration {
381        #[inline(always)]
382        fn max_ordinal_present(&self) -> u64 {
383            if let Some(_) = self.color_adjustment_post_offset {
384                return 5;
385            }
386            if let Some(_) = self.color_adjustment_pre_offset {
387                return 4;
388            }
389            if let Some(_) = self.color_adjustment_matrix {
390                return 3;
391            }
392            if let Some(_) = self.color_correction {
393                return 2;
394            }
395            if let Some(_) = self.color_inversion_enabled {
396                return 1;
397            }
398            0
399        }
400    }
401
402    impl fidl::encoding::ValueTypeMarker for ColorTransformConfiguration {
403        type Borrowed<'a> = &'a Self;
404        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
405            value
406        }
407    }
408
409    unsafe impl fidl::encoding::TypeMarker for ColorTransformConfiguration {
410        type Owned = Self;
411
412        #[inline(always)]
413        fn inline_align(_context: fidl::encoding::Context) -> usize {
414            8
415        }
416
417        #[inline(always)]
418        fn inline_size(_context: fidl::encoding::Context) -> usize {
419            16
420        }
421    }
422
423    unsafe impl<D: fidl::encoding::ResourceDialect>
424        fidl::encoding::Encode<ColorTransformConfiguration, D> for &ColorTransformConfiguration
425    {
426        unsafe fn encode(
427            self,
428            encoder: &mut fidl::encoding::Encoder<'_, D>,
429            offset: usize,
430            mut depth: fidl::encoding::Depth,
431        ) -> fidl::Result<()> {
432            encoder.debug_check_bounds::<ColorTransformConfiguration>(offset);
433            // Vector header
434            let max_ordinal: u64 = self.max_ordinal_present();
435            encoder.write_num(max_ordinal, offset);
436            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
437            // Calling encoder.out_of_line_offset(0) is not allowed.
438            if max_ordinal == 0 {
439                return Ok(());
440            }
441            depth.increment()?;
442            let envelope_size = 8;
443            let bytes_len = max_ordinal as usize * envelope_size;
444            #[allow(unused_variables)]
445            let offset = encoder.out_of_line_offset(bytes_len);
446            let mut _prev_end_offset: usize = 0;
447            if 1 > max_ordinal {
448                return Ok(());
449            }
450
451            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
452            // are envelope_size bytes.
453            let cur_offset: usize = (1 - 1) * envelope_size;
454
455            // Zero reserved fields.
456            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
457
458            // Safety:
459            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
460            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
461            //   envelope_size bytes, there is always sufficient room.
462            fidl::encoding::encode_in_envelope_optional::<bool, D>(
463                self.color_inversion_enabled
464                    .as_ref()
465                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
466                encoder,
467                offset + cur_offset,
468                depth,
469            )?;
470
471            _prev_end_offset = cur_offset + envelope_size;
472            if 2 > max_ordinal {
473                return Ok(());
474            }
475
476            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
477            // are envelope_size bytes.
478            let cur_offset: usize = (2 - 1) * envelope_size;
479
480            // Zero reserved fields.
481            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
482
483            // Safety:
484            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
485            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
486            //   envelope_size bytes, there is always sufficient room.
487            fidl::encoding::encode_in_envelope_optional::<ColorCorrectionMode, D>(
488                self.color_correction
489                    .as_ref()
490                    .map(<ColorCorrectionMode as fidl::encoding::ValueTypeMarker>::borrow),
491                encoder,
492                offset + cur_offset,
493                depth,
494            )?;
495
496            _prev_end_offset = cur_offset + envelope_size;
497            if 3 > max_ordinal {
498                return Ok(());
499            }
500
501            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
502            // are envelope_size bytes.
503            let cur_offset: usize = (3 - 1) * envelope_size;
504
505            // Zero reserved fields.
506            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
507
508            // Safety:
509            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
510            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
511            //   envelope_size bytes, there is always sufficient room.
512            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<f32, 9>, D>(
513                self.color_adjustment_matrix.as_ref().map(
514                    <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow,
515                ),
516                encoder,
517                offset + cur_offset,
518                depth,
519            )?;
520
521            _prev_end_offset = cur_offset + envelope_size;
522            if 4 > max_ordinal {
523                return Ok(());
524            }
525
526            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
527            // are envelope_size bytes.
528            let cur_offset: usize = (4 - 1) * envelope_size;
529
530            // Zero reserved fields.
531            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
532
533            // Safety:
534            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
535            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
536            //   envelope_size bytes, there is always sufficient room.
537            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<f32, 3>, D>(
538                self.color_adjustment_pre_offset.as_ref().map(
539                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow,
540                ),
541                encoder,
542                offset + cur_offset,
543                depth,
544            )?;
545
546            _prev_end_offset = cur_offset + envelope_size;
547            if 5 > max_ordinal {
548                return Ok(());
549            }
550
551            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
552            // are envelope_size bytes.
553            let cur_offset: usize = (5 - 1) * envelope_size;
554
555            // Zero reserved fields.
556            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
557
558            // Safety:
559            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
560            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
561            //   envelope_size bytes, there is always sufficient room.
562            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<f32, 3>, D>(
563                self.color_adjustment_post_offset.as_ref().map(
564                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow,
565                ),
566                encoder,
567                offset + cur_offset,
568                depth,
569            )?;
570
571            _prev_end_offset = cur_offset + envelope_size;
572
573            Ok(())
574        }
575    }
576
577    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
578        for ColorTransformConfiguration
579    {
580        #[inline(always)]
581        fn new_empty() -> Self {
582            Self::default()
583        }
584
585        unsafe fn decode(
586            &mut self,
587            decoder: &mut fidl::encoding::Decoder<'_, D>,
588            offset: usize,
589            mut depth: fidl::encoding::Depth,
590        ) -> fidl::Result<()> {
591            decoder.debug_check_bounds::<Self>(offset);
592            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
593                None => return Err(fidl::Error::NotNullable),
594                Some(len) => len,
595            };
596            // Calling decoder.out_of_line_offset(0) is not allowed.
597            if len == 0 {
598                return Ok(());
599            };
600            depth.increment()?;
601            let envelope_size = 8;
602            let bytes_len = len * envelope_size;
603            let offset = decoder.out_of_line_offset(bytes_len)?;
604            // Decode the envelope for each type.
605            let mut _next_ordinal_to_read = 0;
606            let mut next_offset = offset;
607            let end_offset = offset + bytes_len;
608            _next_ordinal_to_read += 1;
609            if next_offset >= end_offset {
610                return Ok(());
611            }
612
613            // Decode unknown envelopes for gaps in ordinals.
614            while _next_ordinal_to_read < 1 {
615                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
616                _next_ordinal_to_read += 1;
617                next_offset += envelope_size;
618            }
619
620            let next_out_of_line = decoder.next_out_of_line();
621            let handles_before = decoder.remaining_handles();
622            if let Some((inlined, num_bytes, num_handles)) =
623                fidl::encoding::decode_envelope_header(decoder, next_offset)?
624            {
625                let member_inline_size =
626                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
627                if inlined != (member_inline_size <= 4) {
628                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
629                }
630                let inner_offset;
631                let mut inner_depth = depth.clone();
632                if inlined {
633                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
634                    inner_offset = next_offset;
635                } else {
636                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
637                    inner_depth.increment()?;
638                }
639                let val_ref =
640                    self.color_inversion_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
641                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
642                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
643                {
644                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
645                }
646                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
647                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
648                }
649            }
650
651            next_offset += envelope_size;
652            _next_ordinal_to_read += 1;
653            if next_offset >= end_offset {
654                return Ok(());
655            }
656
657            // Decode unknown envelopes for gaps in ordinals.
658            while _next_ordinal_to_read < 2 {
659                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
660                _next_ordinal_to_read += 1;
661                next_offset += envelope_size;
662            }
663
664            let next_out_of_line = decoder.next_out_of_line();
665            let handles_before = decoder.remaining_handles();
666            if let Some((inlined, num_bytes, num_handles)) =
667                fidl::encoding::decode_envelope_header(decoder, next_offset)?
668            {
669                let member_inline_size =
670                    <ColorCorrectionMode as fidl::encoding::TypeMarker>::inline_size(
671                        decoder.context,
672                    );
673                if inlined != (member_inline_size <= 4) {
674                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
675                }
676                let inner_offset;
677                let mut inner_depth = depth.clone();
678                if inlined {
679                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
680                    inner_offset = next_offset;
681                } else {
682                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
683                    inner_depth.increment()?;
684                }
685                let val_ref = self
686                    .color_correction
687                    .get_or_insert_with(|| fidl::new_empty!(ColorCorrectionMode, D));
688                fidl::decode!(ColorCorrectionMode, D, val_ref, decoder, inner_offset, inner_depth)?;
689                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
690                {
691                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
692                }
693                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
694                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
695                }
696            }
697
698            next_offset += envelope_size;
699            _next_ordinal_to_read += 1;
700            if next_offset >= end_offset {
701                return Ok(());
702            }
703
704            // Decode unknown envelopes for gaps in ordinals.
705            while _next_ordinal_to_read < 3 {
706                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
707                _next_ordinal_to_read += 1;
708                next_offset += envelope_size;
709            }
710
711            let next_out_of_line = decoder.next_out_of_line();
712            let handles_before = decoder.remaining_handles();
713            if let Some((inlined, num_bytes, num_handles)) =
714                fidl::encoding::decode_envelope_header(decoder, next_offset)?
715            {
716                let member_inline_size =
717                    <fidl::encoding::Array<f32, 9> as fidl::encoding::TypeMarker>::inline_size(
718                        decoder.context,
719                    );
720                if inlined != (member_inline_size <= 4) {
721                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
722                }
723                let inner_offset;
724                let mut inner_depth = depth.clone();
725                if inlined {
726                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
727                    inner_offset = next_offset;
728                } else {
729                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
730                    inner_depth.increment()?;
731                }
732                let val_ref = self
733                    .color_adjustment_matrix
734                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 9>, D));
735                fidl::decode!(fidl::encoding::Array<f32, 9>, D, val_ref, decoder, inner_offset, inner_depth)?;
736                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
737                {
738                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
739                }
740                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
741                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
742                }
743            }
744
745            next_offset += envelope_size;
746            _next_ordinal_to_read += 1;
747            if next_offset >= end_offset {
748                return Ok(());
749            }
750
751            // Decode unknown envelopes for gaps in ordinals.
752            while _next_ordinal_to_read < 4 {
753                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
754                _next_ordinal_to_read += 1;
755                next_offset += envelope_size;
756            }
757
758            let next_out_of_line = decoder.next_out_of_line();
759            let handles_before = decoder.remaining_handles();
760            if let Some((inlined, num_bytes, num_handles)) =
761                fidl::encoding::decode_envelope_header(decoder, next_offset)?
762            {
763                let member_inline_size =
764                    <fidl::encoding::Array<f32, 3> as fidl::encoding::TypeMarker>::inline_size(
765                        decoder.context,
766                    );
767                if inlined != (member_inline_size <= 4) {
768                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
769                }
770                let inner_offset;
771                let mut inner_depth = depth.clone();
772                if inlined {
773                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
774                    inner_offset = next_offset;
775                } else {
776                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
777                    inner_depth.increment()?;
778                }
779                let val_ref = self
780                    .color_adjustment_pre_offset
781                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 3>, D));
782                fidl::decode!(fidl::encoding::Array<f32, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
783                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
784                {
785                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
786                }
787                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
788                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
789                }
790            }
791
792            next_offset += envelope_size;
793            _next_ordinal_to_read += 1;
794            if next_offset >= end_offset {
795                return Ok(());
796            }
797
798            // Decode unknown envelopes for gaps in ordinals.
799            while _next_ordinal_to_read < 5 {
800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
801                _next_ordinal_to_read += 1;
802                next_offset += envelope_size;
803            }
804
805            let next_out_of_line = decoder.next_out_of_line();
806            let handles_before = decoder.remaining_handles();
807            if let Some((inlined, num_bytes, num_handles)) =
808                fidl::encoding::decode_envelope_header(decoder, next_offset)?
809            {
810                let member_inline_size =
811                    <fidl::encoding::Array<f32, 3> as fidl::encoding::TypeMarker>::inline_size(
812                        decoder.context,
813                    );
814                if inlined != (member_inline_size <= 4) {
815                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
816                }
817                let inner_offset;
818                let mut inner_depth = depth.clone();
819                if inlined {
820                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
821                    inner_offset = next_offset;
822                } else {
823                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
824                    inner_depth.increment()?;
825                }
826                let val_ref = self
827                    .color_adjustment_post_offset
828                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 3>, D));
829                fidl::decode!(fidl::encoding::Array<f32, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
830                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
831                {
832                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
833                }
834                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
835                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
836                }
837            }
838
839            next_offset += envelope_size;
840
841            // Decode the remaining unknown envelopes.
842            while next_offset < end_offset {
843                _next_ordinal_to_read += 1;
844                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
845                next_offset += envelope_size;
846            }
847
848            Ok(())
849        }
850    }
851}