pub struct GridSampleOptions {
pub mode: InterpolateMode,
pub padding_mode: GridSamplePaddingMode,
pub align_corners: bool,
}Expand description
Options for grid sampling operations.
Fields§
§mode: InterpolateModeInterpolation mode (bilinear, nearest, or bicubic).
padding_mode: GridSamplePaddingModePadding mode for out-of-bounds coordinates.
align_corners: boolIf true, grid values of -1 and 1 correspond to the corner pixels.
If false, they correspond to the corner points of the corner pixels
(i.e., -1 maps to -0.5 and 1 maps to size - 0.5 in pixel coordinates).
Implementations§
Source§impl GridSampleOptions
impl GridSampleOptions
Sourcepub fn new(mode: InterpolateMode) -> GridSampleOptions
pub fn new(mode: InterpolateMode) -> GridSampleOptions
Create new grid sample options with the given interpolation mode.
Uses default values for padding_mode (Zeros) and align_corners (false).
Sourcepub fn with_padding_mode(
self,
padding_mode: GridSamplePaddingMode,
) -> GridSampleOptions
pub fn with_padding_mode( self, padding_mode: GridSamplePaddingMode, ) -> GridSampleOptions
Set the padding mode.
Sourcepub fn with_align_corners(self, align_corners: bool) -> GridSampleOptions
pub fn with_align_corners(self, align_corners: bool) -> GridSampleOptions
Set align_corners.
Trait Implementations§
Source§impl Clone for GridSampleOptions
impl Clone for GridSampleOptions
Source§fn clone(&self) -> GridSampleOptions
fn clone(&self) -> GridSampleOptions
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GridSampleOptions
impl Debug for GridSampleOptions
Source§impl Default for GridSampleOptions
impl Default for GridSampleOptions
Source§fn default() -> GridSampleOptions
fn default() -> GridSampleOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GridSampleOptions
impl RefUnwindSafe for GridSampleOptions
impl Send for GridSampleOptions
impl Sync for GridSampleOptions
impl Unpin for GridSampleOptions
impl UnwindSafe for GridSampleOptions
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)