Skip to main content

CrawlParams

Struct CrawlParams 

Source
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: u32

Target viewport width in pixels.

§viewport_h: u32

Target viewport height in pixels.

§frame_hz: u32

Host frame rate in Hz. Effects use this together with pixels_per_sec to derive the per-frame scroll increment.

§pixels_per_sec: u32

Declared wall-clock scroll speed, in pixels per second.

§line_spacing_px: u16

Inter-line spacing in pixels for pre-rendered text.

§text_color_argb: u32

Text colour in ARGB8888 byte order.

§background_scroll_divisor: u16

Divider 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: u16

Projected text width at the top edge of the viewport.

§perspective_bottom_width: u16

Projected text width at the bottom edge of the viewport.

Implementations§

Source§

impl CrawlParams

Source

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

Source§

fn clone(&self) -> CrawlParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CrawlParams

Source§

impl Debug for CrawlParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CrawlParams

Source§

impl PartialEq for CrawlParams

Source§

fn eq(&self, other: &CrawlParams) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CrawlParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.