[−][src]Struct psyche_utils::grid::GridSamplerCluster
Grid sampler that sum fields contained by cluster bounds.
Note
Weight component of sampling result equals number of sampled fields.
Example
use psyche_utils::grid::{Grid, GridSamplerCluster}; let grid = Grid::new(2, 2, 1.0); let sampler = GridSamplerCluster::new((0, 0), (1, 1)); assert_eq!(grid.sample(sampler).unwrap(), (4.0, 4));
Fields
from: (usize, usize)
Bounds column and row starting point.
to: (usize, usize)
Bounds number of columns and rows that defines cluster size.
Methods
impl GridSamplerCluster
[src]
pub fn new(from: (usize, usize), to: (usize, usize)) -> Self
[src]
pub fn center(center: (usize, usize), size: (usize, usize)) -> Self
[src]
pub fn center_extents(center: (usize, usize), extents: (usize, usize)) -> Self
[src]
pub fn valid_from(&self) -> (usize, usize)
[src]
pub fn valid_to(&self) -> (usize, usize)
[src]
pub fn cells(&self) -> usize
[src]
Trait Implementations
impl<T> GridSampler<T, usize> for GridSamplerCluster where
T: GridSampleZeroValue<T> + Add<Output = T> + Clone,
[src]
T: GridSampleZeroValue<T> + Add<Output = T> + Clone,
impl Eq for GridSamplerCluster
[src]
impl PartialEq<GridSamplerCluster> for GridSamplerCluster
[src]
fn eq(&self, other: &GridSamplerCluster) -> bool
[src]
fn ne(&self, other: &GridSamplerCluster) -> bool
[src]
impl Clone for GridSamplerCluster
[src]
fn clone(&self) -> GridSamplerCluster
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for GridSamplerCluster
[src]
Auto Trait Implementations
impl Send for GridSamplerCluster
impl Sync for GridSamplerCluster
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,