pub struct ImageRegion {
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
}Expand description
Describes a 2D region for image-like buffer copies.
Fields§
§x: u32X offset in pixels.
y: u32Y offset in pixels.
width: u32Width in pixels.
height: u32Height in pixels.
Implementations§
Source§impl ImageRegion
impl ImageRegion
Sourcepub fn pixel_count(&self) -> u64
pub fn pixel_count(&self) -> u64
Total pixel count.
Sourcepub fn contains_point(&self, px: u32, py: u32) -> bool
pub fn contains_point(&self, px: u32, py: u32) -> bool
Check if a point is inside the region.
Trait Implementations§
Source§impl Clone for ImageRegion
impl Clone for ImageRegion
Source§fn clone(&self) -> ImageRegion
fn clone(&self) -> ImageRegion
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 moreSource§impl Debug for ImageRegion
impl Debug for ImageRegion
Source§impl PartialEq for ImageRegion
impl PartialEq for ImageRegion
impl Copy for ImageRegion
impl Eq for ImageRegion
impl StructuralPartialEq for ImageRegion
Auto Trait Implementations§
impl Freeze for ImageRegion
impl RefUnwindSafe for ImageRegion
impl Send for ImageRegion
impl Sync for ImageRegion
impl Unpin for ImageRegion
impl UnsafeUnpin for ImageRegion
impl UnwindSafe for ImageRegion
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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