Skip to main content

PixelDirtyRect

Struct PixelDirtyRect 

Source
pub struct PixelDirtyRect { /* private fields */ }
Expand description

Physical pixel dirty sub-rectangle used by adaptive GLES 3.0 and Metal texture upload planners.

Implementations§

Source§

impl PixelDirtyRect

Geometry and byte-size helpers for PixelDirtyRect.

Source

pub fn right(&self) -> u32

Returns the exclusive right pixel edge (x + width).

§Returns
  • u32 - Exclusive right coordinate in pixels.
Source

pub fn bottom(&self) -> u32

Returns the exclusive bottom pixel edge (y + height).

§Returns
  • u32 - Exclusive bottom coordinate in pixels.
Source

pub fn is_empty(&self) -> bool

Returns true when either width or height is zero.

§Returns
  • bool - true when the rectangle covers zero pixels.
Source

pub fn area_pixels(&self) -> usize

Returns the covered pixel count (width * height).

§Returns
  • usize - Total covered pixels.
Source

pub fn byte_size_rgba8(&self) -> usize

Returns the RGBA8 byte payload size (width * height * 4).

§Returns
  • usize - Payload size in bytes.
Source

pub fn clamp_to(&self, fb_w: u32, fb_h: u32) -> Option<Self>

Clamps this rectangle strictly inside (fb_w, fb_h) surface bounds.

§Arguments
  • u32 - Surface width in pixels.
  • u32 - Surface height in pixels.
§Returns
  • Option<Self> - Clamped non-empty rectangle, or None when outside bounds.
Source

pub fn union_with(&self, other: Self) -> Self

Returns the smallest enclosing bounding rectangle containing both self and other.

§Arguments
  • Self - Other pixel rectangle.
§Returns
  • Self - Enclosing union rectangle.
Source

pub fn intersects_or_adjacent(&self, other: Self, pad_px: u32) -> bool

Returns true when self and other overlap or lie within pad_px pixels of each other.

§Arguments
  • Self - Other pixel rectangle.
  • u32 - Adjacency tolerance in pixels.
§Returns
  • bool - true when the two rectangles overlap or are adjacent within pad_px.
Source§

impl PixelDirtyRect

Source

pub fn get_x(&self) -> u32

Source

pub fn get_mut_x(&mut self) -> &mut u32

Source

pub fn set_x(&mut self, val: u32) -> &mut Self

Source

pub fn get_y(&self) -> u32

Source

pub fn get_mut_y(&mut self) -> &mut u32

Source

pub fn set_y(&mut self, val: u32) -> &mut Self

Source

pub fn get_width(&self) -> u32

Source

pub fn get_mut_width(&mut self) -> &mut u32

Source

pub fn set_width(&mut self, val: u32) -> &mut Self

Source

pub fn get_height(&self) -> u32

Source

pub fn get_mut_height(&mut self) -> &mut u32

Source

pub fn set_height(&mut self, val: u32) -> &mut Self

Source§

impl PixelDirtyRect

Source

pub fn new(x: u32, y: u32, width: u32, height: u32) -> Self

Trait Implementations§

Source§

impl Clone for PixelDirtyRect

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PixelDirtyRect

Source§

impl Debug for PixelDirtyRect

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PixelDirtyRect

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for PixelDirtyRect

Source§

impl PartialEq for PixelDirtyRect

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PixelDirtyRect

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.