Struct WideTile

Source
pub struct WideTile<const MODE: u8 = MODE_CPU> {
    pub x: u16,
    pub y: u16,
    pub bg: PremulColor,
    pub cmds: Vec<Cmd>,
    pub n_zero_clip: usize,
    pub n_clip: usize,
    pub n_bufs: usize,
}
Expand description

A wide tile.

Fields§

§x: u16

The x coordinate of the wide tile.

§y: u16

The y coordinate of the wide tile.

§bg: PremulColor

The background of the tile.

§cmds: Vec<Cmd>

The draw commands of the tile.

§n_zero_clip: usize

The number of zero-winding clips.

§n_clip: usize

The number of non-zero-winding clips.

§n_bufs: usize

The number of pushed buffers.

Implementations§

Source§

impl WideTile

Source

pub const WIDTH: u16 = 256u16

The width of a wide tile in pixels.

Source§

impl WideTile<MODE_CPU>

Source

pub fn new(width: u16, height: u16) -> Self

Create a new wide tile.

Source§

impl WideTile<MODE_HYBRID>

Source

pub fn new(width: u16, height: u16) -> Self

Create a new wide tile.

Source§

impl<const MODE: u8> WideTile<MODE>

Source

fn new_internal(x: u16, y: u16) -> Self

Create a new wide tile.

Source

pub(crate) fn fill(&mut self, x: u16, width: u16, paint: Paint)

Source

pub(crate) fn strip(&mut self, cmd_strip: CmdAlphaFill)

Source

pub fn push_clip(&mut self)

Adds a new clip region to the current wide tile.

Source

pub fn pop_clip(&mut self)

Removes the most recently added clip region from the current wide tile.

Source

pub fn push_zero_clip(&mut self)

Adds a zero-winding clip region to the stack.

Source

pub fn pop_zero_clip(&mut self)

Removes the most recently added zero-winding clip region.

Source

pub fn is_zero_clip(&mut self) -> bool

Checks if the current clip region is a zero-winding clip.

Source

pub fn clip_strip(&mut self, cmd_clip_strip: CmdClipAlphaFill)

Applies a clip strip operation with the given parameters.

Source

pub fn clip_fill(&mut self, x: u32, width: u32)

Applies a clip fill operation at the specified position and width.

Source

pub fn push_buf(&mut self)

Push a buffer.

Source

pub fn pop_buf(&mut self)

Pop the most recent buffer.

Source

pub fn opacity(&mut self, opacity: f32)

Apply an opacity to the whole buffer.

Source

pub fn mask(&mut self, mask: Mask)

Apply a mask to the whole buffer.

Source

pub fn blend(&mut self, blend_mode: BlendMode)

Blend the current buffer into the previous buffer in the stack.

Trait Implementations§

Source§

impl<const MODE: u8> Debug for WideTile<MODE>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const MODE: u8> Freeze for WideTile<MODE>

§

impl<const MODE: u8> RefUnwindSafe for WideTile<MODE>

§

impl<const MODE: u8> Send for WideTile<MODE>

§

impl<const MODE: u8> Sync for WideTile<MODE>

§

impl<const MODE: u8> Unpin for WideTile<MODE>

§

impl<const MODE: u8> UnwindSafe for WideTile<MODE>

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> 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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.