[][src]Struct blend2d::region::Region

#[repr(transparent)]
pub struct Region { /* fields omitted */ }

Methods

impl Region[src]

pub fn new() -> Self[src]

pub fn region_type(&self) -> RegionType[src]

pub fn is_empty(&self) -> bool[src]

Returns true if this region is empty.

pub fn is_rect(&self) -> bool[src]

Returns true if this region is a rectangle.

pub fn is_complex(&self) -> bool[src]

Returns true if this region is of complex shape.

pub fn data(&self) -> &[BoxI][src]

The region's boxes.

pub fn len(&self) -> usize[src]

The number of BoxI this region contains.

pub fn capacity(&self) -> usize[src]

Returns the currently allocated capacity of the region.

pub fn bounding_box(&self) -> &BoxI[src]

A bounding box representing this region.

pub fn clear(&mut self)[src]

Clears the region.

pub fn reserve(&mut self, n: usize)[src]

Reserves capacity for at least n boxes.

Panics

Panics if blend2d returns an OutOfMemory error

pub fn try_reserve(&mut self, n: usize) -> Result<(), OutOfMemory>[src]

Reserves capacity for at least n boxes.

pub fn shrink_to_fit(&mut self)[src]

Shrinks the region's allocated capacity down to its current length.

pub fn combine(&mut self, other: &Self, op: BooleanOp)[src]

pub fn combine_rb(&mut self, b: &BoxI, op: BooleanOp)[src]

pub fn combine_br(&mut self, b: &BoxI, op: BooleanOp)[src]

pub fn combine_bb(&mut self, b: &BoxI, b2: &BoxI, op: BooleanOp)[src]

pub fn translate(&mut self, p: PointI)[src]

Translates the region by the given PointI. Possible overflow will be handled by clipping to a maximum region boundary, so the final region could be smaller than the region before translation.

pub fn translate_and_clip(&mut self, p: PointI, clip: &BoxI)[src]

Translates the region by the given PointI and clips it to the given [BoxI].

pub fn intersect_and_clip(&mut self, region: &Region, clip: &BoxI)[src]

Translates the region by the given region and clips it to the given [BoxI].

pub fn hit_test(&self, p: PointI) -> HitTest[src]

Tests if a given PointI is in the region.

pub fn hit_test_box(&self, b: &BoxI) -> HitTest[src]

Tests if a given BoxI is in the region.

Trait Implementations

impl DeepClone for Region[src]

fn clone_deep(&self) -> Self[src]

Returns a deeply cloned copy of the value.

impl Geometry for Region[src]

impl From<BoxI> for Region[src]

impl<'a> From<&'a [BoxI]> for Region[src]

impl From<RectI> for Region[src]

impl<'a> From<&'a [RectI]> for Region[src]

impl PartialEq<Region> for Region[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Clone for Region[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl AsRef<[BoxI]> for Region[src]

impl Default for Region[src]

impl Drop for Region[src]

impl Debug for Region[src]

impl Borrow<[BoxI]> for Region[src]

Auto Trait Implementations

impl Unpin for Region

impl !Sync for Region

impl !Send for Region

impl RefUnwindSafe for Region

impl UnwindSafe for Region

Blanket Implementations

impl<T> ArrayType for T where
    T: WrappedBlCore, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T, V> SliceConcat<T> for V where
    T: Clone,
    V: Borrow<[T]>, 
[src]

type Output = Vec<T>

🔬 This is a nightly-only experimental API. (slice_concat_trait)

The resulting type after concatenation

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]