1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/// Trait for one-dimensional LED layouts.
///
/// Implementors of this trait represent a linear arrangement of LEDs.
///
/// Use [`layout1d!`](crate::layout1d) to define a type that implements [`Layout1d`].
///
/// For our 1D space, the first LED pixel will be at -1.0 and the last LED pixel will be at 1.0.
/// Creates a one-dimensional LED layout from a pixel count.
///
/// # Arguments
///
/// - `#[$attr]` - Optional attributes to apply to the struct (e.g., `#[derive(Debug)]`)
/// - `$vis` - Optional visibility modifier (e.g., `pub`)
/// - `$name` - The name of the layout type to create
/// - `$pixel_count` - The number of LEDs in the layout
///
/// # Output
///
/// Macro output will be a type definition that implements [`Layout1d`].
///
/// # Example
///
/// ```rust
/// use blinksy::layout1d;
///
/// // Define a strip with 60 LEDs
/// layout1d!(Layout, 60);
///
/// // Define a public strip with 60 LEDs
/// layout1d!(pub PubLayout, 60);
///
/// // Define a layout with attributes
/// layout1d!(
/// #[doc = "A strip of 60 LEDs for the main display"]
/// #[derive(Debug)]
/// pub AttrsLayout,
/// 60
/// );
/// ```