Struct GridSampleOptions
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§
§impl GridSampleOptions
impl GridSampleOptions
pub 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).
pub fn with_padding_mode(
self,
padding_mode: GridSamplePaddingMode,
) -> GridSampleOptions
pub fn with_padding_mode( self, padding_mode: GridSamplePaddingMode, ) -> GridSampleOptions
Set the padding mode.
pub fn with_align_corners(self, align_corners: bool) -> GridSampleOptions
pub fn with_align_corners(self, align_corners: bool) -> GridSampleOptions
Set align_corners.
Trait Implementations§
§impl Clone for GridSampleOptions
impl Clone for GridSampleOptions
§fn clone(&self) -> GridSampleOptions
fn clone(&self) -> GridSampleOptions
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 more§impl Debug for GridSampleOptions
impl Debug for GridSampleOptions
§impl Default for GridSampleOptions
impl Default for GridSampleOptions
§fn default() -> GridSampleOptions
fn default() -> GridSampleOptions
Returns the “default value” for a type. Read more
§impl From<GridSampleOptions> for GridSampleOptionsIr
impl From<GridSampleOptions> for GridSampleOptionsIr
§fn from(val: GridSampleOptions) -> GridSampleOptionsIr
fn from(val: GridSampleOptions) -> GridSampleOptionsIr
Converts to this type from the input type.
§impl From<GridSampleOptionsIr> for GridSampleOptions
impl From<GridSampleOptionsIr> for GridSampleOptions
§fn from(val: GridSampleOptionsIr) -> GridSampleOptions
fn from(val: GridSampleOptionsIr) -> GridSampleOptions
Converts to this type from the input type.
§impl From<InterpolateMode> for GridSampleOptions
impl From<InterpolateMode> for GridSampleOptions
§fn from(value: InterpolateMode) -> GridSampleOptions
fn from(value: InterpolateMode) -> GridSampleOptions
Converts to this type from the input type.
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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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