Skip to main content

mediaframe/source/
gray10.rs

1//! Walker spec for `Gray10` (FFmpeg `gray10{le,be}`).
2//!
3//! The marker carries `<const BE: bool = false>`; see [`Gray9`](crate::source::Gray9)
4//! for the full BE-flag contract.
5
6use crate::frame::{Gray10Frame, GrayNFrame};
7
8walker! {
9  planar1_bits_be {
10    /// Marker type for the `Gray10` source format (10-bit low-packed u16).
11    /// `<const BE: bool>` defaults to `false` (LE).
12    marker: Gray10,
13    frame: Gray10Frame,
14    generic_frame: GrayNFrame,
15    bits: 10,
16    row: Gray10Row,
17    sink: Gray10Sink,
18    walker: gray10_to,
19    walker_endian: gray10_to_endian,
20    walker_inner: gray10_to_inner,
21    elem_type: u16,
22    row_doc: "A single row from a [`Gray10Frame`](crate::frame::Gray10Frame).",
23    walker_doc: "Walks a [`Gray10Frame<'_, BE>`] row by row, dispatching each \
24                 row to the sink. Propagates `<const BE: bool>` from the \
25                 frame into [`Gray10Sink<BE>`].",
26  }
27}
28
29#[cfg(all(test, feature = "std"))]
30mod tests {
31  use super::*;
32  use crate::color::Matrix;
33
34  // Compile-pass regression for the codex round-1 finding on PR #106
35  // (`planar1_bits_be` arm). See `gray9::tests` for the full rationale.
36  #[test]
37  fn gray10_to_explicit_turbofish_one_generic_compiles() {
38    #[allow(clippy::type_complexity)]
39    fn _check<S: Gray10Sink>() {
40      let _: fn(&crate::frame::Gray10LeFrame<'_>, bool, Matrix, &mut S) -> Result<(), S::Error> =
41        gray10_to::<S>;
42    }
43  }
44}