[−][src]Struct pix::Region
Location / dimensions of pixels relative to a Raster.
Create directly
let r0 = Region::new(80, 20, 120, 280); let r1 = r0.intersection((50, 40, 360, 240));
Create from Raster
let r = Raster::<Rgb8>::new(100, 100).with_empty(); let reg = r.region(); // (0, 0, 100, 100)
Methods
impl Region
[src]
pub fn new(x: i32, y: i32, width: u32, height: u32) -> Self
[src]
Create a new Region
pub fn intersection<R>(self, rhs: R) -> Self where
R: Into<Self>,
[src]
R: Into<Self>,
Get intersection with another Region
Trait Implementations
impl Clone for Region
[src]
fn clone(&self) -> Region
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<(i32, i32, u32, u32)> for Region
[src]
impl Eq for Region
[src]
impl Copy for Region
[src]
impl PartialEq<Region> for Region
[src]
impl Debug for Region
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,