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 (const: unstable) · 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 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
Source§impl From<GridSampleOptionsIr> for GridSampleOptions
impl From<GridSampleOptionsIr> for GridSampleOptions
Source§fn from(val: GridSampleOptionsIr) -> GridSampleOptions
fn from(val: GridSampleOptionsIr) -> GridSampleOptions
Converts to this type from the input type.
Source§impl From<InterpolateMode> for GridSampleOptions
impl From<InterpolateMode> for GridSampleOptions
Source§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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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