pub struct CrawlParams {
pub viewport_w: u32,
pub viewport_h: u32,
pub frame_hz: u32,
pub pixels_per_sec: u32,
pub line_spacing_px: u16,
pub text_color_argb: u32,
pub background_scroll_divisor: u16,
pub perspective_top_width: u16,
pub perspective_bottom_width: u16,
}Expand description
Common tuning parameters for a text-style scroll crawl.
Concrete presets (the disco-demo star crawl, a news ticker, …) fill these in. The platform crate doesn’t mandate a specific rendering style — only a shared shape so BSPs can treat crawls interchangeably and so rate / spacing / perspective tuning is lifted out of ad-hoc per-board constants.
The viewport_w / viewport_h fields describe the target rendering
region — what the effect paints into — and are used by callers to
size jumbo / text-source / scanline buffers before handing them to
the factory. They are not consumed by the effect itself.
Fields§
§viewport_w: u32Target viewport width in pixels.
viewport_h: u32Target viewport height in pixels.
frame_hz: u32Host frame rate in Hz. Effects use this together with
pixels_per_sec to derive the per-frame scroll increment.
pixels_per_sec: u32Declared wall-clock scroll speed, in pixels per second.
line_spacing_px: u16Inter-line spacing in pixels for pre-rendered text.
text_color_argb: u32Text colour in ARGB8888 byte order.
background_scroll_divisor: u16Divider applied to the text scroll accumulator when sampling
the background. 1 locks the background to the text; higher
values create a parallax effect.
perspective_top_width: u16Projected text width at the top edge of the viewport.
perspective_bottom_width: u16Projected text width at the bottom edge of the viewport.
Implementations§
Source§impl CrawlParams
impl CrawlParams
Sourcepub const fn star_crawl_disco(
viewport_w: u32,
viewport_h: u32,
frame_hz: u32,
) -> Self
pub const fn star_crawl_disco( viewport_w: u32, viewport_h: u32, frame_hz: u32, ) -> Self
Disco-demo star-crawl defaults: 40 px/s upward scroll, 36 px line spacing, 360→600 px perspective taper, canonical yellow text, background drifting at 1/3 the text speed.
Matches the STM32H747I-DISCO hardware star crawl and the BBB
Linux port. Hosts that want the sim-style looser spacing can
mutate line_spacing_px after construction.
Trait Implementations§
Source§impl Clone for CrawlParams
impl Clone for CrawlParams
Source§fn clone(&self) -> CrawlParams
fn clone(&self) -> CrawlParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more