pub struct PlanarLedArray { /* private fields */ }Expand description
Regular planar LED grid with row-major physical source indexing.
shape is (rows, columns), pitch_m is (pitch_x, pitch_y), and
reference_index is the fractional (column, row) lattice coordinate at
the pose origin. Source index is row * columns + column. Per-source local
Cartesian corrections are applied before the global ArrayPose.
Implementations§
Source§impl PlanarLedArray
impl PlanarLedArray
Sourcepub fn new(
shape: (usize, usize),
pitch_m: (f64, f64),
reference_index: (f64, f64),
pose: ArrayPose,
) -> Self
pub fn new( shape: (usize, usize), pitch_m: (f64, f64), reference_index: (f64, f64), pose: ArrayPose, ) -> Self
Creates a planar array from its canonical physical fields.
Sourcepub fn with_position_offsets_m(self, offsets: Vec<[f64; 3]>) -> Self
pub fn with_position_offsets_m(self, offsets: Vec<[f64; 3]>) -> Self
Sets array-local per-source Cartesian corrections in metres.
An empty vector means all-zero corrections; otherwise its length must
equal Self::source_count.
Sourcepub fn with_pitch_m(self, pitch_m: (f64, f64)) -> Self
pub fn with_pitch_m(self, pitch_m: (f64, f64)) -> Self
Replaces the physical (pitch_x, pitch_y) lattice spacing in metres.
Sourcepub fn with_reference_index(self, reference_index: (f64, f64)) -> Self
pub fn with_reference_index(self, reference_index: (f64, f64)) -> Self
Replaces the fractional (column, row) lattice coordinate at the pose origin.
Sourcepub fn with_pose(self, pose: ArrayPose) -> Self
pub fn with_pose(self, pose: ArrayPose) -> Self
Replaces the active-extrinsic-XYZ rigid pose of the array.
Sourcepub const fn reference_index(&self) -> (f64, f64)
pub const fn reference_index(&self) -> (f64, f64)
Returns the fractional reference lattice coordinate (column, row).
Sourcepub const fn pose(&self) -> &ArrayPose
pub const fn pose(&self) -> &ArrayPose
Borrows the array-local to sample-coordinate rigid pose.
Sourcepub fn position_offsets_m(&self) -> &[[f64; 3]]
pub fn position_offsets_m(&self) -> &[[f64; 3]]
Borrows canonical local position offsets in metres.
Sourcepub fn source_count(&self) -> usize
pub fn source_count(&self) -> usize
Returns rows * columns, or zero if an impossible platform overflow occurs.
Sourcepub fn source_index(&self, row: usize, column: usize) -> Result<usize>
pub fn source_index(&self, row: usize, column: usize) -> Result<usize>
Converts (row, column) to its row-major source index.
Sourcepub fn source_row_column(&self, index: usize) -> Result<(usize, usize)>
pub fn source_row_column(&self, index: usize) -> Result<(usize, usize)>
Converts a row-major source index to (row, column).
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates dimensions, pitches, reference coordinate, pose, and offsets.
Sourcepub fn resolve(&self, optics: &Optics) -> Result<ResolvedSources>
pub fn resolve(&self, optics: &Optics) -> Result<ResolvedSources>
Resolves physical positions, directions, and transverse propagation vectors.
Trait Implementations§
Source§impl Clone for PlanarLedArray
impl Clone for PlanarLedArray
Source§fn clone(&self) -> PlanarLedArray
fn clone(&self) -> PlanarLedArray
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlanarLedArray
impl Debug for PlanarLedArray
Source§impl<'de> Deserialize<'de> for PlanarLedArray
impl<'de> Deserialize<'de> for PlanarLedArray
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<PlanarLedArray> for SourceGeometry
impl From<PlanarLedArray> for SourceGeometry
Source§fn from(value: PlanarLedArray) -> Self
fn from(value: PlanarLedArray) -> Self
Source§impl PartialEq for PlanarLedArray
impl PartialEq for PlanarLedArray
Source§fn eq(&self, other: &PlanarLedArray) -> bool
fn eq(&self, other: &PlanarLedArray) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PlanarLedArray
impl Serialize for PlanarLedArray
impl StructuralPartialEq for PlanarLedArray
Auto Trait Implementations§
impl Freeze for PlanarLedArray
impl RefUnwindSafe for PlanarLedArray
impl Send for PlanarLedArray
impl Sync for PlanarLedArray
impl Unpin for PlanarLedArray
impl UnsafeUnpin for PlanarLedArray
impl UnwindSafe for PlanarLedArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more