fidl_fuchsia_ui_brightness__common/
fidl_fuchsia_ui_brightness__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/// A normalized relative brightness adjustment in the range
12/// 0.0 (off/minimum) to 1.0 (maximum).
13pub type Brightness = f32;
14
15/// A tuple representing a point on the auto-brightness curve
16/// Ambient_lux and nits must be positive values.
17#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
18pub struct BrightnessPoint {
19    pub ambient_lux: f32,
20    pub display_nits: f32,
21}
22
23impl fidl::Persistable for BrightnessPoint {}
24
25/// A set of points defining the auto-brightness curve.
26/// The ambient_lux values must be monotonically increasing.
27#[derive(Clone, Debug, PartialEq, PartialOrd)]
28pub struct BrightnessTable {
29    pub points: Vec<BrightnessPoint>,
30}
31
32impl fidl::Persistable for BrightnessTable {}
33
34#[derive(Clone, Debug, PartialEq)]
35pub struct ColorAdjustmentHandlerSetColorAdjustmentRequest {
36    pub color_adjustment: ColorAdjustmentTable,
37}
38
39impl fidl::Persistable for ColorAdjustmentHandlerSetColorAdjustmentRequest {}
40
41#[derive(Clone, Debug, PartialEq)]
42pub struct ColorAdjustmentSetDiscreteColorAdjustmentRequest {
43    pub color_adjustment: ColorAdjustmentTable,
44}
45
46impl fidl::Persistable for ColorAdjustmentSetDiscreteColorAdjustmentRequest {}
47
48#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
49pub struct ControlSetAutoBrightnessAdjustmentRequest {
50    pub adjustment: f32,
51}
52
53impl fidl::Persistable for ControlSetAutoBrightnessAdjustmentRequest {}
54
55#[derive(Clone, Debug, PartialEq, PartialOrd)]
56pub struct ControlSetBrightnessTableRequest {
57    pub table: BrightnessTable,
58}
59
60impl fidl::Persistable for ControlSetBrightnessTableRequest {}
61
62#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
63pub struct ControlSetManualBrightnessRequest {
64    pub value: f32,
65}
66
67impl fidl::Persistable for ControlSetManualBrightnessRequest {}
68
69#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
70pub struct ControlSetManualBrightnessSmoothRequest {
71    pub value: f32,
72    pub duration: i64,
73}
74
75impl fidl::Persistable for ControlSetManualBrightnessSmoothRequest {}
76
77#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
78pub struct ControlWatchAutoBrightnessAdjustmentResponse {
79    pub adjustment: f32,
80}
81
82impl fidl::Persistable for ControlWatchAutoBrightnessAdjustmentResponse {}
83
84#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct ControlWatchAutoBrightnessResponse {
86    pub enabled: bool,
87}
88
89impl fidl::Persistable for ControlWatchAutoBrightnessResponse {}
90
91#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
92pub struct ControlWatchCurrentBrightnessResponse {
93    pub value: f32,
94}
95
96impl fidl::Persistable for ControlWatchCurrentBrightnessResponse {}
97
98#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
99pub struct ControlGetMaxAbsoluteBrightnessResponse {
100    pub max_brightness: f64,
101}
102
103impl fidl::Persistable for ControlGetMaxAbsoluteBrightnessResponse {}
104
105/// The table for screen color tint adjustments.
106#[derive(Clone, Debug, Default, PartialEq)]
107pub struct ColorAdjustmentTable {
108    /// 3x3 Matrix in row-major form which will be used by root presenter
109    /// to apply color adjustment.
110    /// This field may be omitted to disable color adjustment.
111    pub matrix: Option<[f32; 9]>,
112    #[doc(hidden)]
113    pub __source_breaking: fidl::marker::SourceBreaking,
114}
115
116impl fidl::Persistable for ColorAdjustmentTable {}
117
118pub mod color_adjustment_ordinals {
119    pub const SET_DISCRETE_COLOR_ADJUSTMENT: u64 = 0x48d90d2e62d451c4;
120}
121
122pub mod color_adjustment_handler_ordinals {
123    pub const SET_COLOR_ADJUSTMENT: u64 = 0x6277992fee8aea3d;
124}
125
126pub mod control_ordinals {
127    pub const SET_AUTO_BRIGHTNESS: u64 = 0x46b623a7fa77a979;
128    pub const WATCH_AUTO_BRIGHTNESS: u64 = 0xd956a90c115186b;
129    pub const SET_MANUAL_BRIGHTNESS: u64 = 0x1e333aa49771e1eb;
130    pub const SET_MANUAL_BRIGHTNESS_SMOOTH: u64 = 0x7b7d273c20a61d0c;
131    pub const WATCH_CURRENT_BRIGHTNESS: u64 = 0x2cc3011e2326d4d8;
132    pub const SET_AUTO_BRIGHTNESS_ADJUSTMENT: u64 = 0x678ee26bc217d996;
133    pub const WATCH_AUTO_BRIGHTNESS_ADJUSTMENT: u64 = 0x7c373aafe0058135;
134    pub const SET_BRIGHTNESS_TABLE: u64 = 0x11d419413129dcee;
135    pub const GET_MAX_ABSOLUTE_BRIGHTNESS: u64 = 0x73055a8d6422caf8;
136}
137
138mod internal {
139    use super::*;
140
141    impl fidl::encoding::ValueTypeMarker for BrightnessPoint {
142        type Borrowed<'a> = &'a Self;
143        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
144            value
145        }
146    }
147
148    unsafe impl fidl::encoding::TypeMarker for BrightnessPoint {
149        type Owned = Self;
150
151        #[inline(always)]
152        fn inline_align(_context: fidl::encoding::Context) -> usize {
153            4
154        }
155
156        #[inline(always)]
157        fn inline_size(_context: fidl::encoding::Context) -> usize {
158            8
159        }
160    }
161
162    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BrightnessPoint, D>
163        for &BrightnessPoint
164    {
165        #[inline]
166        unsafe fn encode(
167            self,
168            encoder: &mut fidl::encoding::Encoder<'_, D>,
169            offset: usize,
170            _depth: fidl::encoding::Depth,
171        ) -> fidl::Result<()> {
172            encoder.debug_check_bounds::<BrightnessPoint>(offset);
173            // Delegate to tuple encoding.
174            fidl::encoding::Encode::<BrightnessPoint, D>::encode(
175                (
176                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.ambient_lux),
177                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.display_nits),
178                ),
179                encoder,
180                offset,
181                _depth,
182            )
183        }
184    }
185    unsafe impl<
186            D: fidl::encoding::ResourceDialect,
187            T0: fidl::encoding::Encode<f32, D>,
188            T1: fidl::encoding::Encode<f32, D>,
189        > fidl::encoding::Encode<BrightnessPoint, D> for (T0, T1)
190    {
191        #[inline]
192        unsafe fn encode(
193            self,
194            encoder: &mut fidl::encoding::Encoder<'_, D>,
195            offset: usize,
196            depth: fidl::encoding::Depth,
197        ) -> fidl::Result<()> {
198            encoder.debug_check_bounds::<BrightnessPoint>(offset);
199            // Zero out padding regions. There's no need to apply masks
200            // because the unmasked parts will be overwritten by fields.
201            // Write the fields.
202            self.0.encode(encoder, offset + 0, depth)?;
203            self.1.encode(encoder, offset + 4, depth)?;
204            Ok(())
205        }
206    }
207
208    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrightnessPoint {
209        #[inline(always)]
210        fn new_empty() -> Self {
211            Self { ambient_lux: fidl::new_empty!(f32, D), display_nits: fidl::new_empty!(f32, D) }
212        }
213
214        #[inline]
215        unsafe fn decode(
216            &mut self,
217            decoder: &mut fidl::encoding::Decoder<'_, D>,
218            offset: usize,
219            _depth: fidl::encoding::Depth,
220        ) -> fidl::Result<()> {
221            decoder.debug_check_bounds::<Self>(offset);
222            // Verify that padding bytes are zero.
223            fidl::decode!(f32, D, &mut self.ambient_lux, decoder, offset + 0, _depth)?;
224            fidl::decode!(f32, D, &mut self.display_nits, decoder, offset + 4, _depth)?;
225            Ok(())
226        }
227    }
228
229    impl fidl::encoding::ValueTypeMarker for BrightnessTable {
230        type Borrowed<'a> = &'a Self;
231        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
232            value
233        }
234    }
235
236    unsafe impl fidl::encoding::TypeMarker for BrightnessTable {
237        type Owned = Self;
238
239        #[inline(always)]
240        fn inline_align(_context: fidl::encoding::Context) -> usize {
241            8
242        }
243
244        #[inline(always)]
245        fn inline_size(_context: fidl::encoding::Context) -> usize {
246            16
247        }
248    }
249
250    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BrightnessTable, D>
251        for &BrightnessTable
252    {
253        #[inline]
254        unsafe fn encode(
255            self,
256            encoder: &mut fidl::encoding::Encoder<'_, D>,
257            offset: usize,
258            _depth: fidl::encoding::Depth,
259        ) -> fidl::Result<()> {
260            encoder.debug_check_bounds::<BrightnessTable>(offset);
261            // Delegate to tuple encoding.
262            fidl::encoding::Encode::<BrightnessTable, D>::encode(
263                (
264                    <fidl::encoding::Vector<BrightnessPoint, 50> as fidl::encoding::ValueTypeMarker>::borrow(&self.points),
265                ),
266                encoder, offset, _depth
267            )
268        }
269    }
270    unsafe impl<
271            D: fidl::encoding::ResourceDialect,
272            T0: fidl::encoding::Encode<fidl::encoding::Vector<BrightnessPoint, 50>, D>,
273        > fidl::encoding::Encode<BrightnessTable, D> for (T0,)
274    {
275        #[inline]
276        unsafe fn encode(
277            self,
278            encoder: &mut fidl::encoding::Encoder<'_, D>,
279            offset: usize,
280            depth: fidl::encoding::Depth,
281        ) -> fidl::Result<()> {
282            encoder.debug_check_bounds::<BrightnessTable>(offset);
283            // Zero out padding regions. There's no need to apply masks
284            // because the unmasked parts will be overwritten by fields.
285            // Write the fields.
286            self.0.encode(encoder, offset + 0, depth)?;
287            Ok(())
288        }
289    }
290
291    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrightnessTable {
292        #[inline(always)]
293        fn new_empty() -> Self {
294            Self { points: fidl::new_empty!(fidl::encoding::Vector<BrightnessPoint, 50>, D) }
295        }
296
297        #[inline]
298        unsafe fn decode(
299            &mut self,
300            decoder: &mut fidl::encoding::Decoder<'_, D>,
301            offset: usize,
302            _depth: fidl::encoding::Depth,
303        ) -> fidl::Result<()> {
304            decoder.debug_check_bounds::<Self>(offset);
305            // Verify that padding bytes are zero.
306            fidl::decode!(fidl::encoding::Vector<BrightnessPoint, 50>, D, &mut self.points, decoder, offset + 0, _depth)?;
307            Ok(())
308        }
309    }
310
311    impl fidl::encoding::ValueTypeMarker for ColorAdjustmentHandlerSetColorAdjustmentRequest {
312        type Borrowed<'a> = &'a Self;
313        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
314            value
315        }
316    }
317
318    unsafe impl fidl::encoding::TypeMarker for ColorAdjustmentHandlerSetColorAdjustmentRequest {
319        type Owned = Self;
320
321        #[inline(always)]
322        fn inline_align(_context: fidl::encoding::Context) -> usize {
323            8
324        }
325
326        #[inline(always)]
327        fn inline_size(_context: fidl::encoding::Context) -> usize {
328            16
329        }
330    }
331
332    unsafe impl<D: fidl::encoding::ResourceDialect>
333        fidl::encoding::Encode<ColorAdjustmentHandlerSetColorAdjustmentRequest, D>
334        for &ColorAdjustmentHandlerSetColorAdjustmentRequest
335    {
336        #[inline]
337        unsafe fn encode(
338            self,
339            encoder: &mut fidl::encoding::Encoder<'_, D>,
340            offset: usize,
341            _depth: fidl::encoding::Depth,
342        ) -> fidl::Result<()> {
343            encoder.debug_check_bounds::<ColorAdjustmentHandlerSetColorAdjustmentRequest>(offset);
344            // Delegate to tuple encoding.
345            fidl::encoding::Encode::<ColorAdjustmentHandlerSetColorAdjustmentRequest, D>::encode(
346                (<ColorAdjustmentTable as fidl::encoding::ValueTypeMarker>::borrow(
347                    &self.color_adjustment,
348                ),),
349                encoder,
350                offset,
351                _depth,
352            )
353        }
354    }
355    unsafe impl<
356            D: fidl::encoding::ResourceDialect,
357            T0: fidl::encoding::Encode<ColorAdjustmentTable, D>,
358        > fidl::encoding::Encode<ColorAdjustmentHandlerSetColorAdjustmentRequest, D> for (T0,)
359    {
360        #[inline]
361        unsafe fn encode(
362            self,
363            encoder: &mut fidl::encoding::Encoder<'_, D>,
364            offset: usize,
365            depth: fidl::encoding::Depth,
366        ) -> fidl::Result<()> {
367            encoder.debug_check_bounds::<ColorAdjustmentHandlerSetColorAdjustmentRequest>(offset);
368            // Zero out padding regions. There's no need to apply masks
369            // because the unmasked parts will be overwritten by fields.
370            // Write the fields.
371            self.0.encode(encoder, offset + 0, depth)?;
372            Ok(())
373        }
374    }
375
376    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
377        for ColorAdjustmentHandlerSetColorAdjustmentRequest
378    {
379        #[inline(always)]
380        fn new_empty() -> Self {
381            Self { color_adjustment: fidl::new_empty!(ColorAdjustmentTable, D) }
382        }
383
384        #[inline]
385        unsafe fn decode(
386            &mut self,
387            decoder: &mut fidl::encoding::Decoder<'_, D>,
388            offset: usize,
389            _depth: fidl::encoding::Depth,
390        ) -> fidl::Result<()> {
391            decoder.debug_check_bounds::<Self>(offset);
392            // Verify that padding bytes are zero.
393            fidl::decode!(
394                ColorAdjustmentTable,
395                D,
396                &mut self.color_adjustment,
397                decoder,
398                offset + 0,
399                _depth
400            )?;
401            Ok(())
402        }
403    }
404
405    impl fidl::encoding::ValueTypeMarker for ColorAdjustmentSetDiscreteColorAdjustmentRequest {
406        type Borrowed<'a> = &'a Self;
407        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
408            value
409        }
410    }
411
412    unsafe impl fidl::encoding::TypeMarker for ColorAdjustmentSetDiscreteColorAdjustmentRequest {
413        type Owned = Self;
414
415        #[inline(always)]
416        fn inline_align(_context: fidl::encoding::Context) -> usize {
417            8
418        }
419
420        #[inline(always)]
421        fn inline_size(_context: fidl::encoding::Context) -> usize {
422            16
423        }
424    }
425
426    unsafe impl<D: fidl::encoding::ResourceDialect>
427        fidl::encoding::Encode<ColorAdjustmentSetDiscreteColorAdjustmentRequest, D>
428        for &ColorAdjustmentSetDiscreteColorAdjustmentRequest
429    {
430        #[inline]
431        unsafe fn encode(
432            self,
433            encoder: &mut fidl::encoding::Encoder<'_, D>,
434            offset: usize,
435            _depth: fidl::encoding::Depth,
436        ) -> fidl::Result<()> {
437            encoder.debug_check_bounds::<ColorAdjustmentSetDiscreteColorAdjustmentRequest>(offset);
438            // Delegate to tuple encoding.
439            fidl::encoding::Encode::<ColorAdjustmentSetDiscreteColorAdjustmentRequest, D>::encode(
440                (<ColorAdjustmentTable as fidl::encoding::ValueTypeMarker>::borrow(
441                    &self.color_adjustment,
442                ),),
443                encoder,
444                offset,
445                _depth,
446            )
447        }
448    }
449    unsafe impl<
450            D: fidl::encoding::ResourceDialect,
451            T0: fidl::encoding::Encode<ColorAdjustmentTable, D>,
452        > fidl::encoding::Encode<ColorAdjustmentSetDiscreteColorAdjustmentRequest, D> for (T0,)
453    {
454        #[inline]
455        unsafe fn encode(
456            self,
457            encoder: &mut fidl::encoding::Encoder<'_, D>,
458            offset: usize,
459            depth: fidl::encoding::Depth,
460        ) -> fidl::Result<()> {
461            encoder.debug_check_bounds::<ColorAdjustmentSetDiscreteColorAdjustmentRequest>(offset);
462            // Zero out padding regions. There's no need to apply masks
463            // because the unmasked parts will be overwritten by fields.
464            // Write the fields.
465            self.0.encode(encoder, offset + 0, depth)?;
466            Ok(())
467        }
468    }
469
470    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
471        for ColorAdjustmentSetDiscreteColorAdjustmentRequest
472    {
473        #[inline(always)]
474        fn new_empty() -> Self {
475            Self { color_adjustment: fidl::new_empty!(ColorAdjustmentTable, D) }
476        }
477
478        #[inline]
479        unsafe fn decode(
480            &mut self,
481            decoder: &mut fidl::encoding::Decoder<'_, D>,
482            offset: usize,
483            _depth: fidl::encoding::Depth,
484        ) -> fidl::Result<()> {
485            decoder.debug_check_bounds::<Self>(offset);
486            // Verify that padding bytes are zero.
487            fidl::decode!(
488                ColorAdjustmentTable,
489                D,
490                &mut self.color_adjustment,
491                decoder,
492                offset + 0,
493                _depth
494            )?;
495            Ok(())
496        }
497    }
498
499    impl fidl::encoding::ValueTypeMarker for ControlSetAutoBrightnessAdjustmentRequest {
500        type Borrowed<'a> = &'a Self;
501        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
502            value
503        }
504    }
505
506    unsafe impl fidl::encoding::TypeMarker for ControlSetAutoBrightnessAdjustmentRequest {
507        type Owned = Self;
508
509        #[inline(always)]
510        fn inline_align(_context: fidl::encoding::Context) -> usize {
511            4
512        }
513
514        #[inline(always)]
515        fn inline_size(_context: fidl::encoding::Context) -> usize {
516            4
517        }
518    }
519
520    unsafe impl<D: fidl::encoding::ResourceDialect>
521        fidl::encoding::Encode<ControlSetAutoBrightnessAdjustmentRequest, D>
522        for &ControlSetAutoBrightnessAdjustmentRequest
523    {
524        #[inline]
525        unsafe fn encode(
526            self,
527            encoder: &mut fidl::encoding::Encoder<'_, D>,
528            offset: usize,
529            _depth: fidl::encoding::Depth,
530        ) -> fidl::Result<()> {
531            encoder.debug_check_bounds::<ControlSetAutoBrightnessAdjustmentRequest>(offset);
532            // Delegate to tuple encoding.
533            fidl::encoding::Encode::<ControlSetAutoBrightnessAdjustmentRequest, D>::encode(
534                (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.adjustment),),
535                encoder,
536                offset,
537                _depth,
538            )
539        }
540    }
541    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
542        fidl::encoding::Encode<ControlSetAutoBrightnessAdjustmentRequest, D> for (T0,)
543    {
544        #[inline]
545        unsafe fn encode(
546            self,
547            encoder: &mut fidl::encoding::Encoder<'_, D>,
548            offset: usize,
549            depth: fidl::encoding::Depth,
550        ) -> fidl::Result<()> {
551            encoder.debug_check_bounds::<ControlSetAutoBrightnessAdjustmentRequest>(offset);
552            // Zero out padding regions. There's no need to apply masks
553            // because the unmasked parts will be overwritten by fields.
554            // Write the fields.
555            self.0.encode(encoder, offset + 0, depth)?;
556            Ok(())
557        }
558    }
559
560    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
561        for ControlSetAutoBrightnessAdjustmentRequest
562    {
563        #[inline(always)]
564        fn new_empty() -> Self {
565            Self { adjustment: fidl::new_empty!(f32, D) }
566        }
567
568        #[inline]
569        unsafe fn decode(
570            &mut self,
571            decoder: &mut fidl::encoding::Decoder<'_, D>,
572            offset: usize,
573            _depth: fidl::encoding::Depth,
574        ) -> fidl::Result<()> {
575            decoder.debug_check_bounds::<Self>(offset);
576            // Verify that padding bytes are zero.
577            fidl::decode!(f32, D, &mut self.adjustment, decoder, offset + 0, _depth)?;
578            Ok(())
579        }
580    }
581
582    impl fidl::encoding::ValueTypeMarker for ControlSetBrightnessTableRequest {
583        type Borrowed<'a> = &'a Self;
584        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
585            value
586        }
587    }
588
589    unsafe impl fidl::encoding::TypeMarker for ControlSetBrightnessTableRequest {
590        type Owned = Self;
591
592        #[inline(always)]
593        fn inline_align(_context: fidl::encoding::Context) -> usize {
594            8
595        }
596
597        #[inline(always)]
598        fn inline_size(_context: fidl::encoding::Context) -> usize {
599            16
600        }
601    }
602
603    unsafe impl<D: fidl::encoding::ResourceDialect>
604        fidl::encoding::Encode<ControlSetBrightnessTableRequest, D>
605        for &ControlSetBrightnessTableRequest
606    {
607        #[inline]
608        unsafe fn encode(
609            self,
610            encoder: &mut fidl::encoding::Encoder<'_, D>,
611            offset: usize,
612            _depth: fidl::encoding::Depth,
613        ) -> fidl::Result<()> {
614            encoder.debug_check_bounds::<ControlSetBrightnessTableRequest>(offset);
615            // Delegate to tuple encoding.
616            fidl::encoding::Encode::<ControlSetBrightnessTableRequest, D>::encode(
617                (<BrightnessTable as fidl::encoding::ValueTypeMarker>::borrow(&self.table),),
618                encoder,
619                offset,
620                _depth,
621            )
622        }
623    }
624    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BrightnessTable, D>>
625        fidl::encoding::Encode<ControlSetBrightnessTableRequest, D> for (T0,)
626    {
627        #[inline]
628        unsafe fn encode(
629            self,
630            encoder: &mut fidl::encoding::Encoder<'_, D>,
631            offset: usize,
632            depth: fidl::encoding::Depth,
633        ) -> fidl::Result<()> {
634            encoder.debug_check_bounds::<ControlSetBrightnessTableRequest>(offset);
635            // Zero out padding regions. There's no need to apply masks
636            // because the unmasked parts will be overwritten by fields.
637            // Write the fields.
638            self.0.encode(encoder, offset + 0, depth)?;
639            Ok(())
640        }
641    }
642
643    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
644        for ControlSetBrightnessTableRequest
645    {
646        #[inline(always)]
647        fn new_empty() -> Self {
648            Self { table: fidl::new_empty!(BrightnessTable, D) }
649        }
650
651        #[inline]
652        unsafe fn decode(
653            &mut self,
654            decoder: &mut fidl::encoding::Decoder<'_, D>,
655            offset: usize,
656            _depth: fidl::encoding::Depth,
657        ) -> fidl::Result<()> {
658            decoder.debug_check_bounds::<Self>(offset);
659            // Verify that padding bytes are zero.
660            fidl::decode!(BrightnessTable, D, &mut self.table, decoder, offset + 0, _depth)?;
661            Ok(())
662        }
663    }
664
665    impl fidl::encoding::ValueTypeMarker for ControlSetManualBrightnessRequest {
666        type Borrowed<'a> = &'a Self;
667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
668            value
669        }
670    }
671
672    unsafe impl fidl::encoding::TypeMarker for ControlSetManualBrightnessRequest {
673        type Owned = Self;
674
675        #[inline(always)]
676        fn inline_align(_context: fidl::encoding::Context) -> usize {
677            4
678        }
679
680        #[inline(always)]
681        fn inline_size(_context: fidl::encoding::Context) -> usize {
682            4
683        }
684    }
685
686    unsafe impl<D: fidl::encoding::ResourceDialect>
687        fidl::encoding::Encode<ControlSetManualBrightnessRequest, D>
688        for &ControlSetManualBrightnessRequest
689    {
690        #[inline]
691        unsafe fn encode(
692            self,
693            encoder: &mut fidl::encoding::Encoder<'_, D>,
694            offset: usize,
695            _depth: fidl::encoding::Depth,
696        ) -> fidl::Result<()> {
697            encoder.debug_check_bounds::<ControlSetManualBrightnessRequest>(offset);
698            // Delegate to tuple encoding.
699            fidl::encoding::Encode::<ControlSetManualBrightnessRequest, D>::encode(
700                (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
701                encoder,
702                offset,
703                _depth,
704            )
705        }
706    }
707    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
708        fidl::encoding::Encode<ControlSetManualBrightnessRequest, D> for (T0,)
709    {
710        #[inline]
711        unsafe fn encode(
712            self,
713            encoder: &mut fidl::encoding::Encoder<'_, D>,
714            offset: usize,
715            depth: fidl::encoding::Depth,
716        ) -> fidl::Result<()> {
717            encoder.debug_check_bounds::<ControlSetManualBrightnessRequest>(offset);
718            // Zero out padding regions. There's no need to apply masks
719            // because the unmasked parts will be overwritten by fields.
720            // Write the fields.
721            self.0.encode(encoder, offset + 0, depth)?;
722            Ok(())
723        }
724    }
725
726    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
727        for ControlSetManualBrightnessRequest
728    {
729        #[inline(always)]
730        fn new_empty() -> Self {
731            Self { value: fidl::new_empty!(f32, D) }
732        }
733
734        #[inline]
735        unsafe fn decode(
736            &mut self,
737            decoder: &mut fidl::encoding::Decoder<'_, D>,
738            offset: usize,
739            _depth: fidl::encoding::Depth,
740        ) -> fidl::Result<()> {
741            decoder.debug_check_bounds::<Self>(offset);
742            // Verify that padding bytes are zero.
743            fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
744            Ok(())
745        }
746    }
747
748    impl fidl::encoding::ValueTypeMarker for ControlSetManualBrightnessSmoothRequest {
749        type Borrowed<'a> = &'a Self;
750        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
751            value
752        }
753    }
754
755    unsafe impl fidl::encoding::TypeMarker for ControlSetManualBrightnessSmoothRequest {
756        type Owned = Self;
757
758        #[inline(always)]
759        fn inline_align(_context: fidl::encoding::Context) -> usize {
760            8
761        }
762
763        #[inline(always)]
764        fn inline_size(_context: fidl::encoding::Context) -> usize {
765            16
766        }
767    }
768
769    unsafe impl<D: fidl::encoding::ResourceDialect>
770        fidl::encoding::Encode<ControlSetManualBrightnessSmoothRequest, D>
771        for &ControlSetManualBrightnessSmoothRequest
772    {
773        #[inline]
774        unsafe fn encode(
775            self,
776            encoder: &mut fidl::encoding::Encoder<'_, D>,
777            offset: usize,
778            _depth: fidl::encoding::Depth,
779        ) -> fidl::Result<()> {
780            encoder.debug_check_bounds::<ControlSetManualBrightnessSmoothRequest>(offset);
781            // Delegate to tuple encoding.
782            fidl::encoding::Encode::<ControlSetManualBrightnessSmoothRequest, D>::encode(
783                (
784                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
785                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.duration),
786                ),
787                encoder,
788                offset,
789                _depth,
790            )
791        }
792    }
793    unsafe impl<
794            D: fidl::encoding::ResourceDialect,
795            T0: fidl::encoding::Encode<f32, D>,
796            T1: fidl::encoding::Encode<i64, D>,
797        > fidl::encoding::Encode<ControlSetManualBrightnessSmoothRequest, D> for (T0, T1)
798    {
799        #[inline]
800        unsafe fn encode(
801            self,
802            encoder: &mut fidl::encoding::Encoder<'_, D>,
803            offset: usize,
804            depth: fidl::encoding::Depth,
805        ) -> fidl::Result<()> {
806            encoder.debug_check_bounds::<ControlSetManualBrightnessSmoothRequest>(offset);
807            // Zero out padding regions. There's no need to apply masks
808            // because the unmasked parts will be overwritten by fields.
809            unsafe {
810                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
811                (ptr as *mut u64).write_unaligned(0);
812            }
813            // Write the fields.
814            self.0.encode(encoder, offset + 0, depth)?;
815            self.1.encode(encoder, offset + 8, depth)?;
816            Ok(())
817        }
818    }
819
820    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
821        for ControlSetManualBrightnessSmoothRequest
822    {
823        #[inline(always)]
824        fn new_empty() -> Self {
825            Self { value: fidl::new_empty!(f32, D), duration: fidl::new_empty!(i64, D) }
826        }
827
828        #[inline]
829        unsafe fn decode(
830            &mut self,
831            decoder: &mut fidl::encoding::Decoder<'_, D>,
832            offset: usize,
833            _depth: fidl::encoding::Depth,
834        ) -> fidl::Result<()> {
835            decoder.debug_check_bounds::<Self>(offset);
836            // Verify that padding bytes are zero.
837            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
838            let padval = unsafe { (ptr as *const u64).read_unaligned() };
839            let mask = 0xffffffff00000000u64;
840            let maskedval = padval & mask;
841            if maskedval != 0 {
842                return Err(fidl::Error::NonZeroPadding {
843                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
844                });
845            }
846            fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
847            fidl::decode!(i64, D, &mut self.duration, decoder, offset + 8, _depth)?;
848            Ok(())
849        }
850    }
851
852    impl fidl::encoding::ValueTypeMarker for ControlWatchAutoBrightnessAdjustmentResponse {
853        type Borrowed<'a> = &'a Self;
854        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
855            value
856        }
857    }
858
859    unsafe impl fidl::encoding::TypeMarker for ControlWatchAutoBrightnessAdjustmentResponse {
860        type Owned = Self;
861
862        #[inline(always)]
863        fn inline_align(_context: fidl::encoding::Context) -> usize {
864            4
865        }
866
867        #[inline(always)]
868        fn inline_size(_context: fidl::encoding::Context) -> usize {
869            4
870        }
871    }
872
873    unsafe impl<D: fidl::encoding::ResourceDialect>
874        fidl::encoding::Encode<ControlWatchAutoBrightnessAdjustmentResponse, D>
875        for &ControlWatchAutoBrightnessAdjustmentResponse
876    {
877        #[inline]
878        unsafe fn encode(
879            self,
880            encoder: &mut fidl::encoding::Encoder<'_, D>,
881            offset: usize,
882            _depth: fidl::encoding::Depth,
883        ) -> fidl::Result<()> {
884            encoder.debug_check_bounds::<ControlWatchAutoBrightnessAdjustmentResponse>(offset);
885            // Delegate to tuple encoding.
886            fidl::encoding::Encode::<ControlWatchAutoBrightnessAdjustmentResponse, D>::encode(
887                (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.adjustment),),
888                encoder,
889                offset,
890                _depth,
891            )
892        }
893    }
894    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
895        fidl::encoding::Encode<ControlWatchAutoBrightnessAdjustmentResponse, D> for (T0,)
896    {
897        #[inline]
898        unsafe fn encode(
899            self,
900            encoder: &mut fidl::encoding::Encoder<'_, D>,
901            offset: usize,
902            depth: fidl::encoding::Depth,
903        ) -> fidl::Result<()> {
904            encoder.debug_check_bounds::<ControlWatchAutoBrightnessAdjustmentResponse>(offset);
905            // Zero out padding regions. There's no need to apply masks
906            // because the unmasked parts will be overwritten by fields.
907            // Write the fields.
908            self.0.encode(encoder, offset + 0, depth)?;
909            Ok(())
910        }
911    }
912
913    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
914        for ControlWatchAutoBrightnessAdjustmentResponse
915    {
916        #[inline(always)]
917        fn new_empty() -> Self {
918            Self { adjustment: fidl::new_empty!(f32, D) }
919        }
920
921        #[inline]
922        unsafe fn decode(
923            &mut self,
924            decoder: &mut fidl::encoding::Decoder<'_, D>,
925            offset: usize,
926            _depth: fidl::encoding::Depth,
927        ) -> fidl::Result<()> {
928            decoder.debug_check_bounds::<Self>(offset);
929            // Verify that padding bytes are zero.
930            fidl::decode!(f32, D, &mut self.adjustment, decoder, offset + 0, _depth)?;
931            Ok(())
932        }
933    }
934
935    impl fidl::encoding::ValueTypeMarker for ControlWatchAutoBrightnessResponse {
936        type Borrowed<'a> = &'a Self;
937        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
938            value
939        }
940    }
941
942    unsafe impl fidl::encoding::TypeMarker for ControlWatchAutoBrightnessResponse {
943        type Owned = Self;
944
945        #[inline(always)]
946        fn inline_align(_context: fidl::encoding::Context) -> usize {
947            1
948        }
949
950        #[inline(always)]
951        fn inline_size(_context: fidl::encoding::Context) -> usize {
952            1
953        }
954    }
955
956    unsafe impl<D: fidl::encoding::ResourceDialect>
957        fidl::encoding::Encode<ControlWatchAutoBrightnessResponse, D>
958        for &ControlWatchAutoBrightnessResponse
959    {
960        #[inline]
961        unsafe fn encode(
962            self,
963            encoder: &mut fidl::encoding::Encoder<'_, D>,
964            offset: usize,
965            _depth: fidl::encoding::Depth,
966        ) -> fidl::Result<()> {
967            encoder.debug_check_bounds::<ControlWatchAutoBrightnessResponse>(offset);
968            // Delegate to tuple encoding.
969            fidl::encoding::Encode::<ControlWatchAutoBrightnessResponse, D>::encode(
970                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
971                encoder,
972                offset,
973                _depth,
974            )
975        }
976    }
977    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
978        fidl::encoding::Encode<ControlWatchAutoBrightnessResponse, D> for (T0,)
979    {
980        #[inline]
981        unsafe fn encode(
982            self,
983            encoder: &mut fidl::encoding::Encoder<'_, D>,
984            offset: usize,
985            depth: fidl::encoding::Depth,
986        ) -> fidl::Result<()> {
987            encoder.debug_check_bounds::<ControlWatchAutoBrightnessResponse>(offset);
988            // Zero out padding regions. There's no need to apply masks
989            // because the unmasked parts will be overwritten by fields.
990            // Write the fields.
991            self.0.encode(encoder, offset + 0, depth)?;
992            Ok(())
993        }
994    }
995
996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
997        for ControlWatchAutoBrightnessResponse
998    {
999        #[inline(always)]
1000        fn new_empty() -> Self {
1001            Self { enabled: fidl::new_empty!(bool, D) }
1002        }
1003
1004        #[inline]
1005        unsafe fn decode(
1006            &mut self,
1007            decoder: &mut fidl::encoding::Decoder<'_, D>,
1008            offset: usize,
1009            _depth: fidl::encoding::Depth,
1010        ) -> fidl::Result<()> {
1011            decoder.debug_check_bounds::<Self>(offset);
1012            // Verify that padding bytes are zero.
1013            fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1014            Ok(())
1015        }
1016    }
1017
1018    impl fidl::encoding::ValueTypeMarker for ControlWatchCurrentBrightnessResponse {
1019        type Borrowed<'a> = &'a Self;
1020        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1021            value
1022        }
1023    }
1024
1025    unsafe impl fidl::encoding::TypeMarker for ControlWatchCurrentBrightnessResponse {
1026        type Owned = Self;
1027
1028        #[inline(always)]
1029        fn inline_align(_context: fidl::encoding::Context) -> usize {
1030            4
1031        }
1032
1033        #[inline(always)]
1034        fn inline_size(_context: fidl::encoding::Context) -> usize {
1035            4
1036        }
1037    }
1038
1039    unsafe impl<D: fidl::encoding::ResourceDialect>
1040        fidl::encoding::Encode<ControlWatchCurrentBrightnessResponse, D>
1041        for &ControlWatchCurrentBrightnessResponse
1042    {
1043        #[inline]
1044        unsafe fn encode(
1045            self,
1046            encoder: &mut fidl::encoding::Encoder<'_, D>,
1047            offset: usize,
1048            _depth: fidl::encoding::Depth,
1049        ) -> fidl::Result<()> {
1050            encoder.debug_check_bounds::<ControlWatchCurrentBrightnessResponse>(offset);
1051            // Delegate to tuple encoding.
1052            fidl::encoding::Encode::<ControlWatchCurrentBrightnessResponse, D>::encode(
1053                (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
1054                encoder,
1055                offset,
1056                _depth,
1057            )
1058        }
1059    }
1060    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
1061        fidl::encoding::Encode<ControlWatchCurrentBrightnessResponse, D> for (T0,)
1062    {
1063        #[inline]
1064        unsafe fn encode(
1065            self,
1066            encoder: &mut fidl::encoding::Encoder<'_, D>,
1067            offset: usize,
1068            depth: fidl::encoding::Depth,
1069        ) -> fidl::Result<()> {
1070            encoder.debug_check_bounds::<ControlWatchCurrentBrightnessResponse>(offset);
1071            // Zero out padding regions. There's no need to apply masks
1072            // because the unmasked parts will be overwritten by fields.
1073            // Write the fields.
1074            self.0.encode(encoder, offset + 0, depth)?;
1075            Ok(())
1076        }
1077    }
1078
1079    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1080        for ControlWatchCurrentBrightnessResponse
1081    {
1082        #[inline(always)]
1083        fn new_empty() -> Self {
1084            Self { value: fidl::new_empty!(f32, D) }
1085        }
1086
1087        #[inline]
1088        unsafe fn decode(
1089            &mut self,
1090            decoder: &mut fidl::encoding::Decoder<'_, D>,
1091            offset: usize,
1092            _depth: fidl::encoding::Depth,
1093        ) -> fidl::Result<()> {
1094            decoder.debug_check_bounds::<Self>(offset);
1095            // Verify that padding bytes are zero.
1096            fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
1097            Ok(())
1098        }
1099    }
1100
1101    impl fidl::encoding::ValueTypeMarker for ControlGetMaxAbsoluteBrightnessResponse {
1102        type Borrowed<'a> = &'a Self;
1103        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1104            value
1105        }
1106    }
1107
1108    unsafe impl fidl::encoding::TypeMarker for ControlGetMaxAbsoluteBrightnessResponse {
1109        type Owned = Self;
1110
1111        #[inline(always)]
1112        fn inline_align(_context: fidl::encoding::Context) -> usize {
1113            8
1114        }
1115
1116        #[inline(always)]
1117        fn inline_size(_context: fidl::encoding::Context) -> usize {
1118            8
1119        }
1120    }
1121
1122    unsafe impl<D: fidl::encoding::ResourceDialect>
1123        fidl::encoding::Encode<ControlGetMaxAbsoluteBrightnessResponse, D>
1124        for &ControlGetMaxAbsoluteBrightnessResponse
1125    {
1126        #[inline]
1127        unsafe fn encode(
1128            self,
1129            encoder: &mut fidl::encoding::Encoder<'_, D>,
1130            offset: usize,
1131            _depth: fidl::encoding::Depth,
1132        ) -> fidl::Result<()> {
1133            encoder.debug_check_bounds::<ControlGetMaxAbsoluteBrightnessResponse>(offset);
1134            // Delegate to tuple encoding.
1135            fidl::encoding::Encode::<ControlGetMaxAbsoluteBrightnessResponse, D>::encode(
1136                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_brightness),),
1137                encoder,
1138                offset,
1139                _depth,
1140            )
1141        }
1142    }
1143    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
1144        fidl::encoding::Encode<ControlGetMaxAbsoluteBrightnessResponse, D> for (T0,)
1145    {
1146        #[inline]
1147        unsafe fn encode(
1148            self,
1149            encoder: &mut fidl::encoding::Encoder<'_, D>,
1150            offset: usize,
1151            depth: fidl::encoding::Depth,
1152        ) -> fidl::Result<()> {
1153            encoder.debug_check_bounds::<ControlGetMaxAbsoluteBrightnessResponse>(offset);
1154            // Zero out padding regions. There's no need to apply masks
1155            // because the unmasked parts will be overwritten by fields.
1156            // Write the fields.
1157            self.0.encode(encoder, offset + 0, depth)?;
1158            Ok(())
1159        }
1160    }
1161
1162    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1163        for ControlGetMaxAbsoluteBrightnessResponse
1164    {
1165        #[inline(always)]
1166        fn new_empty() -> Self {
1167            Self { max_brightness: fidl::new_empty!(f64, D) }
1168        }
1169
1170        #[inline]
1171        unsafe fn decode(
1172            &mut self,
1173            decoder: &mut fidl::encoding::Decoder<'_, D>,
1174            offset: usize,
1175            _depth: fidl::encoding::Depth,
1176        ) -> fidl::Result<()> {
1177            decoder.debug_check_bounds::<Self>(offset);
1178            // Verify that padding bytes are zero.
1179            fidl::decode!(f64, D, &mut self.max_brightness, decoder, offset + 0, _depth)?;
1180            Ok(())
1181        }
1182    }
1183
1184    impl ColorAdjustmentTable {
1185        #[inline(always)]
1186        fn max_ordinal_present(&self) -> u64 {
1187            if let Some(_) = self.matrix {
1188                return 1;
1189            }
1190            0
1191        }
1192    }
1193
1194    impl fidl::encoding::ValueTypeMarker for ColorAdjustmentTable {
1195        type Borrowed<'a> = &'a Self;
1196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1197            value
1198        }
1199    }
1200
1201    unsafe impl fidl::encoding::TypeMarker for ColorAdjustmentTable {
1202        type Owned = Self;
1203
1204        #[inline(always)]
1205        fn inline_align(_context: fidl::encoding::Context) -> usize {
1206            8
1207        }
1208
1209        #[inline(always)]
1210        fn inline_size(_context: fidl::encoding::Context) -> usize {
1211            16
1212        }
1213    }
1214
1215    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorAdjustmentTable, D>
1216        for &ColorAdjustmentTable
1217    {
1218        unsafe fn encode(
1219            self,
1220            encoder: &mut fidl::encoding::Encoder<'_, D>,
1221            offset: usize,
1222            mut depth: fidl::encoding::Depth,
1223        ) -> fidl::Result<()> {
1224            encoder.debug_check_bounds::<ColorAdjustmentTable>(offset);
1225            // Vector header
1226            let max_ordinal: u64 = self.max_ordinal_present();
1227            encoder.write_num(max_ordinal, offset);
1228            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1229            // Calling encoder.out_of_line_offset(0) is not allowed.
1230            if max_ordinal == 0 {
1231                return Ok(());
1232            }
1233            depth.increment()?;
1234            let envelope_size = 8;
1235            let bytes_len = max_ordinal as usize * envelope_size;
1236            #[allow(unused_variables)]
1237            let offset = encoder.out_of_line_offset(bytes_len);
1238            let mut _prev_end_offset: usize = 0;
1239            if 1 > max_ordinal {
1240                return Ok(());
1241            }
1242
1243            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1244            // are envelope_size bytes.
1245            let cur_offset: usize = (1 - 1) * envelope_size;
1246
1247            // Zero reserved fields.
1248            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1249
1250            // Safety:
1251            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1252            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1253            //   envelope_size bytes, there is always sufficient room.
1254            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<f32, 9>, D>(
1255                self.matrix.as_ref().map(
1256                    <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow,
1257                ),
1258                encoder,
1259                offset + cur_offset,
1260                depth,
1261            )?;
1262
1263            _prev_end_offset = cur_offset + envelope_size;
1264
1265            Ok(())
1266        }
1267    }
1268
1269    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorAdjustmentTable {
1270        #[inline(always)]
1271        fn new_empty() -> Self {
1272            Self::default()
1273        }
1274
1275        unsafe fn decode(
1276            &mut self,
1277            decoder: &mut fidl::encoding::Decoder<'_, D>,
1278            offset: usize,
1279            mut depth: fidl::encoding::Depth,
1280        ) -> fidl::Result<()> {
1281            decoder.debug_check_bounds::<Self>(offset);
1282            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1283                None => return Err(fidl::Error::NotNullable),
1284                Some(len) => len,
1285            };
1286            // Calling decoder.out_of_line_offset(0) is not allowed.
1287            if len == 0 {
1288                return Ok(());
1289            };
1290            depth.increment()?;
1291            let envelope_size = 8;
1292            let bytes_len = len * envelope_size;
1293            let offset = decoder.out_of_line_offset(bytes_len)?;
1294            // Decode the envelope for each type.
1295            let mut _next_ordinal_to_read = 0;
1296            let mut next_offset = offset;
1297            let end_offset = offset + bytes_len;
1298            _next_ordinal_to_read += 1;
1299            if next_offset >= end_offset {
1300                return Ok(());
1301            }
1302
1303            // Decode unknown envelopes for gaps in ordinals.
1304            while _next_ordinal_to_read < 1 {
1305                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1306                _next_ordinal_to_read += 1;
1307                next_offset += envelope_size;
1308            }
1309
1310            let next_out_of_line = decoder.next_out_of_line();
1311            let handles_before = decoder.remaining_handles();
1312            if let Some((inlined, num_bytes, num_handles)) =
1313                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1314            {
1315                let member_inline_size =
1316                    <fidl::encoding::Array<f32, 9> as fidl::encoding::TypeMarker>::inline_size(
1317                        decoder.context,
1318                    );
1319                if inlined != (member_inline_size <= 4) {
1320                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1321                }
1322                let inner_offset;
1323                let mut inner_depth = depth.clone();
1324                if inlined {
1325                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1326                    inner_offset = next_offset;
1327                } else {
1328                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1329                    inner_depth.increment()?;
1330                }
1331                let val_ref = self
1332                    .matrix
1333                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 9>, D));
1334                fidl::decode!(fidl::encoding::Array<f32, 9>, D, val_ref, decoder, inner_offset, inner_depth)?;
1335                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1336                {
1337                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1338                }
1339                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1340                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1341                }
1342            }
1343
1344            next_offset += envelope_size;
1345
1346            // Decode the remaining unknown envelopes.
1347            while next_offset < end_offset {
1348                _next_ordinal_to_read += 1;
1349                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1350                next_offset += envelope_size;
1351            }
1352
1353            Ok(())
1354        }
1355    }
1356}