Struct gelatin::misc::LogicalVector
source · [−]Expand description
Used to represent logical pixel coordinates and dimensions.
This struct is distinct from PhysicalVector
which represents
physical pixel coordinates and dimensions to avoid
confusion when dealing with scaled dpi scenarios.
Fields
vec: Vector2<f32>
Implementations
Trait Implementations
sourceimpl Add<LogicalVector> for LogicalVector
impl Add<LogicalVector> for LogicalVector
type Output = LogicalVector
type Output = LogicalVector
The resulting type after applying the
+
operator.sourcefn add(self, other: LogicalVector) -> Self::Output
fn add(self, other: LogicalVector) -> Self::Output
Performs the
+
operation. Read moresourceimpl AddAssign<LogicalVector> for LogicalVector
impl AddAssign<LogicalVector> for LogicalVector
sourcefn add_assign(&mut self, other: LogicalVector)
fn add_assign(&mut self, other: LogicalVector)
Performs the
+=
operation. Read moresourceimpl Clone for LogicalVector
impl Clone for LogicalVector
sourcefn clone(&self) -> LogicalVector
fn clone(&self) -> LogicalVector
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LogicalVector
impl Debug for LogicalVector
sourceimpl Default for LogicalVector
impl Default for LogicalVector
sourcefn default() -> LogicalVector
fn default() -> LogicalVector
Returns the “default value” for a type. Read more
sourceimpl<T: Into<f32>> Div<T> for LogicalVector
impl<T: Into<f32>> Div<T> for LogicalVector
sourceimpl From<LogicalPosition<f32>> for LogicalVector
impl From<LogicalPosition<f32>> for LogicalVector
sourcefn from(other: LogicalPosition<f32>) -> LogicalVector
fn from(other: LogicalPosition<f32>) -> LogicalVector
Converts to this type from the input type.
sourceimpl From<LogicalSize<f32>> for LogicalVector
impl From<LogicalSize<f32>> for LogicalVector
sourcefn from(other: LogicalSize<f32>) -> LogicalVector
fn from(other: LogicalSize<f32>) -> LogicalVector
Converts to this type from the input type.
sourceimpl From<LogicalVector> for LogicalPosition<f32>
impl From<LogicalVector> for LogicalPosition<f32>
sourcefn from(vec: LogicalVector) -> Self
fn from(vec: LogicalVector) -> Self
Converts to this type from the input type.
sourceimpl From<LogicalVector> for LogicalSize<f32>
impl From<LogicalVector> for LogicalSize<f32>
sourcefn from(vec: LogicalVector) -> Self
fn from(vec: LogicalVector) -> Self
Converts to this type from the input type.
sourceimpl<T: Into<f32>> From<Vector2<T>> for LogicalVector
impl<T: Into<f32>> From<Vector2<T>> for LogicalVector
sourcefn from(other: Vector2<T>) -> LogicalVector
fn from(other: Vector2<T>) -> LogicalVector
Converts to this type from the input type.
sourceimpl<T: Into<f64>> FromPhysical<PhysicalPosition<T>> for LogicalVector
impl<T: Into<f64>> FromPhysical<PhysicalPosition<T>> for LogicalVector
fn from_physical(source: PhysicalPosition<T>, scale_factor: f32) -> Self
sourceimpl<T: Into<f64>> FromPhysical<PhysicalSize<T>> for LogicalVector
impl<T: Into<f64>> FromPhysical<PhysicalSize<T>> for LogicalVector
fn from_physical(source: PhysicalSize<T>, scale_factor: f32) -> Self
sourceimpl Mul<LogicalVector> for f32
impl Mul<LogicalVector> for f32
type Output = LogicalVector
type Output = LogicalVector
The resulting type after applying the
*
operator.sourcefn mul(self, other: LogicalVector) -> Self::Output
fn mul(self, other: LogicalVector) -> Self::Output
Performs the
*
operation. Read moresourceimpl<T: Into<f32>> Mul<T> for LogicalVector
impl<T: Into<f32>> Mul<T> for LogicalVector
sourceimpl Sub<LogicalVector> for LogicalVector
impl Sub<LogicalVector> for LogicalVector
type Output = LogicalVector
type Output = LogicalVector
The resulting type after applying the
-
operator.sourcefn sub(self, other: LogicalVector) -> Self::Output
fn sub(self, other: LogicalVector) -> Self::Output
Performs the
-
operation. Read moreimpl Copy for LogicalVector
Auto Trait Implementations
impl RefUnwindSafe for LogicalVector
impl Send for LogicalVector
impl Sync for LogicalVector
impl Unpin for LogicalVector
impl UnwindSafe for LogicalVector
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Content for Twhere
T: Copy,
impl<T> Content for Twhere
T: Copy,
type Owned = T
type Owned = T
A type that holds a sized version of the content.
sourcefn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
fn read<F, E>(size: usize, f: F) -> Result<T, E>where
F: FnOnce(&mut T) -> Result<(), E>,
Prepares an output buffer, then turns this buffer into an
Owned
.sourcefn get_elements_size() -> usize
fn get_elements_size() -> usize
Returns the size of each element.
sourcefn to_void_ptr(&self) -> *const ()
fn to_void_ptr(&self) -> *const ()
Produces a pointer to the data.
sourcefn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
fn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
Builds a pointer to this type from a raw pointer.
sourcefn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_big_endian()
.sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_native_endian()
.