pub struct GridConfig {
pub target_nodes: usize,
pub width: usize,
pub height: usize,
pub stride_y: usize,
}Expand description
Configuration for square grid testing
Fields§
§target_nodes: usizeTarget number of nodes (approximately width * height)
width: usizeGrid width
height: usizeGrid height (equals width for square grids)
stride_y: usizeStride Y (next power of two from max dimension)
Implementations§
Source§impl GridConfig
impl GridConfig
Sourcepub fn from_target_nodes(target_nodes: usize) -> Self
pub fn from_target_nodes(target_nodes: usize) -> Self
Create a new grid configuration from a target node count. Finds the nearest integer square root to create a square grid.
Sourcepub fn actual_nodes(&self) -> usize
pub fn actual_nodes(&self) -> usize
Get actual node count (width * height)
Sourcepub fn to_rectangular(&self, aspect_ratio: f64) -> Self
pub fn to_rectangular(&self, aspect_ratio: f64) -> Self
Create a rectangular version of this config with approximately the same number of nodes and the given aspect ratio (width / height).
Trait Implementations§
Source§impl Clone for GridConfig
impl Clone for GridConfig
Source§fn clone(&self) -> GridConfig
fn clone(&self) -> GridConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GridConfig
impl Debug for GridConfig
impl Copy for GridConfig
Auto Trait Implementations§
impl Freeze for GridConfig
impl RefUnwindSafe for GridConfig
impl Send for GridConfig
impl Sync for GridConfig
impl Unpin for GridConfig
impl UnwindSafe for GridConfig
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
Mutably borrows from an owned value. Read more