pub struct SamplingMode {
pub sampling_method: i32,
}Expand description
Specifies how grid points are sampled from an interval.
Without the loss of generality, assume the interval to be [0, X-1] from which N points are to be sampled.
Here X may correspond to an input image’s height or width.
All the methods can be expressed in terms of numpy’s linspace function, along with the constraint that grid points have to lie in the interval [0, X-1].
Note: numpy.linspace(start = start, end = end, num = N, endpoint = True) corresponds to sampling
N points uniformly from the interval [start, end], endpoints included.
The methods vary in how the start and end values are computed.
Fields§
§sampling_method: i32Implementations§
Source§impl SamplingMode
impl SamplingMode
Sourcepub fn sampling_method(&self) -> Method
pub fn sampling_method(&self) -> Method
Returns the enum value of sampling_method, or the default if the field is set to an invalid enum value.
Sourcepub fn set_sampling_method(&mut self, value: Method)
pub fn set_sampling_method(&mut self, value: Method)
Sets sampling_method to the provided enum value.
Trait Implementations§
Source§impl Clone for SamplingMode
impl Clone for SamplingMode
Source§fn clone(&self) -> SamplingMode
fn clone(&self) -> SamplingMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SamplingMode
impl Debug for SamplingMode
Source§impl Default for SamplingMode
impl Default for SamplingMode
Source§impl Hash for SamplingMode
impl Hash for SamplingMode
Source§impl Message for SamplingMode
impl Message for SamplingMode
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for SamplingMode
impl PartialEq for SamplingMode
Source§fn eq(&self, other: &SamplingMode) -> bool
fn eq(&self, other: &SamplingMode) -> bool
self and other values to be equal, and is used by ==.