Trait veloren_common::vol::SampleVol
source · pub trait SampleVol<I>: BaseVol {
type Sample: BaseVol + ReadVol;
// Required method
fn sample(&self, range: I) -> Result<Self::Sample, Self::Error>;
}
Expand description
A volume that provides the ability to sample (i.e., clone a section of) its voxel data.
TODO (haslersn): Do we still need this now that we have IntoVolIterator
?
Required Associated Types§
Required Methods§
sourcefn sample(&self, range: I) -> Result<Self::Sample, Self::Error>
fn sample(&self, range: I) -> Result<Self::Sample, Self::Error>
Take a sample of the volume by cloning voxels within the provided range.
Note that value and accessibility of voxels outside the bounds of the sample is implementation-defined and should not be used.
Note that the resultant volume has a coordinate space relative to the sample, not the original volume.