[][src]Struct zeno::Mask

pub struct Mask<'a, 's, D> { /* fields omitted */ }

Builder for configuring and rendering a mask.

Implementations

impl<'a, 's, D> Mask<'a, 's, D> where
    D: PathData
[src]

pub fn new(data: D) -> Self[src]

Creates a new mask builder for the specified path data.

pub fn with_scratch(data: D, scratch: &'s mut Scratch) -> Self[src]

Creates a new mask builder for the specified path data and scratch memory.

pub fn style(&mut self, style: impl Into<Style<'a>>) -> &mut Self[src]

Sets the style of the path. The default is a non-zero fill.

pub fn transform(&mut self, transform: Option<Transform>) -> &mut Self[src]

Sets the transformation matrix of the path.

pub fn format(&mut self, format: Format) -> &mut Self[src]

Sets the desired format of the mask. The default value is an 8-bit alpha format.

pub fn origin(&mut self, origin: Origin) -> &mut Self[src]

Sets the origin that defines the coordinate system for the mask.

pub fn offset(&mut self, offset: impl Into<Vector>) -> &mut Self[src]

Sets the offset for the path.

pub fn size(&mut self, width: u32, height: u32) -> &mut Self[src]

Sets an explicit size for the mask. If left unspecified, the size will be computed from the bounding box of the path after applying any relevant style, offset and transform.

pub fn render_offset(&mut self, offset: impl Into<Vector>) -> &mut Self[src]

Sets an additional rendering offset for the mask. This offset does not affect bounds or size computations and is only applied during rendering.

pub fn inspect(&mut self, f: impl FnMut(Format, u32, u32)) -> &mut Self[src]

Invokes a closure with the format, width and height of the mask provided as arguments. This is primarily useful for preparing a target buffer without interrupting the call chain.

pub fn render_into(&self, buffer: &mut [u8], pitch: Option<usize>) -> Placement[src]

Renders the mask into a byte buffer. If specified, the pitch describes the number of bytes between subsequent rows of the target buffer. This is primarily useful for rendering into tiled images such as texture atlases. If left unspecified, the buffer is assumed to be linear and tightly packed.

pub fn render(&self) -> (Vec<u8>, Placement)[src]

Renders the mask to a newly allocated buffer.

Auto Trait Implementations

impl<'a, 's, D> !RefUnwindSafe for Mask<'a, 's, D>

impl<'a, 's, D> Send for Mask<'a, 's, D> where
    D: Send

impl<'a, 's, D> !Sync for Mask<'a, 's, D>

impl<'a, 's, D> Unpin for Mask<'a, 's, D> where
    D: Unpin

impl<'a, 's, D> !UnwindSafe for Mask<'a, 's, D>

Blanket Implementations

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

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

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

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

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.