mediaframe/source/xrgb.rs
1//! Packed XRGB source (`AV_PIX_FMT_0RGB`) — 8 bits per channel,
2//! byte order `X, R, G, B`. The 1st byte is **ignored padding**
3//! (not real alpha — see [`super::Argb`] for the alpha-bearing
4//! analogue).
5//!
6//! Outputs (Ship 9d):
7//! - `with_rgb` — `argb_to_rgb_row` (drop leading byte; identical to
8//! the [`Argb`](super::Argb) RGB path because both ignore byte 0).
9//! - `with_rgba` — `xrgb_to_rgba_row` (drop padding + force alpha to
10//! `0xFF`).
11//! - `with_luma` — drop padding into `rgb_scratch`, then
12//! `rgb_to_luma_row`.
13//! - `with_hsv` — same scratch path, then `rgb_to_hsv_row`.
14
15use crate::frame::XrgbFrame;
16
17walker! {
18 packed {
19 /// Zero‑sized marker for the packed **XRGB** (a.k.a. `0rgb`) source
20 /// format.
21 #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
22 marker: Xrgb,
23 frame: XrgbFrame<'_>,
24 row: XrgbRow,
25 sink: XrgbSink,
26 walker: xrgb_to,
27 buf_field: xrgb,
28 elem_type: u8,
29 row_elems: |w| w * 4,
30 row_doc: "One output row of an [`Xrgb`] source — `width * 4` packed\n\
31 `X, R, G, B` bytes.",
32 walker_doc: "Walks an [`XrgbFrame`](crate::frame::XrgbFrame) row by row into the sink.",
33 }
34}